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

support limited defaults section #8

Open
weakcamel opened this issue Mar 3, 2021 · 0 comments
Open

support limited defaults section #8

weakcamel opened this issue Mar 3, 2021 · 0 comments

Comments

@weakcamel
Copy link

weakcamel commented Mar 3, 2021

From man sudoers on Ubuntu Xenial:

 Defaults
     Certain configuration options may be changed from their default values at run-time via one or more Default_Entry lines.  These may affect all users on any host, all users on a specific host, a
     specific user, a specific command, or commands being run as a specific user.  Note that per-command entries may not include command line arguments.  If you need to specify arguments, define a
     Cmnd_Alias and reference that instead.

     Default_Type ::= 'Defaults' |
                      'Defaults' '@' Host_List |
                      'Defaults' ':' User_List |
                      'Defaults' '!' Cmnd_List |
                      'Defaults' '>' Runas_List

     Default_Entry ::= Default_Type Parameter_List

     Parameter_List ::= Parameter |
                        Parameter ',' Parameter_List

     Parameter ::= Parameter '=' Value |
                   Parameter '+=' Value |
                   Parameter '-=' Value |
                   '!'* Parameter

...
...

     Defaults entries are parsed in the following order: generic, host, user and runas Defaults first, then command defaults.  If there are multiple Defaults settings of the same type, the last
     matching setting is used.  The following Defaults settings are parsed before all others since they may affect subsequent entries: fqdn, group_plugin, runas_default, sudoers_locale.

     See SUDOERS OPTIONS for a list of supported Defaults parameters.

It would be great if this role supported Host/User/Cmnd/Runas defaults as well. The current templates:

make it not possible. Note that an extra space between Defaults and the special characters are not accepted by sudo (e.g. Defaults : !MY_COMMAND !requiretty is rejected by sudo as syntax error.

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

No branches or pull requests

2 participants