Chris PeBenito e181fe
Chris PeBenito 2c2435
policy_module(domain,1.0.1)
Chris PeBenito 960373
Chris PeBenito fd89e1
########################################
Chris PeBenito fd89e1
#
Chris PeBenito fd89e1
# Declarations
Chris PeBenito fd89e1
#
Chris PeBenito fd89e1
Chris PeBenito b4cd15
# Mark process types as domains
Chris PeBenito b4cd15
attribute domain;
Chris PeBenito b4cd15
Chris PeBenito 2e863f
# Transitions only allowed from domains to other domains
Chris PeBenito 2e863f
neverallow domain ~domain:process { transition dyntransition };
Chris PeBenito 2e863f
Chris PeBenito 605ba2
# Domains that are unconfined
Chris PeBenito 605ba2
attribute unconfined_domain;
Chris PeBenito 605ba2
Chris PeBenito 2e863f
# Domains that can set their current context
Chris PeBenito 2e863f
# (perform dynamic transitions)
Chris PeBenito 2e863f
attribute set_curr_context;
Chris PeBenito 2e863f
Chris PeBenito 2e863f
# enabling setcurrent breaks process tranquility.  If you do not
Chris PeBenito 2e863f
# know what this means or do not understand the implications of a
Chris PeBenito 2e863f
# dynamic transition, you should not be using it!!!
Chris PeBenito 2e863f
neverallow { domain -set_curr_context } self:process setcurrent;
Chris PeBenito 2e863f
Chris PeBenito 960373
# entrypoint executables
Chris PeBenito 960373
attribute entry_type;
Chris PeBenito 960373
Chris PeBenito 8a0da1
# widely-inheritable file descriptors
Chris PeBenito 8a0da1
attribute privfd;
Chris PeBenito 8a0da1
Chris PeBenito 2e863f
#
Chris PeBenito 8bd678
# constraint related attributes
Chris PeBenito 2e863f
#
Chris PeBenito 2e863f
Chris PeBenito 2e863f
# [1] types that can change SELinux identity on transition
Chris PeBenito 8bd678
attribute can_change_process_identity;
Chris PeBenito 2e863f
Chris PeBenito 2e863f
# [2] types that can change SELinux role on transition
Chris PeBenito 8bd678
attribute can_change_process_role;
Chris PeBenito 2e863f
Chris PeBenito 2e863f
# [3] types that can change the SELinux identity on a filesystem
Chris PeBenito 2e863f
# object or a socket object on a create or relabel
Chris PeBenito 8bd678
attribute can_change_object_identity;
Chris PeBenito 8bd678
Chris PeBenito 2e863f
# [3] types that can change to system_u:system_r
Chris PeBenito 2e863f
attribute can_system_change;
Chris PeBenito a154cd
Chris PeBenito 2e863f
# [4] types that have attribute 1 can change the SELinux
Chris PeBenito 2e863f
# identity only if the target domain has this attribute.
Chris PeBenito 2e863f
# Types that have attribute 2 can change the SELinux role
Chris PeBenito 2e863f
# only if the target domain has this attribute.
Chris PeBenito 2e863f
attribute process_user_target;
Chris PeBenito 2e863f
Chris PeBenito 2e863f
# For cron jobs
Chris PeBenito 2e863f
# [5] types used for cron daemons
Chris PeBenito 2e863f
attribute cron_source_domain;
Chris PeBenito 2e863f
# [6] types used for cron jobs
Chris PeBenito 2e863f
attribute cron_job_domain;
Chris PeBenito 2e863f
Chris PeBenito 2e863f
# [7] types that are unconditionally exempt from
Chris PeBenito 2e863f
# SELinux identity and role change constraints
Chris PeBenito 2e863f
attribute process_uncond_exempt;	# add userhelperdomain to this one
Chris PeBenito 2a3478
Chris PeBenito 391ede
# TODO:
Chris PeBenito 391ede
# cjp: also need to except correctly for SEFramework
Chris PeBenito 2e863f
neverallow { domain unlabeled_t } file_type:process *;
Chris PeBenito 2e863f
neverallow ~{ domain unlabeled_t } *:process *;