eliminate _depend macros

This commit is contained in:
Chris PeBenito 2005-06-16 20:30:59 +00:00
parent 8c2f3ac695
commit 77c124c8cd

View File

@ -6,27 +6,26 @@
# domain_base_domain_type(domain)
#
define(`domain_base_domain_type',`
gen_require(`$0'_depend)
gen_require(`
attribute domain;
class dir r_dir_perms;
class lnk_file r_file_perms;
class file rw_file_perms;
class process { fork sigchld };
')
# mark as a domain
typeattribute $1 domain;
# allow the domain to read its /proc/pid entries
allow $1 self:dir r_dir_perms;
allow $1 self:{ file lnk_file } rw_file_perms;
allow $1 self:lnk_file r_file_perms;
allow $1 self:file rw_file_perms;
# allow $1 to create child processes in this domain
allow $1 self:process { fork sigchld };
')
define(`domain_base_domain_type_depend',`
attribute domain;
class dir r_dir_perms;
class file rw_file_perms;
class lnk_file r_file_perms;
')
########################################
#
# domain_type(domain)
@ -58,31 +57,26 @@ define(`domain_type',`
# domain_entry_file(domain,entrypointfile)
#
define(`domain_entry_file',`
gen_require(`$0'_depend)
gen_require(`
attribute entry_type;
class file entrypoint;
')
files_file_type($2)
allow $1 $2:file entrypoint;
typeattribute $2 entry_type;
')
define(`domain_entry_file_depend',`
attribute entry_type;
class file entrypoint;
')
########################################
#
# domain_wide_inherit_fd(domain)
#
define(`domain_wide_inherit_fd',`
gen_require(`$0'_depend)
typeattribute $1 privfd;
gen_require(`
attribute privfd;
')
define(`domain_wide_inherit_fd_depend',`
attribute privfd;
typeattribute $1 privfd;
')
########################################
@ -97,13 +91,11 @@ define(`domain_wide_inherit_fd_depend',`
## </interface>
#
define(`domain_subj_id_change_exempt',`
gen_require(`$0'_depend)
typeattribute $1 can_change_process_identity;
gen_require(`
attribute can_change_process_identity;
')
define(`domain_subj_id_change_exempt_depend',`
attribute can_change_process_identity;
typeattribute $1 can_change_process_identity;
')
########################################
@ -118,13 +110,11 @@ define(`domain_subj_id_change_exempt_depend',`
## </interface>
#
define(`domain_role_change_exempt',`
gen_require(`$0'_depend)
typeattribute $1 can_change_process_role;
gen_require(`
attribute can_change_process_role;
')
define(`domain_role_change_exempt_depend',`
attribute can_change_process_role;
typeattribute $1 can_change_process_role;
')
########################################
@ -139,13 +129,11 @@ define(`domain_role_change_exempt_depend',`
## </interface>
#
define(`domain_obj_id_change_exempt',`
gen_require(`$0'_depend)
typeattribute $1 can_change_object_identity;
gen_require(`
attribute can_change_object_identity;
')
define(`domain_obj_id_change_exempt_depend',`
attribute can_change_object_identity;
typeattribute $1 can_change_object_identity;
')
########################################
@ -153,15 +141,12 @@ define(`domain_obj_id_change_exempt_depend',`
# domain_use_wide_inherit_fd(domain)
#
define(`domain_use_wide_inherit_fd',`
gen_require(`$0'_depend)
allow $1 privfd:fd use;
gen_require(`
attribute privfd;
class fd use;
')
define(`domain_use_wide_inherit_fd_depend',`
attribute privfd;
class fd use;
allow $1 privfd:fd use;
')
########################################
@ -169,15 +154,12 @@ define(`domain_use_wide_inherit_fd_depend',`
# domain_dontaudit_use_wide_inherit_fd(domain)
#
define(`domain_dontaudit_use_wide_inherit_fd',`
gen_require(`$0'_depend)
dontaudit $1 privfd:fd use;
gen_require(`
attribute privfd;
class fd use;
')
define(`domain_dontaudit_use_wide_inherit_fd_depend',`
attribute privfd;
class fd use;
dontaudit $1 privfd:fd use;
')
########################################
@ -185,15 +167,12 @@ define(`domain_dontaudit_use_wide_inherit_fd_depend',`
# domain_setpriority_all_domains(domain)
#
define(`domain_setpriority_all_domains',`
gen_require(`$0'_depend)
allow $1 domain:process setsched;
gen_require(`
attribute domain;
class process setsched;
')
define(`domain_setpriority_all_domains_depend',`
attribute domain;
class process setsched;
allow $1 domain:process setsched;
')
########################################
@ -207,15 +186,12 @@ define(`domain_setpriority_all_domains_depend',`
## </interface>
#
define(`domain_signal_all_domains',`
gen_require(`$0'_depend)
allow $1 domain:process signal;
gen_require(`
attribute domain;
class process signal;
')
define(`domain_signal_all_domains_depend',`
attribute domain;
class process signal;
allow $1 domain:process signal;
')
########################################
@ -229,15 +205,12 @@ define(`domain_signal_all_domains_depend',`
## </interface>
#
define(`domain_signull_all_domains',`
gen_require(`$0'_depend)
allow $1 domain:process signull;
gen_require(`
attribute domain;
class process signull;
')
define(`domain_signull_all_domains_depend',`
attribute domain;
class process signull;
allow $1 domain:process signull;
')
########################################
@ -251,15 +224,12 @@ define(`domain_signull_all_domains_depend',`
## </interface>
#
define(`domain_sigstop_all_domains',`
gen_require(`$0'_depend)
allow $1 domain:process sigstop;
gen_require(`
attribute domain;
class process sigstop;
')
define(`domain_sigstop_all_domains_depend',`
attribute domain;
class process sigstop;
allow $1 domain:process sigstop;
')
########################################
@ -273,15 +243,12 @@ define(`domain_sigstop_all_domains_depend',`
## </interface>
#
define(`domain_sigchld_all_domains',`
gen_require(`$0'_depend)
allow $1 domain:process sigchld;
gen_require(`
attribute domain;
class process sigchld;
')
define(`domain_sigchld_all_domains_depend',`
attribute domain;
class process sigchld;
allow $1 domain:process sigchld;
')
########################################
@ -295,19 +262,16 @@ define(`domain_sigchld_all_domains_depend',`
## </interface>
#
define(`domain_kill_all_domains',`
gen_require(`$0'_depend)
gen_require(`
attribute domain;
class process sigkill;
class capability kill;
')
allow $1 domain:process sigkill;
allow $1 self:capability kill;
')
define(`domain_kill_all_domains_depend',`
attribute domain;
class process sigkill;
class capability kill;
')
########################################
## <interface name="domain_read_all_domains_state">
## <description>
@ -319,7 +283,13 @@ define(`domain_kill_all_domains_depend',`
## </interface>
#
define(`domain_read_all_domains_state',`
gen_require(`$0'_depend)
gen_require(`
attribute domain;
class dir r_dir_perms;
class lnk_file r_file_perms;
class file r_file_perms;
class process { getattr ptrace };
')
allow $1 domain:dir r_dir_perms;
allow $1 domain:lnk_file r_file_perms;
@ -333,15 +303,6 @@ define(`domain_read_all_domains_state',`
dontaudit $1 domain:process ptrace;
')
define(`domain_read_all_domains_state_depend',`
attribute domain;
class dir r_dir_perms;
class lnk_file r_file_perms;
class file r_file_perms;
class process { getattr ptrace };
')
########################################
## <interface name="domain_dontaudit_list_all_domains_proc">
## <description>
@ -354,17 +315,13 @@ define(`domain_read_all_domains_state_depend',`
## </interface>
#
define(`domain_dontaudit_list_all_domains_proc',`
gen_require(`$0'_depend)
dontaudit $1 domain:dir r_dir_perms;
')
define(`domain_dontaudit_list_all_domains_proc_depend',`
gen_require(`
attribute domain;
class dir r_dir_perms;
')
dontaudit $1 domain:dir r_dir_perms;
')
########################################
## <interface name="domain_getsession_all_domains">
@ -377,15 +334,12 @@ define(`domain_dontaudit_list_all_domains_proc_depend',`
## </interface>
#
define(`domain_getsession_all_domains',`
gen_require(`$0'_depend)
allow $1 domain:process getsession;
gen_require(`
attribute domain;
class process getsession;
')
define(`domain_getsession_all_domains_depend',`
attribute domain;
class process getsession;
allow $1 domain:process getsession;
')
########################################
@ -400,15 +354,12 @@ define(`domain_getsession_all_domains_depend',`
## </interface>
#
define(`domain_dontaudit_getattr_all_udp_sockets',`
gen_require(`$0'_depend)
dontaudit $1 domain:udp_socket getattr;
gen_require(`
attribute domain;
class udp_socket getattr;
')
define(`domain_dontaudit_getattr_all_udp_sockets_depend',`
attribute domain;
class udp_socket getattr;
dontaudit $1 domain:udp_socket getattr;
')
########################################
@ -423,15 +374,12 @@ define(`domain_dontaudit_getattr_all_udp_sockets_depend',`
## </interface>
#
define(`domain_dontaudit_getattr_all_tcp_sockets',`
gen_require(`$0'_depend)
dontaudit $1 domain:tcp_socket getattr;
gen_require(`
attribute domain;
class tcp_socket getattr;
')
define(`domain_dontaudit_getattr_all_tcp_sockets_depend',`
attribute domain;
class tcp_socket getattr;
dontaudit $1 domain:tcp_socket getattr;
')
########################################
@ -446,15 +394,12 @@ define(`domain_dontaudit_getattr_all_tcp_sockets_depend',`
## </interface>
#
define(`domain_dontaudit_getattr_all_unix_dgram_sockets',`
gen_require(`$0'_depend)
dontaudit $1 domain:unix_dgram_socket getattr;
gen_require(`
attribute domain;
class unix_dgram_socket getattr;
')
define(`domain_dontaudit_getattr_all_unix_dgram_sockets_depend',`
attribute domain;
class unix_dgram_socket getattr;
dontaudit $1 domain:unix_dgram_socket getattr;
')
########################################
@ -469,15 +414,12 @@ define(`domain_dontaudit_getattr_all_unix_dgram_sockets_depend',`
## </interface>
#
define(`domain_dontaudit_getattr_all_unnamed_pipes',`
gen_require(`$0'_depend)
dontaudit $1 domain:fifo_file getattr;
gen_require(`
attribute domain;
class fifo_file getattr;
')
define(`domain_dontaudit_getattr_all_unnamed_pipes_depend',`
attribute domain;
class fifo_file getattr;
dontaudit $1 domain:fifo_file getattr;
')
########################################
@ -485,16 +427,11 @@ define(`domain_dontaudit_getattr_all_unnamed_pipes_depend',`
# domain_exec_all_entry_files(domain)
#
define(`domain_exec_all_entry_files',`
gen_require(`$0'_depend)
can_exec($1,entry_type)
gen_require(`
attribute entry_type;
')
define(`domain_exec_all_entry_files_depend',`
attribute entry_type;
class file { getattr read ioctl lock execute execute_no_trans };
can_exec($1,entry_type)
')
########################################
@ -502,25 +439,22 @@ define(`domain_exec_all_entry_files_depend',`
# domain_read_all_entry_files(domain)
#
define(`domain_read_all_entry_files',`
gen_require(`$0'_depend)
gen_require(`
attribute entry_type;
class file r_file_perms;
class lnk_file r_file_perms;
')
allow $1 entry_type:lnk_file r_file_perms;
allow $1 entry_type:file r_file_perms;
')
define(`domain_read_all_entry_files_depend',`
attribute entry_type;
class file r_file_perms;
class lnk_file r_file_perms;
')
## </module>
#
# These next macros are not interfaces, but actually are
# support macros. Due to the domain_ prefix, they
# are placed in this module.
# are placed in this module, to try to prevent confusion.
#
########################################
@ -528,18 +462,16 @@ define(`domain_read_all_entry_files_depend',`
# domain_trans(source_domain,entrypoint_file,target_domain)
#
define(`domain_trans',`
gen_require(`$0'_depend)
gen_require(`
class file rx_file_perms;
process { transition noatsecure siginh rlimitinh };
')
allow $1 $2:file rx_file_perms;
allow $1 $3:process transition;
dontaudit $1 $3:process { noatsecure siginh rlimitinh };
')
define(`domain_trans_depend',`
class file rx_file_perms;
process { transition noatsecure siginh rlimitinh };
')
########################################
#
# domain_auto_trans(source_domain,entrypoint_file,target_domain)