new version of filetrans patch
PATCH 1/1 new version of filetrans patch
Name changes suggested by Dominick and some more additions.
policy/modules/system/authlogin.if +6 -1
@@ -713,13 +713,18 @@ interface(`auth_manage_shadow',` ## Domain allowed access. ## </summary> ## </param> +## <param name="name" optional="true"> +## <summary> +## The name of the object being created. +## </summary> +## </param> # interface(`auth_etc_filetrans_shadow',` gen_require(` type shadow_t; ') - files_etc_filetrans($1, shadow_t, file) + files_etc_filetrans($1, shadow_t, file, $2) ') #######################################
policy/modules/admin/dpkg.te +20 -0
@@ -276,6 +276,7 @@ term_use_all_terms(dpkg_script_t) files_manage_non_auth_files(dpkg_script_t) +auth_etc_filetrans_shadow(dpkg_script_t, "shadow.upwd-write") auth_manage_shadow(dpkg_script_t) init_all_labeled_script_domtrans(dpkg_script_t)
@@ -307,10 +308,20 @@ optional_policy(` ') optional_policy(` + aptcacher_filetrans_cache_dir(dpkg_script_t) + aptcacher_filetrans_conf_dir(dpkg_script_t) + aptcacher_filetrans_log_dir(dpkg_script_t) +') + +optional_policy(` bootloader_run(dpkg_script_t, dpkg_roles) ') optional_policy(` + clamav_filetrans_log(dpkg_script_t) +') + +optional_policy(` devicekit_dbus_chat_power(dpkg_script_t) ')
@@ -319,6 +330,10 @@ optional_policy(` ') optional_policy(` + milter_filetrans_spamass_state(dpkg_script_t) +') + +optional_policy(` modutils_run(dpkg_script_t, dpkg_roles) ')
@@ -327,6 +342,11 @@ optional_policy(` ') optional_policy(` + mysql_create_db_dir(dpkg_script_t) + mysql_create_log_dir(dpkg_script_t) +') + +optional_policy(` nis_use_ypbind(dpkg_script_t) ')
policy/modules/services/mysql.fc +2 -2
@@ -25,8 +25,8 @@ HOME_DIR/\.my\.cnf -- gen_context(system /var/lib/mysql(/.*)? gen_context(system_u:object_r:mysqld_db_t,s0) /var/lib/mysql/mysql.* -s gen_context(system_u:object_r:mysqld_runtime_t,s0) -/var/log/mariadb(/.*)? gen_context(system_u:object_r:mysqld_log_t,s0) -/var/log/mysql.* -- gen_context(system_u:object_r:mysqld_log_t,s0) +/var/log/mariadb(/.*)? gen_context(system_u:object_r:mysqld_log_t,s0) +/var/log/mysql(/.*)? gen_context(system_u:object_r:mysqld_log_t,s0) /run/mysqld.* gen_context(system_u:object_r:mysqld_runtime_t,s0) /run/mysqlmanager.* -- gen_context(system_u:object_r:mysqlmanagerd_runtime_t,s0)
policy/modules/services/mysql.if +38 -0
@@ -243,6 +243,24 @@ interface(`mysql_manage_db_files',` ######################################## ## <summary> +## create mysqld db dir. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`mysql_create_db_dir',` + gen_require(` + type mysqld_db_t; + ') + + files_var_lib_filetrans($1, mysqld_db_t, dir, "mysql") +') + +######################################## +## <summary> ## Create, read, write, and delete ## mysqld home files. ## </summary>
@@ -325,9 +343,29 @@ interface(`mysql_write_log',` ') logging_search_logs($1) + allow $1 mysqld_log_t:dir search_dir_perms; allow $1 mysqld_log_t:file write_file_perms; ') +######################################## +## <summary> +## create mysqld log dir. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`mysql_create_log_dir',` + gen_require(` + type mysqld_log_t; + ') + + logging_search_logs($1) + logging_log_filetrans($1, mysqld_log_t, dir, "mysql") +') + ###################################### ## <summary> ## Execute mysqld safe in the
policy/modules/services/clamav.if +36 -0
@@ -430,3 +430,39 @@ interface(`clamav_admin',` files_list_tmp($1) admin_pattern($1, { clamd_tmp_t clamscan_tmp_t }) ') + +######################################## +## <summary> +## specified domain creates /var/log/clamav/freshclam.log with correct type +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`clamav_filetrans_log',` + gen_require(` + type clamd_var_log_t, freshclam_var_log_t; + ') + + filetrans_pattern($1, clamd_var_log_t, freshclam_var_log_t, file, "freshclam.log") +') + +######################################## +## <summary> +## specified domain creates /run/clamav with correct type +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`clamav_filetrans_runtime_dir',` + gen_require(` + type clamd_runtime_t; + ') + + files_runtime_filetrans($1, clamd_runtime_t, dir, "clamav") +')
policy/modules/services/aptcacher.if +54 -0
57 lines not on this page · raw message
policy/modules/services/ftp.if +18 -0
@@ -189,3 +189,21 @@ interface(`ftp_admin',` ftp_run_ftpdctl($1, $2) ') + +######################################## +## <summary> +## create /run/pure-ftpd +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ftp_filetrans_pure_ftpd_runtime',` + gen_require(` + type ftpd_runtime_t; + ') + + files_runtime_filetrans($1, ftpd_runtime_t, dir, "pure-ftpd") +')
policy/modules/system/init.te +5 -0
@@ -1094,6 +1094,7 @@ optional_policy(` ') optional_policy(` + clamav_filetrans_runtime_dir(initrc_t) clamav_read_config(initrc_t) ')
@@ -1287,6 +1288,10 @@ optional_policy(` ') optional_policy(` + ftp_filetrans_pure_ftpd_runtime(initrc_t) +') + +optional_policy(` rpc_read_exports(initrc_t) ')
policy/modules/services/milter.if +18 -0
@@ -100,6 +100,24 @@ interface(`milter_manage_spamass_state', ######################################## ## <summary> +## create spamass milter state dir +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`milter_filetrans_spamass_state',` + gen_require(` + type spamass_milter_state_t; + ') + + files_var_lib_filetrans($1, spamass_milter_state_t, dir, "spamass-milter") +') + +######################################## +## <summary> ## Get the attributes of the spamassissin milter data dir. ## </summary> ## <param name="domain">
policy/modules/system/unconfined.te +1 -0
@@ -67,6 +67,7 @@ ifdef(`init_systemd',` optional_policy(` systemd_dbus_chat_resolved(unconfined_t) + systemd_filetrans_passwd_runtime_dirs(unconfined_t) ') ')
policy/modules/roles/sysadm.te +1 -0
@@ -99,6 +99,7 @@ ifdef(`init_systemd',` # LookupDynamicUserByUID on org.freedesktop.systemd1. init_dbus_chat(sysadm_t) + systemd_run_passwd_agent(sysadm_t, sysadm_r) systemd_watch_passwd_runtime_dirs(sysadm_t) ')
policy/modules/system/systemd.if +25 -0
@@ -623,6 +623,31 @@ interface(`systemd_use_passwd_agent_fds' allow systemd_passwd_agent_t $1:fd use; ') +######################################## +## <summary> +## allow systemd_passwd_agent to be run by admin +## </summary> +## <param name="domain"> +## <summary> +## Domain that runs it +## </summary> +## </param> +## <param name="role"> +## <summary> +## role that it runs in +## </summary> +## </param> +# +interface(`systemd_run_passwd_agent',` + gen_require(` + type systemd_passwd_agent_t, systemd_passwd_agent_exec_t; + ') + + domain_auto_transition_pattern($1, systemd_passwd_agent_exec_t, systemd_passwd_agent_t) + allow systemd_passwd_agent_t $1:fd use; + role $2 types systemd_passwd_agent_t; +') + ####################################### ## <summary> ## Allow a systemd_passwd_agent_t process to interact with a daemon
Quoted 6 lines · AEDT Chris PeBenito
Quoted 3 lines
Name changes suggested by Dominick and some more additions.
Signed-off-by Russell Coker <[email protected]>Merged, though I renamed some interfaces and dropped a block that didn't apply since it's so close to the merge window closing.
+interface(systemd_run_passwd_agent',
+ gen_require(`
+ type systemd_passwd_agent_t, systemd_passwd_agent_exec_t;
+ ')
+
+ domain_auto_transition_pattern($1, systemd_passwd_agent_exec_t,systemd_passwd_agent_t)
+ allow systemd_passwd_agent_t $1:fd use;
+ role $2 types systemd_passwd_agent_t;
+')
Why did you change the above to the below? It needs an auto trans.
interface(systemd_run_passwd_agent',
gen_require(`
type systemd_passwd_agent_t, systemd_passwd_agent_exec_t;
')
domtrans_pattern($1, systemd_passwd_agent_exec_t,
systemd_passwd_agent_t)
allow systemd_passwd_agent_t $1:fd use;
role $2 types systemd_passwd_agent_t;')
Signature · 2 lines
My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/
Quoted 1 line · AEDT Chris PeBenito
since it's so close to the merge window closing.
What about all the other patches I had sent?
Signature · 2 lines
My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/
Quoted 30 lines · Russell Coker
Quoted 6 lines · AEDT Chris PeBenito
Quoted 3 lines
Name changes suggested by Dominick and some more additions.
Signed-off-by Russell Coker <[email protected]>Merged, though I renamed some interfaces and dropped a block that didn't apply since it's so close to the merge window closing.
policy/modules/system/systemd.if +6
-0+interface(`systemd_run_passwd_agent',` + gen_require(` + type systemd_passwd_agent_t, systemd_passwd_agent_exec_t; + ') + + domain_auto_transition_pattern($1, systemd_passwd_agent_exec_t,
systemd_passwd_agent_t)policy/modules/system/systemd.if +3
-0+ allow systemd_passwd_agent_t $1:fd use; + role $2 types systemd_passwd_agent_t; +')Why did you change the above to the below? It needs an auto trans.
interface(
systemd_run_passwd_agent',gen_require(` type systemd_passwd_agent_t, systemd_passwd_agent_exec_t; ') domtrans_pattern($1, systemd_passwd_agent_exec_t, systemd_passwd_agent_t) allow systemd_passwd_agent_t $1:fd use; role $2 types systemd_passwd_agent_t;
Quoted 1 line
')
domtrans_pattern() is automatic.
Signature · 1 line
Chris PeBenito
Quoted 3 lines · Russell Coker
Name changes suggested by Dominick and some more additions.
Signed-off-by Russell Coker <[email protected]>
Merged, though I renamed some interfaces and dropped a block that didn't apply since it's so close to the merge window closing.
Quoted 399 lines
Index: refpolicy-2.20210130/policy/modules/system/authlogin.if
===================================================================policy/modules/system/authlogin.if +6
-1@@ -713,13 +713,18 @@ interface(`auth_manage_shadow',` ## Domain allowed access. ## </summary> ## </param> +## <param name="name" optional="true"> +## <summary> +## The name of the object being created. +## </summary> +## </param> # interface(`auth_etc_filetrans_shadow',` gen_require(` type shadow_t; ') - files_etc_filetrans($1, shadow_t, file) + files_etc_filetrans($1, shadow_t, file, $2) ') #######################################Index: refpolicy-2.20210130/policy/modules/admin/dpkg.te
===================================================================policy/modules/admin/dpkg.te +20
-0@@ -276,6 +276,7 @@ term_use_all_terms(dpkg_script_t) files_manage_non_auth_files(dpkg_script_t) +auth_etc_filetrans_shadow(dpkg_script_t, "shadow.upwd-write") auth_manage_shadow(dpkg_script_t) init_all_labeled_script_domtrans(dpkg_script_t)@@ -307,10 +308,20 @@ optional_policy(` ') optional_policy(` + aptcacher_filetrans_cache_dir(dpkg_script_t) + aptcacher_filetrans_conf_dir(dpkg_script_t) + aptcacher_filetrans_log_dir(dpkg_script_t) +') + +optional_policy(` bootloader_run(dpkg_script_t, dpkg_roles) ') optional_policy(` + clamav_filetrans_log(dpkg_script_t) +') + +optional_policy(` devicekit_dbus_chat_power(dpkg_script_t) ')@@ -319,6 +330,10 @@ optional_policy(` ') optional_policy(` + milter_filetrans_spamass_state(dpkg_script_t) +') + +optional_policy(` modutils_run(dpkg_script_t, dpkg_roles) ')@@ -327,6 +342,11 @@ optional_policy(` ') optional_policy(` + mysql_create_db_dir(dpkg_script_t) + mysql_create_log_dir(dpkg_script_t) +') + +optional_policy(` nis_use_ypbind(dpkg_script_t) ')Index: refpolicy-2.20210130/policy/modules/services/mysql.fc
===================================================================policy/modules/services/mysql.fc +2
-2@@ -25,8 +25,8 @@ HOME_DIR/\.my\.cnf -- gen_context(system /var/lib/mysql(/.*)? gen_context(system_u:object_r:mysqld_db_t,s0) /var/lib/mysql/mysql.* -s gen_context(system_u:object_r:mysqld_runtime_t,s0) -/var/log/mariadb(/.*)? gen_context(system_u:object_r:mysqld_log_t,s0) -/var/log/mysql.* -- gen_context(system_u:object_r:mysqld_log_t,s0) +/var/log/mariadb(/.*)? gen_context(system_u:object_r:mysqld_log_t,s0) +/var/log/mysql(/.*)? gen_context(system_u:object_r:mysqld_log_t,s0) /run/mysqld.* gen_context(system_u:object_r:mysqld_runtime_t,s0) /run/mysqlmanager.* -- gen_context(system_u:object_r:mysqlmanagerd_runtime_t,s0)Index: refpolicy-2.20210130/policy/modules/services/mysql.if
===================================================================policy/modules/services/mysql.if +38
-0@@ -243,6 +243,24 @@ interface(`mysql_manage_db_files',` ######################################## ## <summary> +## create mysqld db dir. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`mysql_create_db_dir',` + gen_require(` + type mysqld_db_t; + ') + + files_var_lib_filetrans($1, mysqld_db_t, dir, "mysql") +') + +######################################## +## <summary> ## Create, read, write, and delete ## mysqld home files. ## </summary>@@ -325,9 +343,29 @@ interface(`mysql_write_log',` ') logging_search_logs($1) + allow $1 mysqld_log_t:dir search_dir_perms; allow $1 mysqld_log_t:file write_file_perms; ') +######################################## +## <summary> +## create mysqld log dir. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`mysql_create_log_dir',` + gen_require(` + type mysqld_log_t; + ') + + logging_search_logs($1) + logging_log_filetrans($1, mysqld_log_t, dir, "mysql") +') + ###################################### ## <summary> ## Execute mysqld safe in theIndex: refpolicy-2.20210130/policy/modules/services/clamav.if
===================================================================policy/modules/services/clamav.if +36
-0@@ -430,3 +430,39 @@ interface(`clamav_admin',` files_list_tmp($1) admin_pattern($1, { clamd_tmp_t clamscan_tmp_t }) ') + +######################################## +## <summary> +## specified domain creates /var/log/clamav/freshclam.log with correct type +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`clamav_filetrans_log',` + gen_require(` + type clamd_var_log_t, freshclam_var_log_t; + ') + + filetrans_pattern($1, clamd_var_log_t, freshclam_var_log_t, file, "freshclam.log") +') + +######################################## +## <summary> +## specified domain creates /run/clamav with correct type +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`clamav_filetrans_runtime_dir',` + gen_require(` + type clamd_runtime_t; + ') + + files_runtime_filetrans($1, clamd_runtime_t, dir, "clamav") +')Index: refpolicy-2.20210130/policy/modules/services/aptcacher.if
===================================================================policy/modules/services/aptcacher.if +54
-0@@ -63,3 +63,57 @@ interface(`aptcacher_stream_connect',` files_search_runtime($1) stream_connect_pattern($1, aptcacher_runtime_t, aptcacher_runtime_t, aptcacher_t) ') + +######################################## +## <summary> +## create /var/log/apt-cacher-ng +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`aptcacher_filetrans_log_dir',` + gen_require(` + type aptcacher_log_t; + ') + + logging_log_filetrans($1, aptcacher_log_t, dir, "apt-cacher-ng") +') + +######################################## +## <summary> +## create /var/cache/apt-cacher-ng +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`aptcacher_filetrans_cache_dir',` + gen_require(` + type aptcacher_cache_t; + ') + + files_var_filetrans($1, aptcacher_cache_t, dir, "apt-cacher-ng") +') + +######################################## +## <summary> +## create /etc/apt-cacher-ng +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`aptcacher_filetrans_conf_dir',` + gen_require(` + type aptcacher_conf_t; + ') + + files_etc_filetrans($1, aptcacher_conf_t, dir, "apt-cacher-ng") +')Index: refpolicy-2.20210130/policy/modules/services/ftp.if
===================================================================policy/modules/services/ftp.if +18
-0@@ -189,3 +189,21 @@ interface(`ftp_admin',` ftp_run_ftpdctl($1, $2) ') + +######################################## +## <summary> +## create /run/pure-ftpd +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ftp_filetrans_pure_ftpd_runtime',` + gen_require(` + type ftpd_runtime_t; + ') + + files_runtime_filetrans($1, ftpd_runtime_t, dir, "pure-ftpd") +')Index: refpolicy-2.20210130/policy/modules/system/init.te
===================================================================policy/modules/system/init.te +5
-0@@ -1094,6 +1094,7 @@ optional_policy(` ') optional_policy(` + clamav_filetrans_runtime_dir(initrc_t) clamav_read_config(initrc_t) ')@@ -1287,6 +1288,10 @@ optional_policy(` ') optional_policy(` + ftp_filetrans_pure_ftpd_runtime(initrc_t) +') + +optional_policy(` rpc_read_exports(initrc_t) ')Index: refpolicy-2.20210130/policy/modules/services/milter.if
===================================================================policy/modules/services/milter.if +18
-0@@ -100,6 +100,24 @@ interface(`milter_manage_spamass_state', ######################################## ## <summary> +## create spamass milter state dir +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`milter_filetrans_spamass_state',` + gen_require(` + type spamass_milter_state_t; + ') + + files_var_lib_filetrans($1, spamass_milter_state_t, dir, "spamass-milter") +') + +######################################## +## <summary> ## Get the attributes of the spamassissin milter data dir. ## </summary> ## <param name="domain">Index: refpolicy-2.20210130/policy/modules/system/unconfined.te
===================================================================policy/modules/system/unconfined.te +1
-0@@ -67,6 +67,7 @@ ifdef(`init_systemd',` optional_policy(` systemd_dbus_chat_resolved(unconfined_t) + systemd_filetrans_passwd_runtime_dirs(unconfined_t) ') ')Index: refpolicy-2.20210130/policy/modules/roles/sysadm.te
===================================================================policy/modules/roles/sysadm.te +1
-0@@ -99,6 +99,7 @@ ifdef(`init_systemd',` # LookupDynamicUserByUID on org.freedesktop.systemd1. init_dbus_chat(sysadm_t) + systemd_run_passwd_agent(sysadm_t, sysadm_r) systemd_watch_passwd_runtime_dirs(sysadm_t) ')Index: refpolicy-2.20210130/policy/modules/system/systemd.if
===================================================================policy/modules/system/systemd.if +25
-0@@ -623,6 +623,31 @@ interface(`systemd_use_passwd_agent_fds' allow systemd_passwd_agent_t $1:fd use; ') +######################################## +## <summary> +## allow systemd_passwd_agent to be run by admin +## </summary> +## <param name="domain"> +## <summary> +## Domain that runs it +## </summary> +## </param> +## <param name="role"> +## <summary> +## role that it runs in +## </summary> +## </param> +# +interface(`systemd_run_passwd_agent',` + gen_require(` + type systemd_passwd_agent_t, systemd_passwd_agent_exec_t; + ') + + domain_auto_transition_pattern($1, systemd_passwd_agent_exec_t, systemd_passwd_agent_t) + allow systemd_passwd_agent_t $1:fd use; + role $2 types systemd_passwd_agent_t; +') + ####################################### ## <summary> ## Allow a systemd_passwd_agent_t process to interact with a daemon
Signature · 1 line
Chris PeBenito