|
Chris PeBenito |
3000a3 |
## <summary>
|
|
Chris PeBenito |
414e41 |
## Core policy for shells, and generic programs
|
|
Chris PeBenito |
414e41 |
## in /bin, /sbin, /usr/bin, and /usr/sbin.
|
|
Chris PeBenito |
3000a3 |
## </summary>
|
|
Chris PeBenito |
e5d452 |
## <required val="true">
|
|
Chris PeBenito |
e5d452 |
## Contains the base bin and sbin directory types
|
|
Chris PeBenito |
e5d452 |
## which need to be searched for the kernel to
|
|
Chris PeBenito |
e5d452 |
## run init.
|
|
Chris PeBenito |
e5d452 |
## </required>
|
|
Chris PeBenito |
e181fe |
|
|
Chris PeBenito |
f7ebea |
########################################
|
|
Chris PeBenito |
80436b |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Make the specified type usable for files
|
|
Chris PeBenito |
fb63d0 |
## that are exectuables, such as binary programs.
|
|
Chris PeBenito |
fb63d0 |
## This does not include shared libraries.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## <param name="type">
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Type to be used for files.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## </param>
|
|
Chris PeBenito |
fb63d0 |
#
|
|
Chris PeBenito |
fb63d0 |
interface(`corecmd_executable_file',`
|
|
Chris PeBenito |
fb63d0 |
gen_require(`
|
|
Chris PeBenito |
fb63d0 |
attribute exec_type;
|
|
Chris PeBenito |
fb63d0 |
')
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
typeattribute $1 exec_type;
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
files_type($1)
|
|
Chris PeBenito |
fb63d0 |
')
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
########################################
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
c6d4c8 |
## Create a aliased type to generic bin files.
|
|
Chris PeBenito |
9e9138 |
## </summary>
|
|
Chris PeBenito |
c6d4c8 |
## <desc>
|
|
Chris PeBenito |
c6d4c8 |
##
|
|
Chris PeBenito |
c6d4c8 |
## Create a aliased type to generic bin files.
|
|
Chris PeBenito |
c6d4c8 |
##
|
|
Chris PeBenito |
c6d4c8 |
##
|
|
Chris PeBenito |
c6d4c8 |
## This is added to support targeted policy. Its
|
|
Chris PeBenito |
c6d4c8 |
## use should be limited. It has no effect
|
|
Chris PeBenito |
c6d4c8 |
## on the strict policy.
|
|
Chris PeBenito |
c6d4c8 |
##
|
|
Chris PeBenito |
c6d4c8 |
## </desc>
|
|
Chris PeBenito |
9e9138 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
9e9138 |
## Alias type for bin_t.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
9e9138 |
## </param>
|
|
Chris PeBenito |
9e9138 |
interface(`corecmd_bin_alias',`
|
|
Chris PeBenito |
c6d4c8 |
ifdef(`targeted_policy',`
|
|
Chris PeBenito |
c6d4c8 |
gen_require(`
|
|
Chris PeBenito |
c6d4c8 |
type bin_t;
|
|
Chris PeBenito |
c6d4c8 |
')
|
|
Chris PeBenito |
9e9138 |
|
|
Chris PeBenito |
c6d4c8 |
typealias bin_t alias $1;
|
|
Chris PeBenito |
c6d4c8 |
',`
|
|
Chris PeBenito |
c6d4c8 |
errprint(`Warning: $0($1) has no effect in strict policy.'__endline__)
|
|
Chris PeBenito |
c6d4c8 |
')
|
|
Chris PeBenito |
9e9138 |
')
|
|
Chris PeBenito |
9e9138 |
|
|
Chris PeBenito |
9e9138 |
########################################
|
|
Chris PeBenito |
9e9138 |
## <summary>
|
|
Chris PeBenito |
d42c7e |
## Make general progams in bin an entrypoint for
|
|
Chris PeBenito |
d42c7e |
## the specified domain.
|
|
Chris PeBenito |
d42c7e |
## </summary>
|
|
Chris PeBenito |
d42c7e |
## <param name="domain">
|
|
Chris PeBenito |
d42c7e |
## <summary>
|
|
Chris PeBenito |
d42c7e |
## The domain for which bin_t is an entrypoint.
|
|
Chris PeBenito |
d42c7e |
## </summary>
|
|
Chris PeBenito |
d42c7e |
## </param>
|
|
Chris PeBenito |
d42c7e |
interface(`corecmd_bin_entry_type',`
|
|
Chris PeBenito |
d42c7e |
gen_require(`
|
|
Chris PeBenito |
d42c7e |
type bin_t;
|
|
Chris PeBenito |
d42c7e |
')
|
|
Chris PeBenito |
d42c7e |
|
|
Chris PeBenito |
d42c7e |
domain_entry_file($1,bin_t)
|
|
Chris PeBenito |
d42c7e |
')
|
|
Chris PeBenito |
d42c7e |
|
|
Chris PeBenito |
d42c7e |
########################################
|
|
Chris PeBenito |
d42c7e |
## <summary>
|
|
Chris PeBenito |
d42c7e |
## Make general progams in sbin an entrypoint for
|
|
Chris PeBenito |
d42c7e |
## the specified domain.
|
|
Chris PeBenito |
d42c7e |
## </summary>
|
|
Chris PeBenito |
d42c7e |
## <param name="domain">
|
|
Chris PeBenito |
d42c7e |
## <summary>
|
|
Chris PeBenito |
d42c7e |
## The domain for which sbin programs are an entrypoint.
|
|
Chris PeBenito |
d42c7e |
## </summary>
|
|
Chris PeBenito |
d42c7e |
## </param>
|
|
Chris PeBenito |
d42c7e |
interface(`corecmd_sbin_entry_type',`
|
|
Chris PeBenito |
d42c7e |
gen_require(`
|
|
Chris PeBenito |
d42c7e |
type sbin_t;
|
|
Chris PeBenito |
d42c7e |
')
|
|
Chris PeBenito |
d42c7e |
|
|
Chris PeBenito |
d42c7e |
domain_entry_file($1,sbin_t)
|
|
Chris PeBenito |
d42c7e |
')
|
|
Chris PeBenito |
d42c7e |
|
|
Chris PeBenito |
d42c7e |
########################################
|
|
Chris PeBenito |
d42c7e |
## <summary>
|
|
Chris PeBenito |
80436b |
## Make the shell an entrypoint for the specified domain.
|
|
Chris PeBenito |
80436b |
## </summary>
|
|
Chris PeBenito |
80436b |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
80436b |
## The domain for which the shell is an entrypoint.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
80436b |
## </param>
|
|
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 |
')
|
|
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 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
dd8229 |
allow $1 bin_t:dir r_dir_perms;
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
58c3da |
########################################
|
|
Chris PeBenito |
80436b |
## <summary>
|
|
Chris PeBenito |
80436b |
## Get the attributes of files in bin directories.
|
|
Chris PeBenito |
80436b |
## </summary>
|
|
Chris PeBenito |
80436b |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
80436b |
## </param>
|
|
Chris PeBenito |
ae9e27 |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_getattr_bin_files',`
|
|
Chris PeBenito |
80436b |
gen_require(`
|
|
Chris PeBenito |
80436b |
type bin_t;
|
|
Chris PeBenito |
80436b |
')
|
|
Chris PeBenito |
80436b |
|
|
Chris PeBenito |
80436b |
allow $1 bin_t:file getattr;
|
|
Chris PeBenito |
80436b |
')
|
|
Chris PeBenito |
80436b |
|
|
Chris PeBenito |
58c3da |
########################################
|
|
Chris PeBenito |
80436b |
## <summary>
|
|
Chris PeBenito |
ae9e27 |
## Read files in bin directories.
|
|
Chris PeBenito |
ae9e27 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## </param>
|
|
Chris PeBenito |
ae9e27 |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_read_bin_files',`
|
|
Chris PeBenito |
ae9e27 |
gen_require(`
|
|
Chris PeBenito |
ae9e27 |
type bin_t;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
allow $1 bin_t:dir search;
|
|
Chris PeBenito |
ae9e27 |
allow $1 bin_t:file r_file_perms;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
########################################
|
|
Chris PeBenito |
ae9e27 |
## <summary>
|
|
Chris PeBenito |
80436b |
## Read symbolic links in bin directories.
|
|
Chris PeBenito |
80436b |
## </summary>
|
|
Chris PeBenito |
80436b |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
80436b |
## </param>
|
|
Chris PeBenito |
ae9e27 |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_read_bin_symlinks',`
|
|
Chris PeBenito |
80436b |
gen_require(`
|
|
Chris PeBenito |
80436b |
type bin_t;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
allow $1 bin_t:dir search;
|
|
Chris PeBenito |
ae9e27 |
allow $1 bin_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
########################################
|
|
Chris PeBenito |
ae9e27 |
## <summary>
|
|
Chris PeBenito |
ae9e27 |
## Read pipes in bin directories.
|
|
Chris PeBenito |
ae9e27 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## </param>
|
|
Chris PeBenito |
ae9e27 |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_read_bin_pipes',`
|
|
Chris PeBenito |
ae9e27 |
gen_require(`
|
|
Chris PeBenito |
ae9e27 |
type bin_t;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
allow $1 bin_t:dir search;
|
|
Chris PeBenito |
ae9e27 |
allow $1 bin_t:fifo_file r_file_perms;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
########################################
|
|
Chris PeBenito |
ae9e27 |
## <summary>
|
|
Chris PeBenito |
ae9e27 |
## Read named sockets in bin directories.
|
|
Chris PeBenito |
ae9e27 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## </param>
|
|
Chris PeBenito |
ae9e27 |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_read_bin_sockets',`
|
|
Chris PeBenito |
ae9e27 |
gen_require(`
|
|
Chris PeBenito |
ae9e27 |
type bin_t;
|
|
Chris PeBenito |
80436b |
')
|
|
Chris PeBenito |
80436b |
|
|
Chris PeBenito |
80436b |
allow $1 bin_t:dir search;
|
|
Chris PeBenito |
ae9e27 |
allow $1 bin_t:sock_file r_file_perms;
|
|
Chris PeBenito |
80436b |
')
|
|
Chris PeBenito |
80436b |
|
|
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 |
')
|
|
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 |
df00b2 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Create, read, write, and delete bin files.
|
|
Chris PeBenito |
2c2435 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## </param>
|
|
Chris PeBenito |
2c2435 |
#
|
|
Chris PeBenito |
2c2435 |
interface(`corecmd_manage_bin_files',`
|
|
Chris PeBenito |
2c2435 |
gen_require(`
|
|
Chris PeBenito |
2c2435 |
type bin_t;
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
allow $1 bin_t:dir rw_dir_perms;
|
|
Chris PeBenito |
2c2435 |
allow $1 bin_t:file manage_file_perms;
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
########################################
|
|
Chris PeBenito |
2c2435 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Relabel to and from the bin type.
|
|
Chris PeBenito |
2c2435 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## </param>
|
|
Chris PeBenito |
2c2435 |
#
|
|
Chris PeBenito |
2c2435 |
interface(`corecmd_relabel_bin_files',`
|
|
Chris PeBenito |
2c2435 |
gen_require(`
|
|
Chris PeBenito |
2c2435 |
type bin_t;
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
allow $1 bin_t:dir search_dir_perms;
|
|
Chris PeBenito |
2c2435 |
allow $1 bin_t:file { relabelfrom relabelto };
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
########################################
|
|
Chris PeBenito |
2c2435 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Mmap a bin file as executable.
|
|
Chris PeBenito |
2c2435 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## </param>
|
|
Chris PeBenito |
2c2435 |
#
|
|
Chris PeBenito |
2c2435 |
interface(`corecmd_mmap_bin_files',`
|
|
Chris PeBenito |
2c2435 |
gen_require(`
|
|
Chris PeBenito |
2c2435 |
type bin_t;
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
allow $1 bin_t:dir search_dir_perms;
|
|
Chris PeBenito |
2c2435 |
allow $1 bin_t:file { getattr read execute };
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
########################################
|
|
Chris PeBenito |
2c2435 |
## <summary>
|
|
Chris PeBenito |
df00b2 |
## Execute a file in a bin directory
|
|
Chris PeBenito |
7c2f5a |
## in the specified domain but do not
|
|
Chris PeBenito |
7c2f5a |
## do it automatically. This is an explicit
|
|
Chris PeBenito |
7c2f5a |
## transition, requiring the caller to use setexeccon().
|
|
Chris PeBenito |
df00b2 |
## </summary>
|
|
Chris PeBenito |
df00b2 |
## <desc>
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
## Execute a file in a bin directory
|
|
Chris PeBenito |
df00b2 |
## in the specified domain. This allows
|
|
Chris PeBenito |
df00b2 |
## the specified domain to execute any file
|
|
Chris PeBenito |
df00b2 |
## on these filesystems in the specified
|
|
Chris PeBenito |
df00b2 |
## domain. This is not suggested.
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
## No interprocess communication (signals, pipes,
|
|
Chris PeBenito |
df00b2 |
## etc.) is provided by this interface since
|
|
Chris PeBenito |
df00b2 |
## the domains are not owned by this module.
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
## This interface was added to handle
|
|
Chris PeBenito |
7c2f5a |
## the userhelper policy.
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
## </desc>
|
|
Chris PeBenito |
df00b2 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
df00b2 |
## </param>
|
|
Chris PeBenito |
df00b2 |
## <param name="target_domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
df00b2 |
## The type of the new process.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
df00b2 |
## </param>
|
|
Chris PeBenito |
df00b2 |
#
|
|
Chris PeBenito |
7c2f5a |
interface(`corecmd_bin_spec_domtrans',`
|
|
Chris PeBenito |
df00b2 |
gen_require(`
|
|
Chris PeBenito |
df00b2 |
type bin_t;
|
|
Chris PeBenito |
df00b2 |
')
|
|
Chris PeBenito |
df00b2 |
|
|
Chris PeBenito |
df00b2 |
allow $1 bin_t:dir search;
|
|
Chris PeBenito |
df00b2 |
allow $1 bin_t:lnk_file { getattr read };
|
|
Chris PeBenito |
df00b2 |
|
|
Chris PeBenito |
7c2f5a |
domain_trans($1,bin_t,$2)
|
|
Chris PeBenito |
7c2f5a |
')
|
|
Chris PeBenito |
7c2f5a |
|
|
Chris PeBenito |
7c2f5a |
########################################
|
|
Chris PeBenito |
7c2f5a |
## <summary>
|
|
Chris PeBenito |
7c2f5a |
## Execute a file in a bin directory
|
|
Chris PeBenito |
7c2f5a |
## in the specified domain.
|
|
Chris PeBenito |
7c2f5a |
## </summary>
|
|
Chris PeBenito |
7c2f5a |
## <desc>
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
## Execute a file in a bin directory
|
|
Chris PeBenito |
7c2f5a |
## in the specified domain. This allows
|
|
Chris PeBenito |
7c2f5a |
## the specified domain to execute any file
|
|
Chris PeBenito |
7c2f5a |
## on these filesystems in the specified
|
|
Chris PeBenito |
7c2f5a |
## domain. This is not suggested.
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
## No interprocess communication (signals, pipes,
|
|
Chris PeBenito |
7c2f5a |
## etc.) is provided by this interface since
|
|
Chris PeBenito |
7c2f5a |
## the domains are not owned by this module.
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
## This interface was added to handle
|
|
Chris PeBenito |
7c2f5a |
## the ssh-agent policy.
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
## </desc>
|
|
Chris PeBenito |
7c2f5a |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
7c2f5a |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
7c2f5a |
## </param>
|
|
Chris PeBenito |
7c2f5a |
## <param name="target_domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
7c2f5a |
## The type of the new process.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
7c2f5a |
## </param>
|
|
Chris PeBenito |
7c2f5a |
#
|
|
Chris PeBenito |
7c2f5a |
interface(`corecmd_bin_domtrans',`
|
|
Chris PeBenito |
7c2f5a |
gen_require(`
|
|
Chris PeBenito |
7c2f5a |
type bin_t;
|
|
Chris PeBenito |
7c2f5a |
')
|
|
Chris PeBenito |
7c2f5a |
|
|
Chris PeBenito |
7c2f5a |
corecmd_bin_spec_domtrans($1,$2)
|
|
Chris PeBenito |
7c2f5a |
type_transition $1 bin_t:process $2;
|
|
Chris PeBenito |
df00b2 |
')
|
|
Chris PeBenito |
df00b2 |
|
|
Chris PeBenito |
df00b2 |
########################################
|
|
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 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
95f82b |
allow $1 sbin_t:dir search_dir_perms;
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
########################################
|
|
Chris PeBenito |
3e6c81 |
## <summary>
|
|
Chris PeBenito |
3e6c81 |
## Do not audit attempts to search
|
|
Chris PeBenito |
3e6c81 |
## sbin directories.
|
|
Chris PeBenito |
3e6c81 |
## </summary>
|
|
Chris PeBenito |
3e6c81 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
3e6c81 |
## Domain to not audit.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
3e6c81 |
## </param>
|
|
Chris PeBenito |
3e6c81 |
#
|
|
Chris PeBenito |
3e6c81 |
interface(`corecmd_dontaudit_search_sbin',`
|
|
Chris PeBenito |
3e6c81 |
gen_require(`
|
|
Chris PeBenito |
3e6c81 |
type sbin_t;
|
|
Chris PeBenito |
3e6c81 |
')
|
|
Chris PeBenito |
3e6c81 |
|
|
Chris PeBenito |
3e6c81 |
dontaudit $1 sbin_t:dir search_dir_perms;
|
|
Chris PeBenito |
3e6c81 |
')
|
|
Chris PeBenito |
3e6c81 |
|
|
Chris PeBenito |
3e6c81 |
########################################
|
|
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 |
')
|
|
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 |
1815ba |
# corecmd_getattr_sbin_files(domain)
|
|
Chris PeBenito |
80436b |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_getattr_sbin_files',`
|
|
Chris PeBenito |
80436b |
gen_require(`
|
|
Chris PeBenito |
80436b |
type sbin_t;
|
|
Chris PeBenito |
80436b |
')
|
|
Chris PeBenito |
80436b |
|
|
Chris PeBenito |
80436b |
allow $1 sbin_t:file getattr;
|
|
Chris PeBenito |
80436b |
')
|
|
Chris PeBenito |
80436b |
|
|
Chris PeBenito |
80436b |
########################################
|
|
Chris PeBenito |
80436b |
#
|
|
Chris PeBenito |
1815ba |
# corecmd_dontaudit_getattr_sbin_files(domain)
|
|
Chris PeBenito |
f5c42b |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_dontaudit_getattr_sbin_files',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type sbin_t;
|
|
Chris PeBenito |
139520 |
')
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
80436b |
dontaudit $1 sbin_t:file getattr;
|
|
Chris PeBenito |
f5c42b |
')
|
|
Chris PeBenito |
f5c42b |
|
|
Chris PeBenito |
f5c42b |
########################################
|
|
Chris PeBenito |
58c3da |
## <summary>
|
|
Chris PeBenito |
ae9e27 |
## Read files in sbin directories.
|
|
Chris PeBenito |
ae9e27 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## </param>
|
|
Chris PeBenito |
ae9e27 |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_read_sbin_files',`
|
|
Chris PeBenito |
ae9e27 |
gen_require(`
|
|
Chris PeBenito |
ae9e27 |
type sbin_t;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
allow $1 sbin_t:dir search;
|
|
Chris PeBenito |
ae9e27 |
allow $1 sbin_t:file r_file_perms;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
########################################
|
|
Chris PeBenito |
ae9e27 |
## <summary>
|
|
Chris PeBenito |
58c3da |
## Read symbolic links in sbin directories.
|
|
Chris PeBenito |
58c3da |
## </summary>
|
|
Chris PeBenito |
58c3da |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
58c3da |
## </param>
|
|
Chris PeBenito |
ae9e27 |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_read_sbin_symlinks',`
|
|
Chris PeBenito |
58c3da |
gen_require(`
|
|
Chris PeBenito |
58c3da |
type sbin_t;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
allow $1 sbin_t:dir search;
|
|
Chris PeBenito |
ae9e27 |
allow $1 sbin_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
########################################
|
|
Chris PeBenito |
ae9e27 |
## <summary>
|
|
Chris PeBenito |
ae9e27 |
## Read named pipes in sbin directories.
|
|
Chris PeBenito |
ae9e27 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## </param>
|
|
Chris PeBenito |
ae9e27 |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_read_sbin_pipes',`
|
|
Chris PeBenito |
ae9e27 |
gen_require(`
|
|
Chris PeBenito |
ae9e27 |
type sbin_t;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
allow $1 sbin_t:dir search;
|
|
Chris PeBenito |
ae9e27 |
allow $1 sbin_t:fifo_file r_file_perms;
|
|
Chris PeBenito |
ae9e27 |
')
|
|
Chris PeBenito |
ae9e27 |
|
|
Chris PeBenito |
ae9e27 |
########################################
|
|
Chris PeBenito |
ae9e27 |
## <summary>
|
|
Chris PeBenito |
ae9e27 |
## Read named sockets in sbin directories.
|
|
Chris PeBenito |
ae9e27 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
ae9e27 |
## </param>
|
|
Chris PeBenito |
ae9e27 |
#
|
|
Chris PeBenito |
1815ba |
interface(`corecmd_read_sbin_sockets',`
|
|
Chris PeBenito |
ae9e27 |
gen_require(`
|
|
Chris PeBenito |
ae9e27 |
type sbin_t;
|
|
Chris PeBenito |
58c3da |
')
|
|
Chris PeBenito |
58c3da |
|
|
Chris PeBenito |
58c3da |
allow $1 sbin_t:dir search;
|
|
Chris PeBenito |
ae9e27 |
allow $1 sbin_t:sock_file r_file_perms;
|
|
Chris PeBenito |
58c3da |
')
|
|
Chris PeBenito |
58c3da |
|
|
Chris PeBenito |
58c3da |
########################################
|
|
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 |
')
|
|
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 |
2c2435 |
')
|
|
Chris PeBenito |
dd8229 |
|
|
Chris PeBenito |
2c2435 |
########################################
|
|
Chris PeBenito |
2c2435 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Create, read, write, and delete sbin files.
|
|
Chris PeBenito |
2c2435 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## </param>
|
|
Chris PeBenito |
2c2435 |
#
|
|
Chris PeBenito |
2c2435 |
# cjp: added for prelink
|
|
Chris PeBenito |
2c2435 |
interface(`corecmd_manage_sbin_files',`
|
|
Chris PeBenito |
2c2435 |
gen_require(`
|
|
Chris PeBenito |
2c2435 |
type sbin_t;
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
allow $1 sbin_t:dir rw_dir_perms;
|
|
Chris PeBenito |
2c2435 |
allow $1 sbin_t:file manage_file_perms;
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
########################################
|
|
Chris PeBenito |
2c2435 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Relabel to and from the sbin type.
|
|
Chris PeBenito |
2c2435 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## </param>
|
|
Chris PeBenito |
2c2435 |
#
|
|
Chris PeBenito |
2c2435 |
# cjp: added for prelink
|
|
Chris PeBenito |
2c2435 |
interface(`corecmd_relabel_sbin_files',`
|
|
Chris PeBenito |
2c2435 |
gen_require(`
|
|
Chris PeBenito |
2c2435 |
type sbin_t;
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
allow $1 sbin_t:dir search_dir_perms;
|
|
Chris PeBenito |
2c2435 |
allow $1 sbin_t:file { relabelfrom relabelto };
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
########################################
|
|
Chris PeBenito |
2c2435 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Mmap a sbin file as executable.
|
|
Chris PeBenito |
2c2435 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
2c2435 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
2c2435 |
## </param>
|
|
Chris PeBenito |
2c2435 |
#
|
|
Chris PeBenito |
2c2435 |
# cjp: added for prelink
|
|
Chris PeBenito |
2c2435 |
interface(`corecmd_mmap_sbin_files',`
|
|
Chris PeBenito |
2c2435 |
gen_require(`
|
|
Chris PeBenito |
2c2435 |
type sbin_t;
|
|
Chris PeBenito |
2c2435 |
')
|
|
Chris PeBenito |
2c2435 |
|
|
Chris PeBenito |
2c2435 |
allow $1 sbin_t:dir search_dir_perms;
|
|
Chris PeBenito |
2c2435 |
allow $1 sbin_t:file { getattr read execute };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
451c1e |
## <summary>
|
|
Chris PeBenito |
451c1e |
## Execute a file in a sbin directory
|
|
Chris PeBenito |
451c1e |
## in the specified domain.
|
|
Chris PeBenito |
451c1e |
## </summary>
|
|
Chris PeBenito |
451c1e |
## <desc>
|
|
Chris PeBenito |
451c1e |
##
|
|
Chris PeBenito |
451c1e |
## Execute a file in a sbin directory
|
|
Chris PeBenito |
451c1e |
## in the specified domain. This allows
|
|
Chris PeBenito |
451c1e |
## the specified domain to execute any file
|
|
Chris PeBenito |
451c1e |
## on these filesystems in the specified
|
|
Chris PeBenito |
451c1e |
## domain. This is not suggested.
|
|
Chris PeBenito |
451c1e |
##
|
|
Chris PeBenito |
451c1e |
##
|
|
Chris PeBenito |
451c1e |
## No interprocess communication (signals, pipes,
|
|
Chris PeBenito |
451c1e |
## etc.) is provided by this interface since
|
|
Chris PeBenito |
451c1e |
## the domains are not owned by this module.
|
|
Chris PeBenito |
451c1e |
##
|
|
Chris PeBenito |
451c1e |
##
|
|
Chris PeBenito |
451c1e |
## This interface was added to handle
|
|
Chris PeBenito |
451c1e |
## the ssh-agent policy.
|
|
Chris PeBenito |
451c1e |
##
|
|
Chris PeBenito |
451c1e |
## </desc>
|
|
Chris PeBenito |
451c1e |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
451c1e |
## </param>
|
|
Chris PeBenito |
451c1e |
## <param name="target_domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
451c1e |
## The type of the new process.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
451c1e |
## </param>
|
|
Chris PeBenito |
451c1e |
#
|
|
Chris PeBenito |
451c1e |
interface(`corecmd_sbin_domtrans',`
|
|
Chris PeBenito |
451c1e |
gen_require(`
|
|
Chris PeBenito |
451c1e |
type sbin_t;
|
|
Chris PeBenito |
451c1e |
')
|
|
Chris PeBenito |
451c1e |
|
|
Chris PeBenito |
451c1e |
allow $1 sbin_t:dir search;
|
|
Chris PeBenito |
451c1e |
allow $1 sbin_t:lnk_file { getattr read };
|
|
Chris PeBenito |
451c1e |
|
|
Chris PeBenito |
451c1e |
domain_auto_trans($1,sbin_t,$2)
|
|
Chris PeBenito |
451c1e |
')
|
|
Chris PeBenito |
451c1e |
|
|
Chris PeBenito |
451c1e |
########################################
|
|
Chris PeBenito |
725926 |
## <summary>
|
|
Chris PeBenito |
7c2f5a |
## Execute a file in a sbin directory
|
|
Chris PeBenito |
7c2f5a |
## in the specified domain but do not
|
|
Chris PeBenito |
7c2f5a |
## do it automatically. This is an explicit
|
|
Chris PeBenito |
7c2f5a |
## transition, requiring the caller to use setexeccon().
|
|
Chris PeBenito |
7c2f5a |
## </summary>
|
|
Chris PeBenito |
7c2f5a |
## <desc>
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
## Execute a file in a sbin directory
|
|
Chris PeBenito |
7c2f5a |
## in the specified domain. This allows
|
|
Chris PeBenito |
7c2f5a |
## the specified domain to execute any file
|
|
Chris PeBenito |
7c2f5a |
## on these filesystems in the specified
|
|
Chris PeBenito |
7c2f5a |
## domain. This is not suggested.
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
## No interprocess communication (signals, pipes,
|
|
Chris PeBenito |
7c2f5a |
## etc.) is provided by this interface since
|
|
Chris PeBenito |
7c2f5a |
## the domains are not owned by this module.
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
## This interface was added to handle
|
|
Chris PeBenito |
7c2f5a |
## the userhelper policy.
|
|
Chris PeBenito |
7c2f5a |
##
|
|
Chris PeBenito |
7c2f5a |
## </desc>
|
|
Chris PeBenito |
7c2f5a |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
7c2f5a |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
7c2f5a |
## </param>
|
|
Chris PeBenito |
7c2f5a |
## <param name="target_domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
7c2f5a |
## The type of the new process.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
7c2f5a |
## </param>
|
|
Chris PeBenito |
7c2f5a |
#
|
|
Chris PeBenito |
7c2f5a |
interface(`corecmd_sbin_spec_domtrans',`
|
|
Chris PeBenito |
7c2f5a |
gen_require(`
|
|
Chris PeBenito |
7c2f5a |
type sbin_t;
|
|
Chris PeBenito |
7c2f5a |
')
|
|
Chris PeBenito |
7c2f5a |
|
|
Chris PeBenito |
7c2f5a |
allow $1 sbin_t:dir search;
|
|
Chris PeBenito |
7c2f5a |
allow $1 sbin_t:lnk_file { getattr read };
|
|
Chris PeBenito |
7c2f5a |
|
|
Chris PeBenito |
7c2f5a |
domain_trans($1,sbin_t,$2)
|
|
Chris PeBenito |
7c2f5a |
')
|
|
Chris PeBenito |
7c2f5a |
|
|
Chris PeBenito |
7c2f5a |
########################################
|
|
Chris PeBenito |
7c2f5a |
## <summary>
|
|
Chris PeBenito |
725926 |
## Check if a shell is executable (DAC-wise).
|
|
Chris PeBenito |
725926 |
## </summary>
|
|
Chris PeBenito |
725926 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
725926 |
## </param>
|
|
Chris PeBenito |
725926 |
#
|
|
Chris PeBenito |
725926 |
interface(`corecmd_check_exec_shell',`
|
|
Chris PeBenito |
725926 |
gen_require(`
|
|
Chris PeBenito |
725926 |
type bin_t, shell_exec_t;
|
|
Chris PeBenito |
725926 |
')
|
|
Chris PeBenito |
725926 |
|
|
Chris PeBenito |
725926 |
allow $1 bin_t:dir r_dir_perms;
|
|
Chris PeBenito |
725926 |
allow $1 bin_t:lnk_file r_file_perms;
|
|
Chris PeBenito |
725926 |
allow $1 shell_exec_t:file execute;
|
|
Chris PeBenito |
725926 |
')
|
|
Chris PeBenito |
725926 |
|
|
Chris PeBenito |
725926 |
########################################
|
|
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 |
')
|
|
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 |
')
|
|
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 |
f7ebea |
## <summary>
|
|
Chris PeBenito |
f7ebea |
## Execute a shell in the target domain. This
|
|
Chris PeBenito |
f7ebea |
## is an explicit transition, requiring the
|
|
Chris PeBenito |
f7ebea |
## caller to use setexeccon().
|
|
Chris PeBenito |
f7ebea |
## </summary>
|
|
Chris PeBenito |
414e41 |
## <desc>
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
414e41 |
## Execute a shell in the target domain. This
|
|
Chris PeBenito |
414e41 |
## is an explicit transition, requiring the
|
|
Chris PeBenito |
414e41 |
## caller to use setexeccon().
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
## No interprocess communication (signals, pipes,
|
|
Chris PeBenito |
df00b2 |
## etc.) is provided by this interface since
|
|
Chris PeBenito |
df00b2 |
## the domains are not owned by this module.
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
414e41 |
## </desc>
|
|
Chris PeBenito |
414e41 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
414e41 |
## </param>
|
|
Chris PeBenito |
414e41 |
## <param name="target_domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
414e41 |
## The type of the shell process.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
414e41 |
## </param>
|
|
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 |
')
|
|
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 |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
4bf4ed |
########################################
|
|
Chris PeBenito |
df00b2 |
## <summary>
|
|
Chris PeBenito |
df00b2 |
## Execute a shell in the specified domain.
|
|
Chris PeBenito |
df00b2 |
## </summary>
|
|
Chris PeBenito |
414e41 |
## <desc>
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
## Execute a shell in the specified domain.
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
df00b2 |
## No interprocess communication (signals, pipes,
|
|
Chris PeBenito |
df00b2 |
## etc.) is provided by this interface since
|
|
Chris PeBenito |
df00b2 |
## the domains are not owned by this module.
|
|
Chris PeBenito |
df00b2 |
##
|
|
Chris PeBenito |
414e41 |
## </desc>
|
|
Chris PeBenito |
414e41 |
## <param name="domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
725926 |
## Domain allowed access.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
414e41 |
## </param>
|
|
Chris PeBenito |
414e41 |
## <param name="target_domain">
|
|
Chris PeBenito |
885b83 |
## <summary>
|
|
Chris PeBenito |
414e41 |
## The type of the shell process.
|
|
Chris PeBenito |
885b83 |
## </summary>
|
|
Chris PeBenito |
414e41 |
## </param>
|
|
Chris PeBenito |
4bf4ed |
#
|
|
Chris PeBenito |
df00b2 |
interface(`corecmd_shell_domtrans',`
|
|
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 |
df00b2 |
# corecmd_exec_chroot(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
df00b2 |
interface(`corecmd_exec_chroot',`
|
|
Chris PeBenito |
139520 |
gen_require(`
|
|
Chris PeBenito |
139520 |
type chroot_exec_t;
|
|
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 |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
########################################
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Execute all executable files.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## <param name="domain">
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Domain allowed access.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## </param>
|
|
Chris PeBenito |
fb63d0 |
#
|
|
Chris PeBenito |
fb63d0 |
interface(`corecmd_exec_all_executables',`
|
|
Chris PeBenito |
fb63d0 |
gen_require(`
|
|
Chris PeBenito |
fb63d0 |
attribute exec_type;
|
|
Chris PeBenito |
fb63d0 |
type bin_t, sbin_t;
|
|
Chris PeBenito |
fb63d0 |
')
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
can_exec($1,exec_type)
|
|
Chris PeBenito |
fb63d0 |
allow $1 { bin_t sbin_t }:dir list_dir_perms;
|
|
Chris PeBenito |
fb63d0 |
allow $1 { bin_t sbin_t }:lnk_file read_file_perms;
|
|
Chris PeBenito |
fb63d0 |
')
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
########################################
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Create, read, write, and all executable files.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## <param name="domain">
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Domain allowed access.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## </param>
|
|
Chris PeBenito |
fb63d0 |
#
|
|
Chris PeBenito |
fb63d0 |
interface(`corecmd_manage_all_executables',`
|
|
Chris PeBenito |
fb63d0 |
gen_require(`
|
|
Chris PeBenito |
fb63d0 |
attribute exec_type;
|
|
Chris PeBenito |
fb63d0 |
type bin_t, sbin_t;
|
|
Chris PeBenito |
fb63d0 |
')
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
allow $1 exec_type:file manage_file_perms;
|
|
Chris PeBenito |
fb63d0 |
allow $1 { bin_t sbin_t }:dir rw_dir_perms;
|
|
Chris PeBenito |
fb63d0 |
')
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
########################################
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Relabel to and from the bin type.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## <param name="domain">
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Domain allowed access.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## </param>
|
|
Chris PeBenito |
fb63d0 |
#
|
|
Chris PeBenito |
fb63d0 |
interface(`corecmd_relabel_all_executables',`
|
|
Chris PeBenito |
fb63d0 |
gen_require(`
|
|
Chris PeBenito |
fb63d0 |
attribute exec_type;
|
|
Chris PeBenito |
fb63d0 |
')
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
allow $1 exec_type:file { relabelfrom relabelto };
|
|
Chris PeBenito |
fb63d0 |
')
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
########################################
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Mmap all executables as executable.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## <param name="domain">
|
|
Chris PeBenito |
fb63d0 |
## <summary>
|
|
Chris PeBenito |
fb63d0 |
## Domain allowed access.
|
|
Chris PeBenito |
fb63d0 |
## </summary>
|
|
Chris PeBenito |
fb63d0 |
## </param>
|
|
Chris PeBenito |
fb63d0 |
#
|
|
Chris PeBenito |
fb63d0 |
interface(`corecmd_mmap_all_executables',`
|
|
Chris PeBenito |
fb63d0 |
gen_require(`
|
|
Chris PeBenito |
fb63d0 |
attribute exec_type;
|
|
Chris PeBenito |
fb63d0 |
')
|
|
Chris PeBenito |
fb63d0 |
|
|
Chris PeBenito |
fb63d0 |
allow $1 exec_type:file { getattr read execute };
|
|
Chris PeBenito |
fb63d0 |
')
|