|
Chris PeBenito |
57869a |
## <module name="corecommands">
|
|
Chris PeBenito |
3000a3 |
## <summary>
|
|
Chris PeBenito |
3000a3 |
## Core policy for shells, and generic programs
|
|
Chris PeBenito |
3000a3 |
## in /bin, /sbin, /usr/bin, and /usr/sbin.
|
|
Chris PeBenito |
3000a3 |
## </summary>
|
|
Chris PeBenito |
e181fe |
|
|
Chris PeBenito |
07efe9 |
#######################################
|
|
Chris PeBenito |
07efe9 |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_shell_entry_type(domain)
|
|
Chris PeBenito |
07efe9 |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_shell_entry_type',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type shell_exec_t;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
c9428d |
domain_entry_file($1,shell_exec_t)
|
|
Chris PeBenito |
07efe9 |
')
|
|
Chris PeBenito |
07efe9 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_search_bin(domain)
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_search_bin',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type bin_t;
|
|
Chris PeBenito |
139520 |
class dir search;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 bin_t:dir search;
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
########################################
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_list_bin(domain)
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_list_bin',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type bin_t;
|
|
Chris PeBenito |
139520 |
class dir r_dir_perms;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
dd8229 |
allow $1 bin_t:dir r_dir_perms;
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
########################################
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_exec_bin(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_exec_bin',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type bin_t;
|
|
Chris PeBenito |
139520 |
class dir r_dir_perms;
|
|
Chris PeBenito |
139520 |
class lnk_file r_file_perms;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
dd8229 |
allow $1 bin_t:dir r_dir_perms;
|
|
Chris PeBenito |
dd8229 |
allow $1 bin_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
dd8229 |
can_exec($1,bin_t)
|
|
Chris PeBenito |
dd8229 |
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_search_sbin(domain)
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_search_sbin',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type sbin_t;
|
|
Chris PeBenito |
139520 |
class dir search;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 sbin_t:dir search;
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
########################################
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_list_sbin(domain)
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_list_sbin',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type sbin_t;
|
|
Chris PeBenito |
139520 |
class dir r_dir_perms;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 sbin_t:dir r_dir_perms;
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
########################################
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_dontaudit_getattr_sbin_file(domain)
|
|
Chris PeBenito |
f5c42b |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_dontaudit_getattr_sbin_file',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type sbin_t;
|
|
Chris PeBenito |
139520 |
class file getattr;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 sbin_t:file getattr;
|
|
Chris PeBenito |
f5c42b |
')
|
|
Chris PeBenito |
f5c42b |
|
|
Chris PeBenito |
f5c42b |
########################################
|
|
Chris PeBenito |
f5c42b |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_exec_sbin(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_exec_sbin',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type sbin_t;
|
|
Chris PeBenito |
139520 |
class dir r_dir_perms;
|
|
Chris PeBenito |
139520 |
class lnk_file r_file_perms;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
dd8229 |
allow $1 sbin_t:dir r_dir_perms;
|
|
Chris PeBenito |
dd8229 |
allow $1 sbin_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
dd8229 |
can_exec($1,sbin_t)
|
|
Chris PeBenito |
dd8229 |
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_exec_shell(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_exec_shell',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type bin_t, shell_exec_t;
|
|
Chris PeBenito |
139520 |
class dir r_dir_perms;
|
|
Chris PeBenito |
139520 |
class lnk_file r_file_perms;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 bin_t:dir r_dir_perms;
|
|
Chris PeBenito |
dd8229 |
allow $1 bin_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
dd8229 |
can_exec($1,shell_exec_t)
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
f5c42b |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_exec_ls(domain)
|
|
Chris PeBenito |
f5c42b |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_exec_ls',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type bin_t, ls_exec_t;
|
|
Chris PeBenito |
139520 |
class dir r_dir_perms;
|
|
Chris PeBenito |
139520 |
class lnk_file r_file_perms;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 bin_t:dir r_dir_perms;
|
|
Chris PeBenito |
dd8229 |
allow $1 bin_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
dd8229 |
can_exec($1,ls_exec_t)
|
|
Chris PeBenito |
f5c42b |
')
|
|
Chris PeBenito |
f5c42b |
|
|
Chris PeBenito |
f5c42b |
########################################
|
|
Chris PeBenito |
c9428d |
## <interface name="corecmd_shell_spec_domtrans">
|
|
Chris PeBenito |
261e0e |
## <desc>
|
|
Chris PeBenito |
4bf4ed |
## Execute a shell in the target domain. This
|
|
Chris PeBenito |
4bf4ed |
## is an explicit transition, requiring the
|
|
Chris PeBenito |
4bf4ed |
## caller to use setexeccon().
|
|
Chris PeBenito |
261e0e |
## </desc>
|
|
Chris PeBenito |
261e0e |
## <param name="domain">
|
|
Chris PeBenito |
3000a3 |
## The type of the process performing this action.
|
|
Chris PeBenito |
261e0e |
## </param>
|
|
Chris PeBenito |
261e0e |
## <param name="target_domain">
|
|
Chris PeBenito |
3000a3 |
## The type of the shell process.
|
|
Chris PeBenito |
261e0e |
## </param>
|
|
Chris PeBenito |
3000a3 |
## </interface>
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_shell_spec_domtrans',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type bin_t, shell_exec_t;
|
|
Chris PeBenito |
139520 |
class dir r_dir_perms;
|
|
Chris PeBenito |
139520 |
class lnk_file r_file_perms;
|
|
Chris PeBenito |
139520 |
class fd use;
|
|
Chris PeBenito |
139520 |
class fifo_file rw_file_perms;
|
|
Chris PeBenito |
139520 |
class process sigchld;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
dd8229 |
allow $1 bin_t:dir r_dir_perms;
|
|
Chris PeBenito |
dd8229 |
allow $1 bin_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
0fd9dc |
|
|
Chris PeBenito |
0fd9dc |
domain_trans($1,shell_exec_t,$2)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 $2:fd use;
|
|
Chris PeBenito |
0c73cd |
allow $2 $1:fd use;
|
|
Chris PeBenito |
0c73cd |
allow $2 $1:fifo_file rw_file_perms;
|
|
Chris PeBenito |
0c73cd |
allow $2 $1:process sigchld;
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
4bf4ed |
########################################
|
|
Chris PeBenito |
c9428d |
## <interface name="corecmd_domtrans_shell">
|
|
Chris PeBenito |
261e0e |
## <desc>
|
|
Chris PeBenito |
4bf4ed |
## Execute a shell in the target domain.
|
|
Chris PeBenito |
261e0e |
## </desc>
|
|
Chris PeBenito |
261e0e |
## <param name="domain">
|
|
Chris PeBenito |
4bf4ed |
## The type of the process performing this action.
|
|
Chris PeBenito |
261e0e |
## </param>
|
|
Chris PeBenito |
261e0e |
## <param name="target_domain">
|
|
Chris PeBenito |
4bf4ed |
## The type of the shell process.
|
|
Chris PeBenito |
261e0e |
## </param>
|
|
Chris PeBenito |
4bf4ed |
## </interface>
|
|
Chris PeBenito |
4bf4ed |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_domtrans_shell',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type shell_exec_t;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
c9428d |
corecmd_shell_spec_domtrans($1,$2)
|
|
Chris PeBenito |
0c73cd |
type_transition $1 shell_exec_t:process $2;
|
|
Chris PeBenito |
4bf4ed |
')
|
|
Chris PeBenito |
4bf4ed |
|
|
Chris PeBenito |
075c4f |
########################################
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
c9428d |
# corecmd_chroot_exec_chroot(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
199895 |
interface(`corecmd_chroot_exec_chroot',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type chroot_exec_t;
|
|
Chris PeBenito |
139520 |
class capability sys_chroot;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
139520 |
can_exec($1,chroot_exec_t)
|
|
Chris PeBenito |
0c73cd |
allow $1 self:capability sys_chroot;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
3000a3 |
## </module>
|