Skip to content

Commit

Permalink
bloodhound: Fix journal file permission check
Browse files Browse the repository at this point in the history
The Bottlerocket CIS check 4.1.2 would correctly report if there was a
failing condition, but it missed changing the result from SKIP to PASS
if there was no failure.

This updates the result for 4.1.2 so that it will correctly report
success as long as there are no non-compliant journal file permissions.

Signed-off-by: Sean McGinnis <[email protected]>
  • Loading branch information
stmcginnis committed Oct 23, 2023
1 parent 686c785 commit 003aacf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sources/bloodhound/src/bin/bottlerocket-checks/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,13 @@ pub struct BR04010200Checker {}

impl Checker for BR04010200Checker {
fn execute(&self) -> CheckerResult {
let mut result = CheckerResult::default();
// Default the result to report success
let mut result = {
CheckerResult {
status: CheckStatus::PASS,
..Default::default()
}
};

// Recursively walk over all files in /var/log/journal and check perms
for file in WalkDir::new("/var/log/journal")
Expand Down

0 comments on commit 003aacf

Please sign in to comment.