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 · 0 comments
Open

Audit issue on the CIS recommandation 5.3.3 #36

Rafouf69 opened this issue Oct 22, 2024 · 0 comments
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
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

1 participant