Recheck the submitting principal and protect stored log output
This commit is contained in:
@@ -184,7 +184,12 @@ fn classification_cannot_be_bypassed_by_another_scope_or_empty_env() {
|
||||
other.agent_id = job.agent_id;
|
||||
other.principals = vec!["another-actor".into()];
|
||||
policy.scopes.push(other);
|
||||
assert!(policy.sensitive_log_unit(&job, "rmm-acceptance.service", Some(&[])));
|
||||
assert!(sensitive_log_unit(
|
||||
Some(&policy),
|
||||
&job,
|
||||
"rmm-acceptance.service",
|
||||
Some(&[])
|
||||
));
|
||||
for unit in [
|
||||
"ssh.service",
|
||||
"sshd.service",
|
||||
@@ -192,10 +197,20 @@ fn classification_cannot_be_bypassed_by_another_scope_or_empty_env() {
|
||||
"auditd.service",
|
||||
"systemd-logind.service",
|
||||
] {
|
||||
assert!(policy.sensitive_log_unit(&job, unit, Some(&[])));
|
||||
assert!(sensitive_log_unit(Some(&policy), &job, unit, Some(&[])));
|
||||
}
|
||||
assert!(policy.sensitive_log_unit(&job, "custom.service", Some(&["custom.service".into()])));
|
||||
assert!(!policy.sensitive_log_unit(&job, "ordinary.service", None));
|
||||
assert!(sensitive_log_unit(
|
||||
Some(&policy),
|
||||
&job,
|
||||
"custom.service",
|
||||
Some(&["custom.service".into()])
|
||||
));
|
||||
assert!(!sensitive_log_unit(
|
||||
Some(&policy),
|
||||
&job,
|
||||
"ordinary.service",
|
||||
None
|
||||
));
|
||||
}
|
||||
#[test]
|
||||
fn permissions_are_separate_root_read_and_sensitive_requirements() {
|
||||
|
||||
Reference in New Issue
Block a user