Update SELinux policy and move log configuration to /etc
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 22 Jan 2014 21:17:24 +0000 (23:17 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 22 Jan 2014 21:17:24 +0000 (23:17 +0200)
lib/Gruntmaster/Daemon.pm
selinux/gruntmasterd.fc
selinux/gruntmasterd.te

index 46da60b9da8355dd6d9999859d923f10c5371e3c..40529b26d505a6cf7019c6e9d4f4b38bd0260c71 100644 (file)
@@ -151,7 +151,7 @@ sub got_job{
 }
 
 sub run{
 }
 
 sub run{
-  Log::Log4perl->init('log.conf');
+  Log::Log4perl->init('/etc/gruntmasterd-log.conf');
   get_logger->info("gruntmasterd $VERSION started");
   chdir tempdir 'gruntmasterd.XXXX', CLEANUP => 1, TMPDIR => 1;
   SUBSCRIBE jobs => \&got_job;
   get_logger->info("gruntmasterd $VERSION started");
   chdir tempdir 'gruntmasterd.XXXX', CLEANUP => 1, TMPDIR => 1;
   SUBSCRIBE jobs => \&got_job;
index c6aca366d478855a24a1e1e15a212809b7efa627..6d67f3264835e5abc9a3864c30c7045858cdf405 100644 (file)
@@ -1,4 +1,6 @@
 /usr/(local/)?bin/gruntmasterd        gen_context(system_u:object_r:gruntmasterd_exec_t, s0)
 /usr/(local/)?bin/gruntmaster-compile gen_context(system_u:object_r:gruntmaster_compile_exec_t, s0)
 /usr/(local/)?bin/gruntmaster-exec    gen_context(system_u:object_r:gruntmaster_job_exec_t, s0)
 /usr/(local/)?bin/gruntmasterd        gen_context(system_u:object_r:gruntmasterd_exec_t, s0)
 /usr/(local/)?bin/gruntmaster-compile gen_context(system_u:object_r:gruntmaster_compile_exec_t, s0)
 /usr/(local/)?bin/gruntmaster-exec    gen_context(system_u:object_r:gruntmaster_job_exec_t, s0)
+/usr/(local/)?bin/gruntmaster-paged   gen_context(system_u:object_r:gruntmaster_paged_exec_t, s0)
+/etc/gruntmasterd-log.conf            gen_context(system_u:object_r:gruntmasterd_etc_t, s0)
 /var/log/gruntmasterd                 gen_context(system_u:object_r:gruntmasterd_log_t, s0)
 /var/log/gruntmasterd                 gen_context(system_u:object_r:gruntmasterd_log_t, s0)
index c6b4eed2ee432f8eb04f8864cce4fb5b2bb7d399..ed878dae812ee0a9dc8016f435be89d130a320bb 100644 (file)
@@ -15,34 +15,45 @@ require{
        type httpd_sys_content_t;
        type httpd_t;
        type httpd_tmp_t;
        type httpd_sys_content_t;
        type httpd_t;
        type httpd_tmp_t;
+       type port_t;
        type proc_t;
        type urandom_device_t;
 }
 
 # Types
 type gruntmasterd_t;
        type proc_t;
        type urandom_device_t;
 }
 
 # Types
 type gruntmasterd_t;
+type gruntmasterd_etc_t;
 type gruntmasterd_exec_t;
 type gruntmasterd_log_t;
 type gruntmasterd_exec_t;
 type gruntmasterd_log_t;
+type gruntmasterd_tmp_t;
 type gruntmaster_job_t;
 type gruntmaster_job_exec_t;
 type gruntmaster_compile_t;
 type gruntmaster_compile_exec_t;
 type gruntmaster_job_t;
 type gruntmaster_job_exec_t;
 type gruntmaster_compile_t;
 type gruntmaster_compile_exec_t;
+type gruntmaster_paged_t;
+type gruntmaster_paged_exec_t;
 
 domain_type(gruntmaster_job_t)
 domain_entry_file(gruntmaster_job_t, gruntmaster_job_exec_t)
 role system_r types gruntmaster_job_t;
 
 domain_type(gruntmaster_job_t)
 domain_entry_file(gruntmaster_job_t, gruntmaster_job_exec_t)
 role system_r types gruntmaster_job_t;
-type_transition gruntmasterd_t gruntmaster_job_exec_t : process gruntmaster_job_t;
 
 domain_type(gruntmaster_compile_t)
 domain_entry_file(gruntmaster_compile_t, gruntmaster_compile_exec_t)
 role system_r types gruntmaster_compile_t;
 
 domain_type(gruntmaster_compile_t)
 domain_entry_file(gruntmaster_compile_t, gruntmaster_compile_exec_t)
 role system_r types gruntmaster_compile_t;
-type_transition gruntmasterd_t gruntmaster_compile_exec_t : process gruntmaster_compile_t;
-type_transition gruntmaster_compile_t httpd_tmp_t : file gruntmaster_job_exec_t;
+type_transition gruntmaster_compile_t gruntmasterd_tmp_t : file gruntmaster_job_exec_t;
+
+init_daemon_domain(gruntmaster_paged_t, gruntmaster_paged_exec_t)
+type_transition gruntmaster_paged_t httpd_sys_content_t : { file dir } httpd_sys_content_rw_t;
 
 init_daemon_domain(gruntmasterd_t, gruntmasterd_exec_t)
 logging_log_file(gruntmasterd_log_t)
 logging_log_filetrans(gruntmasterd_t, gruntmasterd_log_t, file)
 logging_search_logs(gruntmasterd_t)
 
 init_daemon_domain(gruntmasterd_t, gruntmasterd_exec_t)
 logging_log_file(gruntmasterd_log_t)
 logging_log_filetrans(gruntmasterd_t, gruntmasterd_log_t, file)
 logging_search_logs(gruntmasterd_t)
+type_transition gruntmasterd_t gruntmaster_compile_exec_t : process gruntmaster_compile_t;
+type_transition gruntmasterd_t gruntmaster_job_exec_t : process gruntmaster_job_t;
+type_transition gruntmasterd_t tmp_t : dir gruntmasterd_tmp_t;
+files_type(gruntmasterd_tmp_t)
+files_type(gruntmasterd_etc_t)
 
 # Daemon permissions
 allow gruntmasterd_t { gruntmaster_compile_t gruntmaster_job_t } : process { sigkill siginh rlimitinh transition };
 
 # Daemon permissions
 allow gruntmasterd_t { gruntmaster_compile_t gruntmaster_job_t } : process { sigkill siginh rlimitinh transition };
@@ -51,20 +62,23 @@ allow gruntmasterd_t self : process fork;
 allow gruntmasterd_t self:fifo_file everything_file_perms;
 allow gruntmasterd_t urandom_device_t:chr_file read_file_perms;
 allow gruntmasterd_t { gruntmaster_compile_exec_t gruntmaster_job_exec_t } : file execute;
 allow gruntmasterd_t self:fifo_file everything_file_perms;
 allow gruntmasterd_t urandom_device_t:chr_file read_file_perms;
 allow gruntmasterd_t { gruntmaster_compile_exec_t gruntmaster_job_exec_t } : file execute;
+allow gruntmasterd_t port_t:tcp_socket name_connect;
+allow gruntmasterd_t self:tcp_socket { read write create ioctl connect };
 dontaudit gruntmasterd_t { gruntmaster_compile_t gruntmaster_job_t } : process noatsecure;
 
 dontaudit gruntmasterd_t { gruntmaster_compile_t gruntmaster_job_t } : process noatsecure;
 
+allow gruntmasterd_t tmp_t : dir { getattr write search add_name };
+
 gruntmaster_read(bin_t)
 gruntmaster_read(gruntmaster_compile_exec_t)
 gruntmaster_read(bin_t)
 gruntmaster_read(gruntmaster_compile_exec_t)
+gruntmaster_read(gruntmasterd_etc_t)
+gruntmaster_read(gruntmaster_job_exec_t)
 gruntmaster_read(httpd_sys_content_t)
 gruntmaster_read(lib_t)
 gruntmaster_read(proc_t)
 gruntmaster_read(usr_t)
 
 gruntmaster_read(httpd_sys_content_t)
 gruntmaster_read(lib_t)
 gruntmaster_read(proc_t)
 gruntmaster_read(usr_t)
 
-gruntmaster_everything(gruntmaster_job_exec_t)
 gruntmaster_everything(gruntmasterd_log_t)
 gruntmaster_everything(gruntmasterd_log_t)
-gruntmaster_everything(httpd_sys_content_rw_t)
-gruntmaster_everything(httpd_tmp_t)
-gruntmaster_everything(tmp_t)
+gruntmaster_everything(gruntmasterd_tmp_t)
 
 files_read_etc_files(gruntmasterd_t)
 files_search_etc(gruntmasterd_t)
 
 files_read_etc_files(gruntmasterd_t)
 files_search_etc(gruntmasterd_t)
@@ -78,8 +92,8 @@ domain_read_files(gruntmaster_job_t, usr_t)
 allow gruntmaster_job_t gruntmaster_job_exec_t : file { execute execute_no_trans };
 allow gruntmaster_job_t gruntmasterd_t:fd use;
 allow gruntmaster_job_t gruntmasterd_t:process sigchld;
 allow gruntmaster_job_t gruntmaster_job_exec_t : file { execute execute_no_trans };
 allow gruntmaster_job_t gruntmasterd_t:fd use;
 allow gruntmaster_job_t gruntmasterd_t:process sigchld;
-allow gruntmaster_job_t httpd_tmp_t : dir read_dir_perms;
-allow gruntmaster_job_t httpd_tmp_t : file { getattr ioctl read write };
+allow gruntmaster_job_t gruntmasterd_tmp_t : dir read_dir_perms;
+allow gruntmaster_job_t gruntmasterd_tmp_t : file { getattr ioctl read write };
 allow gruntmaster_job_t init_t:fd use;
 allow gruntmaster_job_t self:process setrlimit;
 allow gruntmaster_job_t urandom_device_t:chr_file read_file_perms;
 allow gruntmaster_job_t init_t:fd use;
 allow gruntmaster_job_t self:process setrlimit;
 allow gruntmaster_job_t urandom_device_t:chr_file read_file_perms;
@@ -92,16 +106,15 @@ miscfiles_read_localization(gruntmaster_job_t)
 domain_everything_files(gruntmaster_compile_t, gruntmaster_job_exec_t)
 domain_everything_files(gruntmaster_compile_t, tmp_t)
 domain_read_files(gruntmaster_compile_t, bin_t)
 domain_everything_files(gruntmaster_compile_t, gruntmaster_job_exec_t)
 domain_everything_files(gruntmaster_compile_t, tmp_t)
 domain_read_files(gruntmaster_compile_t, bin_t)
-domain_read_files(gruntmaster_compile_t, httpd_sys_content_rw_t)
-domain_read_files(gruntmaster_compile_t, httpd_tmp_t)
 domain_read_files(gruntmaster_compile_t, lib_t)
 domain_read_files(gruntmaster_compile_t, proc_t)
 domain_read_files(gruntmaster_compile_t, proc_t)
 domain_read_files(gruntmaster_compile_t, usr_t)
 domain_read_files(gruntmaster_compile_t, lib_t)
 domain_read_files(gruntmaster_compile_t, proc_t)
 domain_read_files(gruntmaster_compile_t, proc_t)
 domain_read_files(gruntmaster_compile_t, usr_t)
+domain_read_files(gruntmaster_compile_t, gruntmasterd_tmp_t)
 allow gruntmaster_compile_t gruntmasterd_t : fifo_file { read write ioctl };
 allow gruntmaster_compile_t gruntmasterd_t:fd use;
 allow gruntmaster_compile_t gruntmasterd_t:process sigchld;
 allow gruntmaster_compile_t gruntmasterd_t : fifo_file { read write ioctl };
 allow gruntmaster_compile_t gruntmasterd_t:fd use;
 allow gruntmaster_compile_t gruntmasterd_t:process sigchld;
-allow gruntmaster_compile_t httpd_tmp_t:dir { write add_name };
+allow gruntmaster_compile_t gruntmasterd_tmp_t:dir { write add_name };
 allow gruntmaster_compile_t self : fifo_file { read write ioctl };
 allow gruntmaster_compile_t self:process signal;
 allow gruntmaster_compile_t urandom_device_t:chr_file read_file_perms;
 allow gruntmaster_compile_t self : fifo_file { read write ioctl };
 allow gruntmaster_compile_t self:process signal;
 allow gruntmaster_compile_t urandom_device_t:chr_file read_file_perms;
@@ -110,3 +123,15 @@ allow gruntmaster_compile_t { bin_t lib_t } : file { execute execute_no_trans };
 libs_use_ld_so(gruntmaster_compile_t)
 libs_use_shared_libs(gruntmaster_compile_t)
 miscfiles_read_localization(gruntmaster_compile_t)
 libs_use_ld_so(gruntmaster_compile_t)
 libs_use_shared_libs(gruntmaster_compile_t)
 miscfiles_read_localization(gruntmaster_compile_t)
+
+# Page generator permissions
+domain_everything_files(gruntmaster_paged_t, httpd_sys_content_rw_t)
+domain_read_files(gruntmaster_paged_t, usr_t)
+domain_read_files(gruntmaster_paged_t, bin_t)
+allow gruntmaster_paged_t urandom_device_t:chr_file read_file_perms;
+allow gruntmaster_paged_t port_t:tcp_socket name_connect;
+allow gruntmaster_paged_t self:tcp_socket { read write create ioctl connect };
+
+libs_use_ld_so(gruntmaster_paged_t)
+libs_use_shared_libs(gruntmaster_paged_t)
+miscfiles_read_localization(gruntmaster_paged_t)
This page took 0.014646 seconds and 4 git commands to generate.