2005-06-14 20:40:09 +00:00
|
|
|
## <summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## Policy for kernel security interface, in particular, selinuxfs.
|
2005-06-14 20:40:09 +00:00
|
|
|
## </summary>
|
2005-07-05 17:47:15 +00:00
|
|
|
## <required val="true">
|
|
|
|
## Contains the policy for the kernel SELinux security interface.
|
|
|
|
## </required>
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Gets the caller the mountpoint of the selinuxfs filesystem.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## The process type requesting the selinuxfs mountpoint.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_get_fs_mount',`
|
2005-06-14 20:40:09 +00:00
|
|
|
# read /proc/filesystems to see if selinuxfs is supported
|
|
|
|
# then read /proc/self/mount to see where selinuxfs is mounted
|
|
|
|
kernel_read_system_state($1)
|
|
|
|
')
|
|
|
|
|
2005-09-02 19:11:07 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the
|
|
|
|
## attributes of the selinuxfs directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-02 19:11:07 +00:00
|
|
|
## Domain to not audit.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-02 19:11:07 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`selinux_dontaudit_getattr_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 security_t:dir getattr;
|
|
|
|
')
|
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Search selinuxfs.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-13 20:59:36 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-13 20:59:36 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`selinux_search_fs',`
|
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 security_t:dir search;
|
|
|
|
')
|
|
|
|
|
2005-06-14 20:40:09 +00:00
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to search selinuxfs.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-13 18:29:08 +00:00
|
|
|
## Domain to not audit.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-13 18:29:08 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`selinux_dontaudit_search_fs',`
|
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 security_t:dir search;
|
|
|
|
')
|
|
|
|
|
2005-10-24 19:50:21 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to read
|
|
|
|
## generic selinuxfs entries
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-24 19:50:21 +00:00
|
|
|
## Domain to not audit.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-24 19:50:21 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`selinux_dontaudit_read_fs',`
|
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 security_t:dir search;
|
|
|
|
dontaudit $1 security_t:file { getattr read };
|
|
|
|
')
|
|
|
|
|
2005-07-13 18:29:08 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Allows the caller to get the mode of policy enforcement
|
|
|
|
## (enforcing or permissive mode).
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## The process type to allow to get the enforcing mode.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_get_enforce_mode',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Allow caller to set the mode of policy enforcement
|
|
|
|
## (enforcing or permissive mode).
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Allow caller to set the mode of policy enforcement
|
|
|
|
## (enforcing or permissive mode).
|
|
|
|
## </p>
|
|
|
|
## <p>
|
|
|
|
## Since this is a security event, this action is
|
|
|
|
## always audited.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## The process type to allow to set the enforcement mode.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_set_enforce_mode',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
attribute can_setenforce;
|
2005-11-07 20:09:28 +00:00
|
|
|
bool secure_mode_policyload;
|
2005-06-22 16:07:14 +00:00
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
typeattribute $1 can_setenforce;
|
2005-11-07 20:09:28 +00:00
|
|
|
|
|
|
|
if(!secure_mode_policyload) {
|
|
|
|
allow $1 security_t:security setenforce;
|
|
|
|
auditallow $1 security_t:security setenforce;
|
|
|
|
}
|
2005-06-14 20:40:09 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Allow caller to load the policy into the kernel.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## The process type that will load the policy.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_load_policy',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
attribute can_load_policy;
|
2005-11-07 20:09:28 +00:00
|
|
|
bool secure_mode_policyload;
|
2005-06-22 16:07:14 +00:00
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
typeattribute $1 can_load_policy;
|
2005-11-07 20:09:28 +00:00
|
|
|
|
|
|
|
if(!secure_mode_policyload) {
|
|
|
|
allow $1 security_t:security load_policy;
|
|
|
|
auditallow $1 security_t:security load_policy;
|
|
|
|
}
|
2005-06-14 20:40:09 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Allow caller to set the state of Booleans to
|
|
|
|
## enable or disable conditional portions of the policy.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Allow caller to set the state of Booleans to
|
|
|
|
## enable or disable conditional portions of the policy.
|
|
|
|
## </p>
|
|
|
|
## <p>
|
|
|
|
## Since this is a security event, this action is
|
|
|
|
## always audited.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## The process type allowed to set the Boolean.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_set_boolean',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
2005-12-06 16:33:40 +00:00
|
|
|
bool secure_mode_policyload;
|
2005-06-22 16:07:14 +00:00
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir search;
|
2005-11-07 20:09:28 +00:00
|
|
|
allow $1 security_t:dir { getattr search read };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
|
|
|
|
if(!secure_mode_policyload) {
|
|
|
|
allow $1 security_t:security setbool;
|
2006-07-13 14:22:21 +00:00
|
|
|
|
|
|
|
ifdef(`distro_rhel4',`
|
|
|
|
# needed for systems without audit support
|
|
|
|
auditallow $1 security_t:security setbool;
|
|
|
|
')
|
2005-11-07 20:09:28 +00:00
|
|
|
}
|
2005-06-14 20:40:09 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## Allow caller to set SELinux access vector cache parameters.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Allow caller to set SELinux access vector cache parameters.
|
|
|
|
## The allows the domain to set performance related parameters
|
|
|
|
## of the AVC, such as cache threshold.
|
|
|
|
## </p>
|
|
|
|
## <p>
|
|
|
|
## Since this is a security event, this action is
|
|
|
|
## always audited.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## The process type to allow to set security parameters.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_set_parameters',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
attribute can_setsecparam;
|
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
allow $1 security_t:security setsecparam;
|
|
|
|
auditallow $1 security_t:security setsecparam;
|
|
|
|
typeattribute $1 can_setsecparam;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Allows caller to validate security contexts.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## The process type permitted to validate contexts.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_validate_context',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
allow $1 security_t:security check_context;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Allows caller to compute an access vector.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## The process type allowed to compute an access vector.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_compute_access_vector',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
allow $1 security_t:security compute_av;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## Calculate the default type for object creation.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_compute_create_context',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
allow $1 security_t:security compute_create;
|
|
|
|
')
|
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allows caller to compute polyinstatntiated
|
|
|
|
## directory members.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-15 21:03:29 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-15 21:03:29 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`selinux_compute_member',`
|
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
allow $1 security_t:security compute_member;
|
|
|
|
')
|
|
|
|
|
2005-06-14 20:40:09 +00:00
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## Calculate the context for relabeling objects.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Calculate the context for relabeling objects.
|
|
|
|
## This is determined by using the type_change
|
|
|
|
## rules in the policy, and is generally used
|
|
|
|
## for determining the context for relabeling
|
|
|
|
## a terminal when a user logs in.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_compute_relabel_context',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
allow $1 security_t:security compute_relabel;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Allows caller to compute possible contexts for a user.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## The process type allowed to compute user contexts.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-14 20:40:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`selinux_compute_user_contexts',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type security_t;
|
|
|
|
')
|
2005-06-14 20:40:09 +00:00
|
|
|
|
|
|
|
allow $1 security_t:dir { read search getattr };
|
|
|
|
allow $1 security_t:file { getattr read write };
|
|
|
|
allow $1 security_t:security compute_user;
|
|
|
|
')
|
|
|
|
|
2005-07-05 20:59:51 +00:00
|
|
|
########################################
|
2005-07-13 18:29:08 +00:00
|
|
|
## <summary>
|
2005-08-12 19:28:30 +00:00
|
|
|
## Unconfined access to the SELinux kernel security server.
|
2005-07-13 18:29:08 +00:00
|
|
|
## </summary>
|
2005-07-05 20:59:51 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-05 20:59:51 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-05 20:59:51 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`selinux_unconfined',`
|
|
|
|
gen_require(`
|
2006-05-19 15:15:45 +00:00
|
|
|
attribute selinux_unconfined_type;
|
2005-07-05 20:59:51 +00:00
|
|
|
')
|
|
|
|
|
2006-05-19 15:15:45 +00:00
|
|
|
typeattribute $1 selinux_unconfined_type;
|
2005-07-05 20:59:51 +00:00
|
|
|
')
|