X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=sudoers.cat;h=97ad5ad2e9ed922bb4c0669df483ed562d528b1d;hb=32575a71a40b403b5ff6b0e37c76e28038475167;hp=324b278744ddb3017d9efeb46d3348c45c017b6a;hpb=034c7278c8e894d8ab427cb251ee768dfc419178;p=debian%2Fsudo diff --git a/sudoers.cat b/sudoers.cat index 324b278..97ad5ad 100644 --- a/sudoers.cat +++ b/sudoers.cat @@ -20,8 +20,7 @@ DDEESSCCRRIIPPTTIIOONN Form (EBNF). Don't despair if you don't know what EBNF is; it is fairly simple, and the definitions below are annotated. - QQuuiicckk gguuiiddee ttoo EEBBNNFF - + QQuuiicckk gguuiiddee ttoo EEBBNNFF EBNF is a concise and exact way of describing the grammar of a language. Each EBNF definition is made up of _p_r_o_d_u_c_t_i_o_n _r_u_l_e_s. E.g., @@ -45,8 +44,7 @@ DDEESSCCRRIIPPTTIIOONN will use single quotes ('') to designate what is a verbatim character string (as opposed to a symbol name). - AAlliiaasseess - + AAlliiaasseess There are four kinds of aliases: User_Alias, Runas_Alias, Host_Alias and Cmnd_Alias. @@ -59,19 +57,19 @@ DDEESSCCRRIIPPTTIIOONN Runas_Alias ::= NAME '=' Runas_List + Host_Alias ::= NAME '=' Host_List -1.7.2p1 June 30, 2009 1 +1.7.2p6 April 7, 2010 1 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - Host_Alias ::= NAME '=' Host_List Cmnd_Alias ::= NAME '=' Cmnd_List @@ -124,10 +122,12 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) Note that quotes around group names are optional. Unquoted strings must use a backslash (\) to escape spaces and the '@' symbol. + Runas_List ::= Runas_Member | + Runas_Member ',' Runas_List -1.7.2p1 June 30, 2009 2 +1.7.2p6 April 7, 2010 2 @@ -136,8 +136,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - Runas_List ::= Runas_Member | - Runas_Member ',' Runas_List Runas_Member ::= '!'* username | '!'* '#'uid | @@ -190,10 +188,12 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) other aliases. A commandname is a fully qualified filename which may include shell-style wildcards (see the Wildcards section below). A simple filename allows the user to run the command with any arguments + he/she wishes. However, you may also specify command line arguments + (including wildcards). Alternately, you can specify "" to indicate -1.7.2p1 June 30, 2009 3 +1.7.2p6 April 7, 2010 3 @@ -202,8 +202,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - he/she wishes. However, you may also specify command line arguments - (including wildcards). Alternately, you can specify "" to indicate that the command may only be run wwiitthhoouutt command line arguments. A directory is a fully qualified pathname ending in a '/'. When you specify a directory in a Cmnd_List, the user will be able to run any @@ -217,8 +215,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) to permit a user to run ssuuddoo with the --ee option (or as ssuuddooeeddiitt). It may take command line arguments just as a normal command does. - DDeeffaauullttss - + DDeeffaauullttss Certain configuration options may be changed from their default values at runtime 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 @@ -256,24 +253,22 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) not exist in a list. Defaults entries are parsed in the following order: generic, host and + user Defaults first, then runas Defaults and finally command defaults. - - -1.7.2p1 June 30, 2009 4 + See "SUDOERS OPTIONS" for a list of supported Defaults parameters. +1.7.2p6 April 7, 2010 4 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - user Defaults first, then runas Defaults and finally command defaults. - See "SUDOERS OPTIONS" for a list of supported Defaults parameters. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - UUsseerr SSppeecciiffiiccaattiioonn + UUsseerr SSppeecciiffiiccaattiioonn User_Spec ::= User_List Host_List '=' Cmnd_Spec_List \ (':' Host_List '=' Cmnd_Spec_List)* @@ -294,8 +289,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) The basic structure of a user specification is `who = where (as_whom) what'. Let's break that down into its constituent parts: - RRuunnaass__SSppeecc - + RRuunnaass__SSppeecc A Runas_Spec determines the user and/or the group that a command may be run as. A fully-specified Runas_Spec consists of two Runas_Lists (as defined above) separated by a colon (':') and enclosed in a set of @@ -323,21 +317,22 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) It is also possible to override a Runas_Spec later on in an entry. If we modify the entry like so: + dgb boulder = (operator) /bin/ls, (root) /bin/kill, /usr/bin/lprm + Then user ddggbb is now allowed to run _/_b_i_n_/_l_s as ooppeerraattoorr, but _/_b_i_n_/_k_i_l_l + and _/_u_s_r_/_b_i_n_/_l_p_r_m as rroooott. -1.7.2p1 June 30, 2009 5 +1.7.2p6 April 7, 2010 5 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - dgb boulder = (operator) /bin/ls, (root) /bin/kill, /usr/bin/lprm - Then user ddggbb is now allowed to run _/_b_i_n_/_l_s as ooppeerraattoorr, but _/_b_i_n_/_k_i_l_l - and _/_u_s_r_/_b_i_n_/_l_p_r_m as rroooott. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) + We can extend this to allow ddggbb to run /bin/ls with either the user or group set to ooppeerraattoorr: @@ -352,8 +347,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) tcm boulder = (:dialer) /usr/bin/tip, /usr/bin/cu, \ /usr/local/bin/minicom - TTaagg__SSppeecc - + TTaagg__SSppeecc A command may have zero or more tags associated with it. There are eight possible tag values, NOPASSWD, PASSWD, NOEXEC, EXEC, SETENV and NOSETENV. Once a tag is set on a Cmnd, subsequent Cmnds in the @@ -389,22 +383,23 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) _N_O_E_X_E_C _a_n_d _E_X_E_C + If ssuuddoo has been compiled with _n_o_e_x_e_c support and the underlying + operating system supports it, the NOEXEC tag can be used to prevent a + dynamically-linked executable from running further commands itself. + In the following example, user aaaarroonn may run _/_u_s_r_/_b_i_n_/_m_o_r_e and -1.7.2p1 June 30, 2009 6 +1.7.2p6 April 7, 2010 6 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - If ssuuddoo has been compiled with _n_o_e_x_e_c support and the underlying - operating system supports it, the NOEXEC tag can be used to prevent a - dynamically-linked executable from running further commands itself. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) + - In the following example, user aaaarroonn may run _/_u_s_r_/_b_i_n_/_m_o_r_e and _/_u_s_r_/_b_i_n_/_v_i but shell escapes will be disabled. aaron shanty = NOEXEC: /usr/bin/more, /usr/bin/vi @@ -422,8 +417,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) If the command matched is AALLLL, the SETENV tag is implied for that command; this default may be overridden by use of the UNSETENV tag. - WWiillddccaarrddss - + WWiillddccaarrddss ssuuddoo allows shell-style _w_i_l_d_c_a_r_d_s (aka meta or glob characters) to be used in hostnames, pathnames and command line arguments in the _s_u_d_o_e_r_s file. Wildcard matching is done via the PPOOSSIIXX _g_l_o_b(3) and _f_n_m_a_t_c_h(3) @@ -454,30 +448,28 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) /usr/bin/* + match _/_u_s_r_/_b_i_n_/_w_h_o but not _/_u_s_r_/_b_i_n_/_X_1_1_/_x_t_e_r_m. + EExxcceeppttiioonnss ttoo wwiillddccaarrdd rruulleess + The following exceptions apply to the above rules: - -1.7.2p1 June 30, 2009 7 + "" If the empty string "" is the only command line argument in the +1.7.2p6 April 7, 2010 7 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - match _/_u_s_r_/_b_i_n_/_w_h_o but not _/_u_s_r_/_b_i_n_/_X_1_1_/_x_t_e_r_m. - EExxcceeppttiioonnss ttoo wwiillddccaarrdd rruulleess +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - The following exceptions apply to the above rules: - "" If the empty string "" is the only command line argument in the _s_u_d_o_e_r_s entry it means that command is not allowed to be run with aannyy arguments. - IInncclluuddiinngg ootthheerr ffiilleess ffrroomm wwiitthhiinn ssuuddooeerrss - + IInncclluuddiinngg ootthheerr ffiilleess ffrroomm wwiitthhiinn ssuuddooeerrss It is possible to include other _s_u_d_o_e_r_s files from within the _s_u_d_o_e_r_s file currently being parsed using the #include and #includedir directives. @@ -520,27 +512,26 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) in the file names can be used to avoid such problems. Note that unlike files included via #include, vviissuuddoo will not edit the + files in a #includedir directory unless one of them contains a syntax + error. It is still possible to run vviissuuddoo with the -f flag to edit the + files directly. + OOtthheerr ssppeecciiaall cchhaarraacctteerrss aanndd rreesseerrvveedd wwoorrddss + The pound sign ('#') is used to indicate a comment (unless it is part + of a #include directive or unless it occurs in the context of a user + name and is followed by one or more digits, in which case it is treated -1.7.2p1 June 30, 2009 8 +1.7.2p6 April 7, 2010 8 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - files in a #includedir directory unless one of them contains a syntax - error. It is still possible to run vviissuuddoo with the -f flag to edit the - files directly. - - OOtthheerr ssppeecciiaall cchhaarraacctteerrss aanndd rreesseerrvveedd wwoorrddss - The pound sign ('#') is used to indicate a comment (unless it is part - of a #include directive or unless it occurs in the context of a user - name and is followed by one or more digits, in which case it is treated as a uid). Both the comment character and any text after it, up to the end of the line, are ignored. @@ -587,25 +578,26 @@ SSUUDDOOEERRSS OOPPTTIIOONNSS the PASSWD and NOPASSWD tags. This flag is _o_n by default. + closefrom_override + If set, the user may use ssuuddoo's --CC option which + overrides the default starting point at which ssuuddoo + begins closing open file descriptors. This flag is _o_f_f + by default. + env_editor If set, vviissuuddoo will use the value of the EDITOR or + VISUAL environment variables before falling back on the -1.7.2p1 June 30, 2009 9 +1.7.2p6 April 7, 2010 9 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - closefrom_override - If set, the user may use ssuuddoo's --CC option which - overrides the default starting point at which ssuuddoo - begins closing open file descriptors. This flag is _o_f_f - by default. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) + - env_editor If set, vviissuuddoo will use the value of the EDITOR or - VISUAL environment variables before falling back on the default editor list. Note that this may create a security hole as it allows the user to run any arbitrary command as root without logging. A safer @@ -652,25 +644,25 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) operators who would attempt to add roles to _/_e_t_c_/_s_u_d_o_e_r_s. When this option is present, _/_e_t_c_/_s_u_d_o_e_r_s does not even need to exist. Since this + option tells ssuuddoo how to behave when no specific LDAP + entries have been matched, this sudoOption is only + meaningful for the cn=defaults section. This flag is + _o_f_f by default. + insults If set, ssuuddoo will insult users when they enter an + incorrect password. This flag is _o_f_f by default. -1.7.2p1 June 30, 2009 10 +1.7.2p6 April 7, 2010 10 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - option tells ssuuddoo how to behave when no specific LDAP - entries have been matched, this sudoOption is only - meaningful for the cn=defaults section. This flag is - _o_f_f by default. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - insults If set, ssuuddoo will insult users when they enter an - incorrect password. This flag is _o_f_f by default. log_host If set, the hostname will be logged in the (non-syslog) ssuuddoo log file. This flag is _o_f_f by default. @@ -718,26 +710,26 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) sites may wish to disable this as it could be used to gather information on the location of executables that the normal user does not have access to. The + disadvantage is that if the executable is simply not in + the user's PATH, ssuuddoo will tell the user that they are + not allowed to run it, which can be confusing. This + flag is _o_n by default. + passprompt_override + The password prompt specified by _p_a_s_s_p_r_o_m_p_t will + normally only be used if the passwod prompt provided by -1.7.2p1 June 30, 2009 11 +1.7.2p6 April 7, 2010 11 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - disadvantage is that if the executable is simply not in - the user's PATH, ssuuddoo will tell the user that they are - not allowed to run it, which can be confusing. This - flag is _o_n by default. - passprompt_override - The password prompt specified by _p_a_s_s_p_r_o_m_p_t will - normally only be used if the passwod prompt provided by systems such as PAM matches the string "Password:". If _p_a_s_s_p_r_o_m_p_t___o_v_e_r_r_i_d_e is set, _p_a_s_s_p_r_o_m_p_t will always be used. This flag is _o_f_f by default. @@ -784,26 +776,26 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) flag is _o_f_f by default. set_home If set and ssuuddoo is invoked with the --ss option the HOME + environment variable will be set to the home directory + of the target user (which is root unless the --uu option + is used). This effectively makes the --ss option imply + --HH. This flag is _o_f_f by default. + set_logname Normally, ssuuddoo will set the LOGNAME, USER and USERNAME + environment variables to the name of the target user + (usually root unless the --uu option is given). However, -1.7.2p1 June 30, 2009 12 +1.7.2p6 April 7, 2010 12 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - environment variable will be set to the home directory - of the target user (which is root unless the --uu option - is used). This effectively makes the --ss option imply - --HH. This flag is _o_f_f by default. - set_logname Normally, ssuuddoo will set the LOGNAME, USER and USERNAME - environment variables to the name of the target user - (usually root unless the --uu option is given). However, since some programs (including the RCS revision control system) use LOGNAME to determine the real identity of the user, it may be desirable to change this behavior. @@ -836,8 +828,14 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) causes ssuuddoo to use the _f_n_m_a_t_c_h(3) function, which does not access the file system to do its matching. The disadvantage of _f_a_s_t___g_l_o_b is that it is unable to match - relative pathnames such as _._/_l_s or _._._/_b_i_n_/_l_s. This - flag is _o_f_f by default. + relative pathnames such as _._/_l_s or _._._/_b_i_n_/_l_s. This has + security implications when path names that include + globbing characters are used with the negation + operator, '!', as such rules can be trivially bypassed. + As such, this option should not be used when _s_u_d_o_e_r_s + contains rules that contain negated path names which + include globbing characters. This flag is _o_f_f by + default. stay_setuid Normally, when ssuuddoo executes a command the real and effective UIDs are set to the target user (root by @@ -850,10 +848,12 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) with either the _s_e_t_r_e_u_i_d_(_) or _s_e_t_r_e_s_u_i_d_(_) function. This flag is _o_f_f by default. + targetpw If set, ssuuddoo will prompt for the password of the user + specified by the --uu option (defaults to root) instead -1.7.2p1 June 30, 2009 13 +1.7.2p6 April 7, 2010 13 @@ -862,8 +862,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - targetpw If set, ssuuddoo will prompt for the password of the user - specified by the --uu option (defaults to root) instead of the password of the invoking user. Note that this precludes the use of a uid not listed in the passwd database as an argument to the --uu option. This flag is @@ -916,19 +914,19 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) value is used to decide when to wrap lines for nicer log files. This has no effect on the syslog log file, only the file log. The default is 80 (use 0 or negate + the option to disable word wrap). -1.7.2p1 June 30, 2009 14 +1.7.2p6 April 7, 2010 14 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - the option to disable word wrap). passwd_timeout Number of minutes before the ssuuddoo password prompt times out. The default is 5; set this to 0 for no password @@ -982,10 +980,12 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) escapes are supported: %H expanded to the local hostname including the domain + name (on if the machine's hostname is fully + qualified or the _f_q_d_n option is set) -1.7.2p1 June 30, 2009 15 +1.7.2p6 April 7, 2010 15 @@ -994,9 +994,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - name (on if the machine's hostname is fully - qualified or the _f_q_d_n option is set) - %h expanded to the local hostname without the domain name @@ -1048,10 +1045,13 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) variable. env_file The _e_n_v___f_i_l_e options specifies the fully qualified path to + a file containing variables to be set in the environment of + the program being run. Entries in this file should either + be of the form VARIABLE=value or export VARIABLE=value. -1.7.2p1 June 30, 2009 16 +1.7.2p6 April 7, 2010 16 @@ -1060,9 +1060,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - a file containing variables to be set in the environment of - the program being run. Entries in this file should either - be of the form VARIABLE=value or export VARIABLE=value. The value may optionally be surrounded by single or double quotes. Variables in this file are subject to other ssuuddoo environment settings such as _e_n_v___k_e_e_p and _e_n_v___c_h_e_c_k. @@ -1114,21 +1111,20 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) logfile Path to the ssuuddoo log file (not the syslog log file). Setting a path turns on logging to a file; negating this + option turns it off. By default, ssuuddoo logs via syslog. + mailerflags Flags to use when invoking mailer. Defaults to --tt. -1.7.2p1 June 30, 2009 17 - +1.7.2p6 April 7, 2010 17 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - option turns it off. By default, ssuuddoo logs via syslog. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - mailerflags Flags to use when invoking mailer. Defaults to --tt. mailerpath Path to mail program used to send warning mail. Defaults to the path to sendmail found at configure time. @@ -1148,7 +1144,7 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) is if you want to have the "root path" be separate from the "user path." Users in the group specified by the _e_x_e_m_p_t___g_r_o_u_p option are not affected by _s_e_c_u_r_e___p_a_t_h. This - is not set by default. + option is not set by default. syslog Syslog facility if syslog is being used for logging (negate to disable syslog logging). Defaults to local2. @@ -1180,10 +1176,14 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) env_check Environment variables to be removed from the user's environment if the variable's value contains % or / characters. This can be used to guard against printf- + style format vulnerabilities in poorly-written + programs. The argument may be a double-quoted, space- + separated list or a single value without double-quotes. + The list can be replaced, added to, deleted from, or -1.7.2p1 June 30, 2009 18 +1.7.2p6 April 7, 2010 18 @@ -1192,10 +1192,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - style format vulnerabilities in poorly-written - programs. The argument may be a double-quoted, space- - separated list or a single value without double-quotes. - The list can be replaced, added to, deleted from, or disabled by using the =, +=, -=, and ! operators respectively. Regardless of whether the env_reset option is enabled or disabled, variables specified by @@ -1245,11 +1241,15 @@ EEXXAAMMPPLLEESS Below are example _s_u_d_o_e_r_s entries. Admittedly, some of these are a bit contrived. First, we define our _a_l_i_a_s_e_s: + # User alias specification + User_Alias FULLTIMERS = millert, mikef, dowdy + User_Alias PARTTIMERS = bostley, jwfox, crawl + User_Alias WEBMASTERS = will, wendy, wim -1.7.2p1 June 30, 2009 19 +1.7.2p6 April 7, 2010 19 @@ -1258,11 +1258,6 @@ EEXXAAMMPPLLEESS SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - # User alias specification - User_Alias FULLTIMERS = millert, mikef, dowdy - User_Alias PARTTIMERS = bostley, jwfox, crawl - User_Alias WEBMASTERS = will, wendy, wim - # Runas alias specification Runas_Alias OP = root, operator Runas_Alias DB = oracle, sybase @@ -1312,22 +1307,22 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) Defaults!PAGERS noexec The _U_s_e_r _s_p_e_c_i_f_i_c_a_t_i_o_n is the part that actually determines who may run + what. + root ALL = (ALL) ALL + %wheel ALL = (ALL) ALL -1.7.2p1 June 30, 2009 20 +1.7.2p6 April 7, 2010 20 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - what. +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - root ALL = (ALL) ALL - %wheel ALL = (ALL) ALL We let rroooott and any user in group wwhheeeell run any command on any host as any user. @@ -1379,21 +1374,21 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) the _H_P_P_A machines. Note that this assumes _p_a_s_s_w_d(1) does not take multiple usernames on the command line. + bob SPARC = (OP) ALL : SGI = (OP) ALL + The user bboobb may run anything on the _S_P_A_R_C and _S_G_I machines as any user + listed in the _O_P Runas_Alias (rroooott and ooppeerraattoorr). -1.7.2p1 June 30, 2009 21 +1.7.2p6 April 7, 2010 21 -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - bob SPARC = (OP) ALL : SGI = (OP) ALL +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - The user bboobb may run anything on the _S_P_A_R_C and _S_G_I machines as any user - listed in the _O_P Runas_Alias (rroooott and ooppeerraattoorr). jim +biglab = ALL @@ -1443,11 +1438,16 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) and wim), may run any command as user www (which owns the web pages) or simply _s_u(1) to www. + ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\ + /sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM + Any user may mount or unmount a CD-ROM on the machines in the CDROM + Host_Alias (orion, perseus, hercules) without entering a password. + This is a bit tedious for users to type, so it is a prime candidate for -1.7.2p1 June 30, 2009 22 +1.7.2p6 April 7, 2010 22 @@ -1456,12 +1456,6 @@ SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) - ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\ - /sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM - - Any user may mount or unmount a CD-ROM on the machines in the CDROM - Host_Alias (orion, perseus, hercules) without entering a password. - This is a bit tedious for users to type, so it is a prime candidate for encapsulating in a shell script. SSEECCUURRIITTYY NNOOTTEESS @@ -1478,6 +1472,21 @@ SSEECCUURRIITTYY NNOOTTEESS kind of restrictions should be considered advisory at best (and reinforced by policy). + Furthermore, if the _f_a_s_t___g_l_o_b option is in use, it is not possible to + reliably negate commands where the path name includes globbing (aka + wildcard) characters. This is because the C library's _f_n_m_a_t_c_h(3) + function cannot resolve relative paths. While this is typically only + an inconvenience for rules that grant privileges, it can result in a + security issue for rules that subtract or revoke privileges. + + For example, given the following _s_u_d_o_e_r_s entry: + + john ALL = /usr/bin/passwd [a-zA-Z0-9]*, /usr/bin/chsh [a-zA-Z0-9]*, + /usr/bin/chfn [a-zA-Z0-9]*, !/usr/bin/* root + + User jjoohhnn can still run /usr/bin/passwd root if _f_a_s_t___g_l_o_b is enabled by + changing to _/_u_s_r_/_b_i_n and running ./passwd root instead. + PPRREEVVEENNTTIINNGG SSHHEELLLL EESSCCAAPPEESS Once ssuuddoo executes a program, that program is free to do whatever it pleases, including run other programs. This can be a security issue @@ -1501,26 +1510,26 @@ PPRREEVVEENNTTIINNGG SSHHEELLLL EESSCCAAPPEESS shared library. On such systems, ssuuddoo's _n_o_e_x_e_c functionality can be used to prevent a program run by ssuuddoo from executing any other programs. Note, however, that this applies only to - native dynamically-linked executables. Statically-linked - executables and foreign executables running under binary - emulation are not affected. - To tell whether or not ssuuddoo supports _n_o_e_x_e_c, you can run the - following as root: - sudo -V | grep "dummy exec" +1.7.2p6 April 7, 2010 23 -1.7.2p1 June 30, 2009 23 +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) + native dynamically-linked executables. Statically-linked + executables and foreign executables running under binary + emulation are not affected. -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) + To tell whether or not ssuuddoo supports _n_o_e_x_e_c, you can run the + following as root: + sudo -V | grep "dummy exec" If the resulting output contains a line that begins with: @@ -1567,27 +1576,27 @@ CCAAVVEEAATTSS When using netgroups of machines (as opposed to users), if you store fully qualified hostnames in the netgroup (as is usually the case), you - either need to have the machine's hostname be fully qualified as - returned by the hostname command or use the _f_q_d_n option in _s_u_d_o_e_r_s. -BBUUGGSS - If you feel you have found a bug in ssuuddoo, please submit a bug report at - http://www.sudo.ws/sudo/bugs/ -SSUUPPPPOORRTT - Limited free support is available via the sudo-users mailing list, see +1.7.2p6 April 7, 2010 24 -1.7.2p1 June 30, 2009 24 +SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) -SUDOERS(4) MAINTENANCE COMMANDS SUDOERS(4) + either need to have the machine's hostname be fully qualified as + returned by the hostname command or use the _f_q_d_n option in _s_u_d_o_e_r_s. +BBUUGGSS + If you feel you have found a bug in ssuuddoo, please submit a bug report at + http://www.sudo.ws/sudo/bugs/ +SSUUPPPPOORRTT + Limited free support is available via the sudo-users mailing list, see http://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search the archives. @@ -1636,15 +1645,6 @@ DDIISSCCLLAAIIMMEERR - - - - - - - - - -1.7.2p1 June 30, 2009 25 +1.7.2p6 April 7, 2010 25