Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit issue on the CIS recommandation 5.3.3 #36

Open
Rafouf69 opened this issue Oct 22, 2024 · 1 comment
Open

Audit issue on the CIS recommandation 5.3.3 #36

Rafouf69 opened this issue Oct 22, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Rafouf69
Copy link

Describe the Issue

The audit test for the CIS recommandation 5.3.3 passes successfully while I do not have any logfile configured.

            "successful": true,
            "summary-line": "Command: log_sudoers_d: stdout: matches expectation: [\"/[1:99]/\"]",
            "summary-line-compact": "Command: log_sudoers_d: stdout: matches expectation: [\"/[1:99]/\"]",

I tried to manually launch the test as shown below. It seems that the regex rule is wrong since it's greping the ASCII character :.

$ sudo grep -Ec '^Defaults logfile=/var/log/*.log' /etc/sudoers /etc/sudoers.d/.*/ | egrep "[1:99]"
/etc/sudoers:0
/etc/sudoers.d/../:0
/etc/sudoers.d/./:0
grep: /etc/sudoers.d/../: Is a directory
grep: /etc/sudoers.d/./: Is a directory

Expected Behavior
Failing test.

Actual Behavior
The test is marked as successful since it's grepping :.

Control(s) Affected
CIS 5.3.3

Environment (please complete the following information):

branch being used: devel
Ansible Version: 2.14.11
Host Python Version: 3.10.12
Ansible Server Python Version: 3.10.12

Possible Solution

Modify the regex rule in the in the line 10 of the test from;

    - '/[1:99]/'

to

    - '/[1-99]/'
@Rafouf69 Rafouf69 added the bug Something isn't working label Oct 22, 2024
uk-bolly added a commit that referenced this issue Nov 4, 2024
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
@uk-bolly uk-bolly mentioned this issue Nov 4, 2024
uk-bolly added a commit that referenced this issue Nov 4, 2024
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
@uk-bolly uk-bolly mentioned this issue Nov 4, 2024
@uk-bolly uk-bolly self-assigned this Nov 5, 2024
@uk-bolly
Copy link
Member

uk-bolly commented Nov 5, 2024

hi @Rafouf69

Thank you for raising this issue. This should now be merged to the relevant branch for the benchmark version.

Kindest regards

uk-bolly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants