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

/etc/sudoers.d regex is incomplete #12588

Open
mrozekma opened this issue Nov 7, 2024 · 0 comments
Open

/etc/sudoers.d regex is incomplete #12588

mrozekma opened this issue Nov 7, 2024 · 0 comments

Comments

@mrozekma
Copy link

mrozekma commented Nov 7, 2024

There are rules (e.g. sudo_require_reauthentication, but probably others) that check sudo's configuration by scanning /etc/sudoers and all files in /etc/sudoers.d. For example, sudo_require_reauthentication uses the regex ^\/etc\/(sudoers|sudoers\.d\/.*)$.

This is mostly correct, assuming /etc/sudoers actually has an includedir for that directory, but sudo ignores certain filename patterns. From the sudoers man page:

For example, given:

    @includedir /etc/sudoers.d

sudo will suspend processing of the current file and read each file in /etc/sudoers.d, skipping file names that end in ‘~’ or contain a ‘.’ character to avoid causing problems with package manager or editor temporary/backup files.

So if /etc/sudoers.d/example.conf contains Defaults timestamp_timeout=1, sudo will ignore it but an oscap run will mark it as passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant