|
Bugzilla – Full Text Bug Listing |
| Summary: | Excessively picky about mode for sudoers.d files; requires 0440 | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Josh Triplett <josh> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | jhawk |
| Priority: | low | ||
| Version: | 1.7.4 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
Josh Triplett
2011-04-20 18:06:38 MDT
I'd like to +1 this, if I may, for all the reasons Josh supplied. In many environments I'd like users to be able to determine who the sudoers are. I suppose that the sudoers file could grant all users the permission to cat the sudoers file, but that is clumsy. I would much rather have this feature go away, or at least a reasonable option to disable it. Ideally not a build-time option, since it is convenient to used packaged binaries. Thanks. Knowing who has sudoers permissions tells a potential attacker what user accounts to target in order to gain root privileges. That's why the default sudoers mode is not world-readable. This is settable at build time with the --with-sudoers-mode configure setting. I've relaxed the permission checking for sudo 1.8.5 and will keep this bug open until 1.8.5 is released. (In reply to comment #2) Thank you, Todd. > Knowing who has sudoers permissions tells a potential attacker what > user accounts to target in order to gain root privileges. Understood. That's a trade-off that I think is reasonable for sysadmins to make a judgement on, but you are right that it is not without cost. Incidently, "visudo -c" does not check the modes. That feels...unfortunate, because it makes it easier to lock yourself out of sudo, even if you are careful. IMO that should be something that is very very hard to do. Should a separate bug be filed? (In fact, I would think that if this feature of mode-checking was retained, that it would be better to simply be extremely noisy about the misconfiguration, but never to lock out legitimate users. But this is a philosophical question). > This is settable at build time with the --with-sudoers-mode > configure setting. I noticed that, but it seems problematic in two ways: #1 It does not help those who use binary packages, which is just about everbody. #2 In a shared administrative environment where there are admins (or scripts!) used to sudo's mode 440 requirement, it doesn't seem a huge stretch that someone may attempt to be helpful by resetting the mode to 440 from 444, thus breaking everything. It would be much better to have a way to get rid of the check entirely. > I've relaxed the permission checking for sudo 1.8.5 and will keep this > bug open until 1.8.5 is released. Great. I would love to see the details on this, but it does not yet appear to be at http://www.sudo.ws/repos/sudo, unless I am missing it. visudo will check the mode in "strict mode", e.g. # visudo -c -s /etc/sudoers: parsed OK /etc/sudoers: bad permissions, should be mode 0440 However, it currently only checks permissions for the main sudoers file and not the included ones. It's probably reasonable to check permissions by default unless the -f flag was specified. I hadn't pushed the change to the source repo yet, it's there now: http://www.sudo.ws/repos/sudo/rev/241174babfcc Sudo 1.8.5 is less picky about the sudoers file modes. |