Fix test failure introduced several commits ago
[gruntmaster-daemon.git] / selinux / gruntmasterd.te
... / ...
CommitLineData
1policy_module(gruntmasterd, 1.0)
2
3define(`read_file_perms', `{ getattr ioctl read lock open }')
4define(`read_dir_perms', `{ getattr ioctl read lock open search}')
5define(`everything_file_perms', `{ getattr ioctl read lock open unlink setattr append write create rename link }')
6define(`everything_dir_perms', `{ getattr ioctl read lock open search unlink setattr write create rename link rmdir remove_name reparent add_name }')
7define(`domain_read_files', `allow $1 $2 : dir read_dir_perms; allow $1 $2 : file read_file_perms; allow $1 $2 : lnk_file read_file_perms;')
8define(`domain_everything_files', `allow $1 $2 : dir everything_dir_perms; allow $1 $2 : file everything_file_perms; allow $1 $2 : lnk_file everything_file_perms;')
9define(`gruntmaster_read', `domain_read_files(gruntmasterd_t, $1)')
10define(`gruntmaster_everything', `domain_everything_files(gruntmasterd_t, $1)')
11
12require{
13 type bin_t;
14 type http_port_t;
15 type httpd_sys_content_rw_t;
16 type httpd_sys_content_t;
17 type httpd_t;
18 type httpd_tmp_t;
19 type net_conf_t;
20 type port_t;
21 type proc_t;
22 type urandom_device_t;
23}
24
25# Types
26type gruntmasterd_t;
27type gruntmasterd_etc_t;
28type gruntmasterd_exec_t;
29type gruntmasterd_log_t;
30type gruntmasterd_tmp_t;
31type gruntmasterd_var_lib_t;
32type gruntmaster_job_t;
33type gruntmaster_job_exec_t;
34type gruntmaster_compile_t;
35type gruntmaster_compile_exec_t;
36type gruntmaster_paged_t;
37type gruntmaster_paged_exec_t;
38
39domain_type(gruntmaster_job_t)
40domain_entry_file(gruntmaster_job_t, gruntmaster_job_exec_t)
41role system_r types gruntmaster_job_t;
42
43domain_type(gruntmaster_compile_t)
44domain_entry_file(gruntmaster_compile_t, gruntmaster_compile_exec_t)
45role system_r types gruntmaster_compile_t;
46type_transition gruntmaster_compile_t gruntmasterd_tmp_t : file gruntmaster_job_exec_t;
47
48init_daemon_domain(gruntmaster_paged_t, gruntmaster_paged_exec_t)
49type_transition gruntmaster_paged_t httpd_sys_content_t : { file dir } httpd_sys_content_rw_t;
50
51init_daemon_domain(gruntmasterd_t, gruntmasterd_exec_t)
52logging_log_file(gruntmasterd_log_t)
53logging_log_filetrans(gruntmasterd_t, gruntmasterd_log_t, file)
54logging_search_logs(gruntmasterd_t)
55type_transition gruntmasterd_t gruntmaster_compile_exec_t : process gruntmaster_compile_t;
56type_transition gruntmasterd_t gruntmaster_job_exec_t : process gruntmaster_job_t;
57type_transition gruntmasterd_t tmp_t : dir gruntmasterd_tmp_t;
58files_type(gruntmasterd_tmp_t)
59files_type(gruntmasterd_etc_t)
60files_type(gruntmasterd_var_lib_t)
61
62# Daemon permissions
63allow gruntmasterd_t { gruntmaster_compile_t gruntmaster_job_t } : process { sigkill siginh rlimitinh transition };
64allow gruntmasterd_t bin_t : file { execute execute_no_trans };
65allow gruntmasterd_t self : process fork;
66allow gruntmasterd_t self:fifo_file everything_file_perms;
67allow gruntmasterd_t urandom_device_t:chr_file read_file_perms;
68allow gruntmasterd_t { gruntmaster_compile_exec_t gruntmaster_job_exec_t } : file execute;
69allow gruntmasterd_t port_t:tcp_socket name_connect;
70allow gruntmasterd_t http_port_t:tcp_socket name_connect;
71allow gruntmasterd_t net_conf_t:file { read getattr open };
72allow gruntmasterd_t self:udp_socket { write read create connect getattr };
73allow gruntmasterd_t self:tcp_socket { read write create ioctl connect };
74dontaudit gruntmasterd_t { gruntmaster_compile_t gruntmaster_job_t } : process noatsecure;
75
76allow gruntmasterd_t tmp_t : dir { getattr write search add_name };
77
78gruntmaster_read(bin_t)
79gruntmaster_read(gruntmaster_compile_exec_t)
80gruntmaster_read(gruntmasterd_etc_t)
81gruntmaster_read(gruntmasterd_var_lib_t)
82gruntmaster_read(gruntmaster_job_exec_t)
83gruntmaster_read(httpd_sys_content_t)
84gruntmaster_read(lib_t)
85gruntmaster_read(proc_t)
86gruntmaster_read(usr_t)
87
88gruntmaster_everything(gruntmasterd_log_t)
89gruntmaster_everything(gruntmasterd_tmp_t)
90
91files_read_etc_files(gruntmasterd_t)
92files_search_etc(gruntmasterd_t)
93libs_use_ld_so(gruntmasterd_t)
94libs_use_shared_libs(gruntmasterd_t)
95miscfiles_read_localization(gruntmasterd_t)
96
97# Executor and job permissions
98domain_read_files(gruntmaster_job_t, bin_t)
99domain_read_files(gruntmaster_job_t, usr_t)
100allow gruntmaster_job_t gruntmaster_job_exec_t : file { execute execute_no_trans };
101allow gruntmaster_job_t gruntmasterd_t:fd use;
102allow gruntmaster_job_t gruntmasterd_t:process sigchld;
103allow gruntmaster_job_t gruntmasterd_tmp_t : dir read_dir_perms;
104allow gruntmaster_job_t gruntmasterd_tmp_t : file { getattr ioctl read write };
105allow gruntmaster_job_t init_t:fd use;
106allow gruntmaster_job_t self:process setrlimit;
107allow gruntmaster_job_t urandom_device_t:chr_file read_file_perms;
108
109libs_use_ld_so(gruntmaster_job_t)
110libs_use_shared_libs(gruntmaster_job_t)
111miscfiles_read_localization(gruntmaster_job_t)
112
113# Compile permissions
114domain_everything_files(gruntmaster_compile_t, gruntmaster_job_exec_t)
115domain_everything_files(gruntmaster_compile_t, tmp_t)
116domain_read_files(gruntmaster_compile_t, bin_t)
117domain_read_files(gruntmaster_compile_t, lib_t)
118domain_read_files(gruntmaster_compile_t, proc_t)
119domain_read_files(gruntmaster_compile_t, proc_t)
120domain_read_files(gruntmaster_compile_t, usr_t)
121domain_read_files(gruntmaster_compile_t, gruntmasterd_tmp_t)
122allow gruntmaster_compile_t gruntmasterd_t : fifo_file { read write ioctl };
123allow gruntmaster_compile_t gruntmasterd_t:fd use;
124allow gruntmaster_compile_t gruntmasterd_t:process sigchld;
125allow gruntmaster_compile_t gruntmasterd_tmp_t:dir { write add_name };
126allow gruntmaster_compile_t self : fifo_file { read write ioctl };
127allow gruntmaster_compile_t self:process signal;
128allow gruntmaster_compile_t urandom_device_t:chr_file read_file_perms;
129allow gruntmaster_compile_t { bin_t lib_t } : file { execute execute_no_trans };
130
131libs_use_ld_so(gruntmaster_compile_t)
132libs_use_shared_libs(gruntmaster_compile_t)
133miscfiles_read_localization(gruntmaster_compile_t)
134
135# Page generator permissions
136domain_everything_files(gruntmaster_paged_t, httpd_sys_content_rw_t)
137domain_read_files(gruntmaster_paged_t, usr_t)
138domain_read_files(gruntmaster_paged_t, bin_t)
139allow gruntmaster_paged_t urandom_device_t:chr_file read_file_perms;
140allow gruntmaster_paged_t port_t:tcp_socket name_connect;
141allow gruntmaster_paged_t self:tcp_socket { read write create ioctl connect };
142
143libs_use_ld_so(gruntmaster_paged_t)
144libs_use_shared_libs(gruntmaster_paged_t)
145miscfiles_read_localization(gruntmaster_paged_t)
This page took 0.008973 seconds and 4 git commands to generate.