Changes between Version 6 and Version 7 of UnprivilegedUser


Ignore:
Timestamp:
09/02/12 20:08:37 (12 years ago)
Author:
David Sommerseth
Comment:

Cleaned up SELinux suggestions (not tested)

Legend:

Unmodified
Added
Removed
Modified
  • UnprivilegedUser

    v6 v7  
    110110Create the following files:
    111111{{{
    112 # /tmp/openvpn_read_open.te
     112# /tmp/openvpn_unpriv_hack.te
    113113
    114 module openvpn_read_open 1.0;
     114module openvpn_unpriv_hack 1.0;
    115115
    116116require {
    117117        type openvpn_t;
    118118        type sudo_exec_t;
    119         class file { read open };
     119        class file { read open execute getattr execute_no_trans };
     120        class process setrlimit;
     121        class capability sys_resource;
    120122}
    121123
    122124#============= openvpn_t ==============
    123 allow openvpn_t sudo_exec_t:file { read open };
    124 }}}
    125 {{{
    126 # /tmp/openvpn_execute_getattr.te
    127 
    128 module openvpn_execute_getattr 1.0;
    129 
    130 require {
    131         type openvpn_t;
    132         type sudo_exec_t;
    133         class file { execute getattr };
    134 }
    135 
    136 #============= openvpn_t ==============
    137 allow openvpn_t sudo_exec_t:file { execute getattr };
    138 }}}
    139 {{{
    140 # /tmp/openvpn_execute_no_trans.te
    141 
    142 module openvpn_execute_no_trans 1.0;
    143 
    144 require {
    145         type openvpn_t;
    146         type sudo_exec_t;
    147         class file execute_no_trans;
    148 }
    149 
    150 #============= openvpn_t ==============
    151 allow openvpn_t sudo_exec_t:file execute_no_trans;
    152 }}}
    153 {{{
    154 # /tmp/openvpn_setrlimit.te
    155 
    156 module openvpn_setrlimit 1.0;
    157 
    158 require {
    159         type openvpn_t;
    160         class process setrlimit;
    161 }
    162 
    163 #============= openvpn_t ==============
     125allow openvpn_t sudo_exec_t:file { read open execute getattr execute_no_trans};
    164126allow openvpn_t self:process setrlimit;
    165 }}}
    166 {{{
    167 # /tmp/openvpn_sys_resource.te
    168 
    169 module openvpn_sys_resource 1.0;
    170 
    171 require {
    172         type openvpn_t;
    173         class capability sys_resource;
    174 }
    175 
    176 #============= openvpn_t ==============
    177127allow openvpn_t self:capability sys_resource;
    178128}}}
    179129then compile and install the security modules:
    180130{{{
    181 $ checkmodule -M -m -o /tmp/openvpn_read_open.mod /tmp/openvpn_read_open.te
    182 $ semodule_package -o /tmp/openvpn_read_open.pp -m /tmp/openvpn_read_open.mod
    183 $ semodule -i /tmp/openvpn_read_open.pp
    184 $ checkmodule -M -m -o /tmp/openvpn_execute_getattr.mod /tmp/openvpn_execute_getattr.te
    185 $ semodule_package -o /tmp/openvpn_execute_getattr.pp -m /tmp/openvpn_execute_getattr.mod
    186 $ semodule -i /tmp/openvpn_execute_getattr.pp
    187 $ checkmodule -M -m -o /tmp/openvpn_execute_no_trans.mod /tmp/openvpn_execute_no_trans.te
    188 $ semodule_package -o /tmp/openvpn_execute_no_trans.pp -m /tmp/openvpn_execute_no_trans.mod
    189 $ semodule -i /tmp/openvpn_execute_no_trans.pp
    190 $ checkmodule -M -m -o /tmp/openvpn_setrlimit.mod /tmp/openvpn_setrlimit.te
    191 $ semodule_package -o /tmp/openvpn_setrlimit.pp -m /tmp/openvpn_setrlimit.mod
    192 $ semodule -i /tmp/openvpn_setrlimit.pp
    193 $ checkmodule -M -m -o /tmp/openvpn_sys_resource.mod /tmp/openvpn_sys_resource.te
    194 $ semodule_package -o /tmp/openvpn_sys_resource.pp -m /tmp/openvpn_sys_resource.mod
    195 $ semodule -i /tmp/openvpn_sys_resource.pp
     131$ checkmodule -M -m -o /tmp/openvpn_unpriv_hack.mod /tmp/openvpn_unpriv_hack.te
     132$ semodule_package -o /tmp/openvpn_unpriv_hack.pp -m /tmp/openvpn_unpriv_hack.mod
     133$ semodule -i /tmp/openvpn_upriv_hack.pp
    196134}}}
    197135and check if they have loaded correctly:
     
    199137$ semodule -l | grep openvpn
    200138openvpn 1.9.1   
    201 openvpn_execute_getattr    1.0
    202 openvpn_execute_no_trans    1.0
    203 openvpn_read_open    1.0
    204 openvpn_setrlimit    1.0
    205 openvpn_sys_resource    1.0
    206 }}}     
     139openvpn_unpriv_hack    1.0
     140}}}