hadoop, roles: use user exec domain attribute

Signed-off-by: Kenton Groombridge <me@concord.sh>
This commit is contained in:
Kenton Groombridge 2021-08-08 12:52:17 -04:00
parent 77ed833ba2
commit 22f5be2547
4 changed files with 30 additions and 14 deletions

View File

@ -440,7 +440,7 @@ optional_policy(`
')
optional_policy(`
hadoop_role(sysadm_r, sysadm_t)
hadoop_role(sysadm, sysadm_t, sysadm_application_exec_domain, sysadm_r)
')
optional_policy(`

View File

@ -83,7 +83,7 @@ ifndef(`distro_redhat',`
')
optional_policy(`
hadoop_role(user_r, user_t)
hadoop_role(user, user_t, user_application_exec_domain, user_r)
')
optional_policy(`

View File

@ -94,37 +94,53 @@ template(`hadoop_domain_template',`
## <summary>
## Role access for hadoop.
## </summary>
## <param name="role">
## <param name="role_prefix">
## <summary>
## Role allowed access.
## The prefix of the user role (e.g., user
## is the prefix for user_r).
## </summary>
## </param>
## <param name="domain">
## <param name="user_domain">
## <summary>
## Domain allowed access.
## User domain for the role.
## </summary>
## </param>
## <param name="user_exec_domain">
## <summary>
## User exec domain for execute and transition access.
## </summary>
## </param>
## <param name="role">
## <summary>
## Role allowed access
## </summary>
## </param>
## <rolecap/>
#
interface(`hadoop_role',`
template(`hadoop_role',`
gen_require(`
attribute_role hadoop_roles, zookeeper_roles;
type hadoop_t, zookeeper_t, hadoop_home_t;
type hadoop_tmp_t, hadoop_hsperfdata_t, zookeeper_tmp_t;
')
hadoop_domtrans($2)
roleattribute $1 hadoop_roles;
hadoop_domtrans($3)
roleattribute $4 hadoop_roles;
hadoop_domtrans_zookeeper_client($2)
roleattribute $1 zookeeper_roles;
hadoop_domtrans_zookeeper_client($3)
roleattribute $4 zookeeper_roles;
allow $2 { hadoop_t zookeeper_t }:process { ptrace signal_perms };
ps_process_pattern($2, { hadoop_t zookeeper_t })
allow $3 { hadoop_t zookeeper_t }:process { ptrace signal_perms };
ps_process_pattern($3, { hadoop_t zookeeper_t })
allow $2 { hadoop_home_t hadoop_tmp_t hadoop_hsperfdata_t }:dir { manage_dir_perms relabel_dir_perms };
allow $2 { hadoop_home_t hadoop_tmp_t zookeeper_tmp_t }:file { manage_file_perms relabel_file_perms };
allow $2 hadoop_home_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
optional_policy(`
systemd_user_app_status($1, hadoop_t)
systemd_user_app_status($1, zookeeper_t)
')
')
########################################

View File

@ -101,7 +101,7 @@ optional_policy(`
')
optional_policy(`
hadoop_role(unconfined_r, unconfined_t)
hadoop_role(unconfined, unconfined_t, unconfined_application_exec_domain, unconfined_r)
')
optional_policy(`