2020-04-21 15:03:01 +00:00
|
|
|
policy_module(unconfined, 3.14.1)
|
2005-07-05 20:59:51 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
# usage in this module of types created by these
|
|
|
|
# calls is not correct, however we dont currently
|
|
|
|
# have another method to add access to these types
|
|
|
|
userdom_base_user_template(unconfined)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_manage_home_role(unconfined_r, unconfined_t)
|
|
|
|
userdom_manage_tmp_role(unconfined_r, unconfined_t)
|
|
|
|
userdom_manage_tmpfs_role(unconfined_r, unconfined_t)
|
2007-10-02 16:04:50 +00:00
|
|
|
|
2005-07-05 20:59:51 +00:00
|
|
|
type unconfined_exec_t;
|
2007-10-02 16:04:50 +00:00
|
|
|
init_system_domain(unconfined_t, unconfined_exec_t)
|
2006-06-07 17:43:10 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
type unconfined_execmem_t;
|
|
|
|
type unconfined_execmem_exec_t;
|
|
|
|
init_system_domain(unconfined_execmem_t, unconfined_execmem_exec_t)
|
|
|
|
role unconfined_r types unconfined_execmem_t;
|
2005-07-05 20:59:51 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
domtrans_pattern(unconfined_t, unconfined_execmem_exec_t, unconfined_execmem_t)
|
|
|
|
|
|
|
|
files_create_boot_flag(unconfined_t)
|
|
|
|
|
|
|
|
mcs_killall(unconfined_t)
|
|
|
|
mcs_ptrace_all(unconfined_t)
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
libs_run_ldconfig(unconfined_t, unconfined_r)
|
2005-07-08 20:44:57 +00:00
|
|
|
|
2005-07-05 20:59:51 +00:00
|
|
|
logging_send_syslog_msg(unconfined_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
logging_run_auditctl(unconfined_t, unconfined_r)
|
2005-07-05 20:59:51 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
mount_run_unconfined(unconfined_t, unconfined_r)
|
2005-07-06 20:28:29 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
seutil_run_setfiles(unconfined_t, unconfined_r)
|
|
|
|
seutil_run_semanage(unconfined_t, unconfined_r)
|
2006-06-07 17:43:10 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
unconfined_domain(unconfined_t)
|
2005-11-09 15:51:22 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_user_home_dir_filetrans_user_home_content(unconfined_t, { dir file lnk_file fifo_file sock_file })
|
2006-12-04 20:10:56 +00:00
|
|
|
|
2014-01-15 15:13:18 +00:00
|
|
|
ifdef(`direct_sysadm_daemon',`
|
|
|
|
optional_policy(`
|
|
|
|
init_run_daemon(unconfined_t, unconfined_r)
|
|
|
|
')
|
|
|
|
',`
|
|
|
|
ifdef(`distro_gentoo',`
|
|
|
|
seutil_run_runinit(unconfined_t, unconfined_r)
|
|
|
|
seutil_init_script_run_runinit(unconfined_t, unconfined_r)
|
|
|
|
')
|
2008-05-27 12:07:03 +00:00
|
|
|
')
|
|
|
|
|
2018-11-11 12:33:28 +00:00
|
|
|
ifdef(`init_systemd',`
|
2019-01-19 12:04:44 +00:00
|
|
|
# for systemd-analyze
|
|
|
|
init_service_status(unconfined_t)
|
2019-04-19 15:50:59 +00:00
|
|
|
# for systemd --user:
|
2019-11-22 21:39:35 +00:00
|
|
|
init_pgm_spec_user_daemon_domain(unconfined_t)
|
2019-01-19 12:04:44 +00:00
|
|
|
|
2018-11-11 12:33:28 +00:00
|
|
|
optional_policy(`
|
|
|
|
systemd_dbus_chat_resolved(unconfined_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
ada_domtrans(unconfined_t)
|
|
|
|
')
|
2005-07-08 20:44:57 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
apache_run_helper(unconfined_t, unconfined_r)
|
|
|
|
apache_role(unconfined_r, unconfined_t)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2005-10-27 15:06:15 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
bind_run_ndc(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2005-10-27 15:06:15 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
bootloader_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2006-04-19 15:25:22 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
cron_unconfined_role(unconfined_r, unconfined_t)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2005-10-27 15:06:15 +00:00
|
|
|
|
2014-01-11 14:23:22 +00:00
|
|
|
optional_policy(`
|
2019-01-23 23:28:51 +00:00
|
|
|
dpkg_nnp_domtrans(unconfined_t)
|
2014-01-11 14:23:22 +00:00
|
|
|
dpkg_run(unconfined_t, unconfined_r)
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
firstboot_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2006-02-20 16:31:54 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
ftp_run_ftpdctl(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2005-10-26 16:00:13 +00:00
|
|
|
|
hadoop 1/10 -- unconfined
On 10/04/2010 02:18 PM, Christopher J. PeBenito wrote:
> On 10/04/10 13:15, Paul Nuzzi wrote:
>> On 10/01/2010 01:56 PM, Christopher J. PeBenito wrote:
>>> On 10/01/10 11:17, Paul Nuzzi wrote:
>>>> On 10/01/2010 08:02 AM, Dominick Grift wrote:
>>>>> On Thu, Sep 30, 2010 at 03:39:40PM -0400, Paul Nuzzi wrote:
>>>>>> I updated the patch based on recommendations from the mailing list.
>>>>>> All of hadoop's services are included in one module instead of
>>>>>> individual ones. Unconfined and sysadm roles are given access to
>>>>>> hadoop and zookeeper client domain transitions. The services are started
>>>>>> using run_init. Let me know what you think.
>>>>>
>>>>> Why do some hadoop domain need to manage generic tmp?
>>>>>
>>>>> files_manage_generic_tmp_dirs(zookeeper_t)
>>>>> files_manage_generic_tmp_dirs(hadoop_t)
>>>>> files_manage_generic_tmp_dirs(hadoop_$1_initrc_t)
>>>>> files_manage_generic_tmp_files(hadoop_$1_initrc_t)
>>>>> files_manage_generic_tmp_files(hadoop_$1_t)
>>>>> files_manage_generic_tmp_dirs(hadoop_$1_t)
>>>>
>>>> This has to be done for Java JMX to work. All of the files are written to
>>>> /tmp/hsperfdata_(hadoop/zookeeper). /tmp/hsperfdata_ is labeled tmp_t while
>>>> all the files for each service are labeled with hadoop_*_tmp_t. The first service
>>>> will end up owning the directory if it is not labeled tmp_t.
>>>
>>> The hsperfdata dir in /tmp certainly the bane of policy writers. Based on a quick look through the policy, it looks like the only dir they create in /tmp is this hsperfdata dir. I suggest you do something like
>>>
>>> files_tmp_filetrans(hadoop_t, hadoop_hsperfdata_t, dir)
>>> files_tmp_filetrans(zookeeper_t, hadoop_hsperfdata_t, dir)
>>>
>>> filetrans_pattern(hadoop_t, hadoop_hsperfdata_t, hadoop_tmp_t, file)
>>> filetrans_pattern(zookeeper_t, hadoop_hsperfdata_t, zookeeper_tmp_t, file)
>>>
>>
>> That looks like a better way to handle the tmp_t problem.
>>
>> I changed the patch with your comments. Hopefully this will be one of the last updates.
>> Tested on a CDH3 cluster as a module without any problems.
>
> There are several little issues with style, but it'll be easier just to fix them when its committed.
>
> Other comments inline.
>
I did my best locking down the ports hadoop uses. Unfortunately the services use high, randomized ports making
tcp_connect_generic_port a must have. Hopefully one day hadoop will settle on static ports. I added hadoop_datanode port 50010 since it is important to lock down that service. I changed the patch based on the rest of the comments.
Signed-off-by: Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
2010-10-05 19:59:29 +00:00
|
|
|
optional_policy(`
|
2010-10-07 14:57:55 +00:00
|
|
|
hadoop_role(unconfined_r, unconfined_t)
|
hadoop 1/10 -- unconfined
On 10/04/2010 02:18 PM, Christopher J. PeBenito wrote:
> On 10/04/10 13:15, Paul Nuzzi wrote:
>> On 10/01/2010 01:56 PM, Christopher J. PeBenito wrote:
>>> On 10/01/10 11:17, Paul Nuzzi wrote:
>>>> On 10/01/2010 08:02 AM, Dominick Grift wrote:
>>>>> On Thu, Sep 30, 2010 at 03:39:40PM -0400, Paul Nuzzi wrote:
>>>>>> I updated the patch based on recommendations from the mailing list.
>>>>>> All of hadoop's services are included in one module instead of
>>>>>> individual ones. Unconfined and sysadm roles are given access to
>>>>>> hadoop and zookeeper client domain transitions. The services are started
>>>>>> using run_init. Let me know what you think.
>>>>>
>>>>> Why do some hadoop domain need to manage generic tmp?
>>>>>
>>>>> files_manage_generic_tmp_dirs(zookeeper_t)
>>>>> files_manage_generic_tmp_dirs(hadoop_t)
>>>>> files_manage_generic_tmp_dirs(hadoop_$1_initrc_t)
>>>>> files_manage_generic_tmp_files(hadoop_$1_initrc_t)
>>>>> files_manage_generic_tmp_files(hadoop_$1_t)
>>>>> files_manage_generic_tmp_dirs(hadoop_$1_t)
>>>>
>>>> This has to be done for Java JMX to work. All of the files are written to
>>>> /tmp/hsperfdata_(hadoop/zookeeper). /tmp/hsperfdata_ is labeled tmp_t while
>>>> all the files for each service are labeled with hadoop_*_tmp_t. The first service
>>>> will end up owning the directory if it is not labeled tmp_t.
>>>
>>> The hsperfdata dir in /tmp certainly the bane of policy writers. Based on a quick look through the policy, it looks like the only dir they create in /tmp is this hsperfdata dir. I suggest you do something like
>>>
>>> files_tmp_filetrans(hadoop_t, hadoop_hsperfdata_t, dir)
>>> files_tmp_filetrans(zookeeper_t, hadoop_hsperfdata_t, dir)
>>>
>>> filetrans_pattern(hadoop_t, hadoop_hsperfdata_t, hadoop_tmp_t, file)
>>> filetrans_pattern(zookeeper_t, hadoop_hsperfdata_t, zookeeper_tmp_t, file)
>>>
>>
>> That looks like a better way to handle the tmp_t problem.
>>
>> I changed the patch with your comments. Hopefully this will be one of the last updates.
>> Tested on a CDH3 cluster as a module without any problems.
>
> There are several little issues with style, but it'll be easier just to fix them when its committed.
>
> Other comments inline.
>
I did my best locking down the ports hadoop uses. Unfortunately the services use high, randomized ports making
tcp_connect_generic_port a must have. Hopefully one day hadoop will settle on static ports. I added hadoop_datanode port 50010 since it is important to lock down that service. I changed the patch based on the rest of the comments.
Signed-off-by: Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
2010-10-05 19:59:29 +00:00
|
|
|
')
|
|
|
|
|
2017-04-06 21:37:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
init_admin(unconfined_t)
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
inn_domtrans(unconfined_t)
|
|
|
|
')
|
2005-07-06 20:28:29 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2009-08-17 17:19:26 +00:00
|
|
|
java_run_unconfined(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2006-02-13 22:05:08 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
lpd_run_checkpc(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2006-09-28 14:37:29 +00:00
|
|
|
|
2014-05-10 14:45:24 +00:00
|
|
|
optional_policy(`
|
|
|
|
lvm_run(unconfined_t, unconfined_r)
|
|
|
|
')
|
|
|
|
|
2018-02-15 22:07:08 +00:00
|
|
|
optional_policy(`
|
|
|
|
modemmanager_dbus_chat(unconfined_t)
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2017-02-18 21:35:45 +00:00
|
|
|
modutils_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2006-05-17 14:50:31 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2017-04-19 01:41:45 +00:00
|
|
|
mono_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2005-10-27 15:06:15 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
mta_role(unconfined_r, unconfined_t)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2005-11-16 21:08:52 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
oddjob_domtrans_mkhomedir(unconfined_t)
|
|
|
|
')
|
2005-10-25 00:00:50 +00:00
|
|
|
|
2011-09-13 18:22:44 +00:00
|
|
|
optional_policy(`
|
|
|
|
portage_run(unconfined_t, unconfined_r)
|
|
|
|
portage_run_fetch(unconfined_t, unconfined_r)
|
2011-09-14 16:46:56 +00:00
|
|
|
portage_run_gcc_config(unconfined_t, unconfined_r)
|
2011-09-13 18:22:44 +00:00
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
prelink_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2005-10-26 13:51:33 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
portmap_run_helper(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2005-10-24 21:33:46 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
postfix_run_map(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
# cjp: this should probably be removed:
|
|
|
|
postfix_domtrans_master(unconfined_t)
|
|
|
|
')
|
2006-01-11 15:28:14 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
pyzor_role(unconfined_r, unconfined_t)
|
2008-08-29 12:50:31 +00:00
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
# cjp: this should probably be removed:
|
|
|
|
rpc_domtrans_nfsd(unconfined_t)
|
|
|
|
')
|
2005-11-09 15:51:22 +00:00
|
|
|
|
2013-09-24 13:39:11 +00:00
|
|
|
optional_policy(`
|
|
|
|
rtkit_scheduled(unconfined_t)
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
rpm_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2006-02-20 16:31:54 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
samba_run_net(unconfined_t, unconfined_r)
|
|
|
|
samba_run_winbind_helper(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2005-10-27 14:52:37 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
spamassassin_role(unconfined_r, unconfined_t)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
2006-02-06 22:47:46 +00:00
|
|
|
|
2016-08-21 07:06:32 +00:00
|
|
|
optional_policy(`
|
|
|
|
syncthing_role(unconfined_r, unconfined_t)
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
sysnet_run_dhcpc(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
sysnet_dbus_chat_dhcpc(unconfined_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
tzdata_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
|
|
|
|
2013-09-24 13:39:11 +00:00
|
|
|
optional_policy(`
|
|
|
|
unconfined_dbus_chat(unconfined_t)
|
|
|
|
')
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
usermanage_run_admin_passwd(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
vpn_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
webalizer_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2020-01-25 15:34:07 +00:00
|
|
|
wine_run(unconfined_t, unconfined_r)
|
2007-10-02 16:04:50 +00:00
|
|
|
')
|
|
|
|
|
2017-04-19 01:41:45 +00:00
|
|
|
optional_policy(`
|
|
|
|
xserver_role(unconfined_r, unconfined_t)
|
|
|
|
xserver_dbus_chat_xdm(unconfined_t)
|
|
|
|
')
|
|
|
|
|
2006-06-07 17:43:10 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Unconfined Execmem Local policy
|
|
|
|
#
|
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
allow unconfined_execmem_t self:process { execstack execmem };
|
|
|
|
unconfined_domain_noaudit(unconfined_execmem_t)
|
2006-08-29 02:41:00 +00:00
|
|
|
|
2007-10-02 16:04:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
unconfined_dbus_chat(unconfined_execmem_t)
|
2006-06-07 17:43:10 +00:00
|
|
|
')
|