SELinux-Refpolicy Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/5] Updates for RPM module
@ 2019-07-02 15:30 Sugar, David
  2019-07-02 15:30 ` [PATCH 1/5] grant rpm permission to map rpm_var_lib_t Sugar, David
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Sugar, David @ 2019-07-02 15:30 UTC (permalink / raw)
  To: selinux-refpolicy

A series of changes for the RPM module.  I reviewed the changes that are in the 
RedHat targeted policy while working on these patches to keep things as similar
as possible.


Dave Sugar (5):
  grant rpm permission to map rpm_var_lib_t
  grant permission for rpm to write to audit log
  grant rpm permissions on locale_t
  Allow rpm to map file contexts
  Allow rpm scripts to alter systemd services

 policy/modules/admin/rpm.te | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] grant rpm permission to map rpm_var_lib_t
  2019-07-02 15:30 [PATCH 0/5] Updates for RPM module Sugar, David
@ 2019-07-02 15:30 ` Sugar, David
  2019-07-09  0:39   ` Chris PeBenito
  2019-07-02 15:30 ` [PATCH 3/5] grant rpm permissions to map locale_t Sugar, David
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Sugar, David @ 2019-07-02 15:30 UTC (permalink / raw)
  To: selinux-refpolicy

type=AVC msg=audit(1560913896.432:218): avc:  denied  { map } for pid=1265 comm="rpm" path="/var/lib/rpm/__db.001" dev="dm-0" ino=2223 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=file permissive=1

Signed-off-by: Dave Sugar <dsugar@tresys.com>
---
 policy/modules/admin/rpm.te | 1 +
 1 file changed, 1 insertion(+)

diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
index e00b8ddd..0e6e9c03 100644
--- a/policy/modules/admin/rpm.te
+++ b/policy/modules/admin/rpm.te
@@ -111,6 +111,7 @@ files_lock_filetrans(rpm_t, rpm_lock_t, file)
 
 manage_dirs_pattern(rpm_t, rpm_var_lib_t, rpm_var_lib_t)
 manage_files_pattern(rpm_t, rpm_var_lib_t, rpm_var_lib_t)
+mmap_read_files_pattern(rpm_t, rpm_var_lib_t, rpm_var_lib_t)
 files_var_lib_filetrans(rpm_t, rpm_var_lib_t, { dir file })
 
 manage_dirs_pattern(rpm_t, rpm_var_run_t, rpm_var_run_t)
-- 
2.21.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/5] grant permission for rpm to write to audit log
  2019-07-02 15:30 [PATCH 0/5] Updates for RPM module Sugar, David
  2019-07-02 15:30 ` [PATCH 1/5] grant rpm permission to map rpm_var_lib_t Sugar, David
  2019-07-02 15:30 ` [PATCH 3/5] grant rpm permissions to map locale_t Sugar, David
@ 2019-07-02 15:30 ` Sugar, David
  2019-07-02 16:03   ` Dominick Grift
  2019-07-02 15:30 ` [PATCH 4/5] Allow rpm to map file contexts Sugar, David
  2019-07-02 15:30 ` [PATCH 5/5] Allow rpm scripts to alter systemd services Sugar, David
  4 siblings, 1 reply; 12+ messages in thread
From: Sugar, David @ 2019-07-02 15:30 UTC (permalink / raw)
  To: selinux-refpolicy

Messages like this are added to the audit log when an rpm is installed:
type=SOFTWARE_UPDATE msg=audit(1560913896.581:244): pid=1265 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:rpm_t:s0 msg='sw="ntpdate-4.2.6p5-25.el7_3.2.x86_64" sw_type=rpm key_enforce=0 gpg_res=0 root_dir="/" comm="rpm" exe="/usr/bin/rpm" hostname=? addr=?  terminal=? res=success'

These are the denials that I'm seeing:
type=AVC msg=audit(1560913896.581:243): avc:  denied  { audit_write } for  pid=1265 comm="rpm" capability=29 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=capability permissive=1

type=AVC msg=audit(1561298132.446:240): avc:  denied  { create } for pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
type=AVC msg=audit(1561298132.446:241): avc:  denied  { write } for pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
type=AVC msg=audit(1561298132.446:241): avc:  denied  { nlmsg_relay } for  pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
type=AVC msg=audit(1561298132.447:243): avc:  denied  { read } for pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1

Signed-off-by: Dave Sugar <dsugar@tresys.com>
---
 policy/modules/admin/rpm.te | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
index 0e6e9c03..a28a24d3 100644
--- a/policy/modules/admin/rpm.te
+++ b/policy/modules/admin/rpm.te
@@ -73,7 +73,7 @@ files_tmpfs_file(rpm_script_tmpfs_t)
 # rpm Local policy
 #
 
-allow rpm_t self:capability { chown dac_override fowner fsetid ipc_lock mknod setfcap setgid setuid sys_chroot sys_nice sys_tty_config };
+allow rpm_t self:capability { audit_write chown dac_override fowner fsetid ipc_lock mknod setfcap setgid setuid sys_chroot sys_nice sys_tty_config };
 allow rpm_t self:process { transition signal_perms getsched setsched getsession getpgid setpgid getcap setcap share getattr setexec setfscreate noatsecure siginh setrlimit rlimitinh dyntransition execmem setkeycreate setsockcreate getrlimit };
 allow rpm_t self:fd use;
 allow rpm_t self:fifo_file rw_fifo_file_perms;
@@ -87,6 +87,7 @@ allow rpm_t self:msgq create_msgq_perms;
 allow rpm_t self:msg { send receive };
 allow rpm_t self:file rw_file_perms;
 allow rpm_t self:netlink_kobject_uevent_socket create_socket_perms;
+allow rpm_t self:netlink_audit_socket { nlmsg_relay create_socket_perms };
 
 allow rpm_t rpm_log_t:file { append_file_perms create_file_perms setattr_file_perms };
 logging_log_filetrans(rpm_t, rpm_log_t, file)
-- 
2.21.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/5] grant rpm permissions to map locale_t
  2019-07-02 15:30 [PATCH 0/5] Updates for RPM module Sugar, David
  2019-07-02 15:30 ` [PATCH 1/5] grant rpm permission to map rpm_var_lib_t Sugar, David
@ 2019-07-02 15:30 ` Sugar, David
  2019-07-09  0:39   ` Chris PeBenito
  2019-07-02 15:30 ` [PATCH 2/5] grant permission for rpm to write to audit log Sugar, David
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Sugar, David @ 2019-07-02 15:30 UTC (permalink / raw)
  To: selinux-refpolicy

type=AVC msg=audit(1560913896.408:217): avc:  denied  { map } for pid=1265 comm="rpm" path="/usr/lib/locale/locale-archive" dev="dm-0" ino=24721 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:object_r:locale_t:s0 tclass=file permissive=1

Signed-off-by: Dave Sugar <dsugar@tresys.com>
---
 policy/modules/admin/rpm.te | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
index a28a24d3..7020276c 100644
--- a/policy/modules/admin/rpm.te
+++ b/policy/modules/admin/rpm.te
@@ -207,6 +207,8 @@ libs_run_ldconfig(rpm_t, rpm_roles)
 
 logging_send_syslog_msg(rpm_t)
 
+miscfiles_read_localization(rpm_t)
+
 seutil_manage_src_policy(rpm_t)
 seutil_manage_bin_policy(rpm_t)
 
-- 
2.21.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 4/5] Allow rpm to map file contexts
  2019-07-02 15:30 [PATCH 0/5] Updates for RPM module Sugar, David
                   ` (2 preceding siblings ...)
  2019-07-02 15:30 ` [PATCH 2/5] grant permission for rpm to write to audit log Sugar, David
@ 2019-07-02 15:30 ` Sugar, David
  2019-07-09  0:40   ` Chris PeBenito
  2019-07-02 15:30 ` [PATCH 5/5] Allow rpm scripts to alter systemd services Sugar, David
  4 siblings, 1 reply; 12+ messages in thread
From: Sugar, David @ 2019-07-02 15:30 UTC (permalink / raw)
  To: selinux-refpolicy

type=AVC msg=audit(1560944465.365:270): avc:  denied  { map } for pid=1265 comm="rpm" path="/etc/selinux/clip/contexts/files/file_contexts.bin" dev="dm-0" ino=44911 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:object_r:file_context_t:s0 tclass=file permissive=1

Signed-off-by: Dave Sugar <dsugar@tresys.com>
---
 policy/modules/admin/rpm.te | 1 +
 1 file changed, 1 insertion(+)

diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
index 7020276c..111fcb01 100644
--- a/policy/modules/admin/rpm.te
+++ b/policy/modules/admin/rpm.te
@@ -211,6 +211,7 @@ miscfiles_read_localization(rpm_t)
 
 seutil_manage_src_policy(rpm_t)
 seutil_manage_bin_policy(rpm_t)
+seutil_read_file_contexts(rpm_t)
 
 userdom_use_user_terminals(rpm_t)
 userdom_use_unpriv_users_fds(rpm_t)
-- 
2.21.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 5/5] Allow rpm scripts to alter systemd services
  2019-07-02 15:30 [PATCH 0/5] Updates for RPM module Sugar, David
                   ` (3 preceding siblings ...)
  2019-07-02 15:30 ` [PATCH 4/5] Allow rpm to map file contexts Sugar, David
@ 2019-07-02 15:30 ` Sugar, David
  2019-07-09  0:40   ` Chris PeBenito
  4 siblings, 1 reply; 12+ messages in thread
From: Sugar, David @ 2019-07-02 15:30 UTC (permalink / raw)
  To: selinux-refpolicy

In RPM scripts it is common to enable/start services that are being
installed.  This allows rpm_script_t to manage sysemd units

type=USER_AVC msg=audit(1561033935.758:283): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  denied  { enable } for auid=n/a uid=0 gid=0 path="/usr/lib/systemd/system/ntpdate.service" cmdline="systemctl preset ntpdate.service" scontext=system_u:system_r:rpm_script_t:s0 tcontext=system_u:object_r:ntpd_unit_t:s0 tclass=service exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'
type=USER_AVC msg=audit(1561033935.837:286): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  denied  { enable } for auid=n/a uid=0 gid=0 path="/usr/lib/systemd/system/ntpd.service" cmdline="systemctl preset ntpd.service" scontext=system_u:system_r:rpm_script_t:s0 tcontext=system_u:object_r:ntpd_unit_t:s0 tclass=service exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'

type=USER_AVC msg=audit(1561059114.937:239): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  denied  { reload } for auid=n/a uid=0 gid=0 cmdline="systemctl preset ntpdate.service" scontext=system_u:system_r:rpm_script_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=system exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'

Signed-off-by: Dave Sugar <dsugar@tresys.com>
---
 policy/modules/admin/rpm.te | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
index 111fcb01..c572c741 100644
--- a/policy/modules/admin/rpm.te
+++ b/policy/modules/admin/rpm.te
@@ -345,6 +345,8 @@ auth_dontaudit_getattr_shadow(rpm_script_t)
 auth_use_nsswitch(rpm_script_t)
 
 init_domtrans_script(rpm_script_t)
+init_manage_all_units(rpm_script_t)
+init_reload(rpm_script_t)
 init_telinit(rpm_script_t)
 
 libs_exec_ld_so(rpm_script_t)
-- 
2.21.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] grant permission for rpm to write to audit log
  2019-07-02 15:30 ` [PATCH 2/5] grant permission for rpm to write to audit log Sugar, David
@ 2019-07-02 16:03   ` Dominick Grift
  2019-07-02 17:40     ` Sugar, David
  0 siblings, 1 reply; 12+ messages in thread
From: Dominick Grift @ 2019-07-02 16:03 UTC (permalink / raw)
  To: Sugar, David; +Cc: selinux-refpolicy

[-- Attachment #1: Type: text/plain, Size: 3275 bytes --]

On Tue, Jul 02, 2019 at 03:30:30PM +0000, Sugar, David wrote:
> Messages like this are added to the audit log when an rpm is installed:
> type=SOFTWARE_UPDATE msg=audit(1560913896.581:244): pid=1265 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:rpm_t:s0 msg='sw="ntpdate-4.2.6p5-25.el7_3.2.x86_64" sw_type=rpm key_enforce=0 gpg_res=0 root_dir="/" comm="rpm" exe="/usr/bin/rpm" hostname=? addr=?  terminal=? res=success'
> 
> These are the denials that I'm seeing:
> type=AVC msg=audit(1560913896.581:243): avc:  denied  { audit_write } for  pid=1265 comm="rpm" capability=29 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=capability permissive=1
> 
> type=AVC msg=audit(1561298132.446:240): avc:  denied  { create } for pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
> type=AVC msg=audit(1561298132.446:241): avc:  denied  { write } for pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
> type=AVC msg=audit(1561298132.446:241): avc:  denied  { nlmsg_relay } for  pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
> type=AVC msg=audit(1561298132.447:243): avc:  denied  { read } for pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1

There is an interface for that: logging_send_audit_msgs(rpm_t)

> 
> Signed-off-by: Dave Sugar <dsugar@tresys.com>
> ---
>  policy/modules/admin/rpm.te | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
> index 0e6e9c03..a28a24d3 100644
> --- a/policy/modules/admin/rpm.te
> +++ b/policy/modules/admin/rpm.te
> @@ -73,7 +73,7 @@ files_tmpfs_file(rpm_script_tmpfs_t)
>  # rpm Local policy
>  #
>  
> -allow rpm_t self:capability { chown dac_override fowner fsetid ipc_lock mknod setfcap setgid setuid sys_chroot sys_nice sys_tty_config };
> +allow rpm_t self:capability { audit_write chown dac_override fowner fsetid ipc_lock mknod setfcap setgid setuid sys_chroot sys_nice sys_tty_config };
>  allow rpm_t self:process { transition signal_perms getsched setsched getsession getpgid setpgid getcap setcap share getattr setexec setfscreate noatsecure siginh setrlimit rlimitinh dyntransition execmem setkeycreate setsockcreate getrlimit };
>  allow rpm_t self:fd use;
>  allow rpm_t self:fifo_file rw_fifo_file_perms;
> @@ -87,6 +87,7 @@ allow rpm_t self:msgq create_msgq_perms;
>  allow rpm_t self:msg { send receive };
>  allow rpm_t self:file rw_file_perms;
>  allow rpm_t self:netlink_kobject_uevent_socket create_socket_perms;
> +allow rpm_t self:netlink_audit_socket { nlmsg_relay create_socket_perms };
>  
>  allow rpm_t rpm_log_t:file { append_file_perms create_file_perms setattr_file_perms };
>  logging_log_filetrans(rpm_t, rpm_log_t, file)
> -- 
> 2.21.0
> 

-- 
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] grant permission for rpm to write to audit log
  2019-07-02 16:03   ` Dominick Grift
@ 2019-07-02 17:40     ` Sugar, David
  0 siblings, 0 replies; 12+ messages in thread
From: Sugar, David @ 2019-07-02 17:40 UTC (permalink / raw)
  To: selinux-refpolicy



On 7/2/19 12:03 PM, Dominick Grift wrote:
> On Tue, Jul 02, 2019 at 03:30:30PM +0000, Sugar, David wrote:
>> Messages like this are added to the audit log when an rpm is installed:
>> type=SOFTWARE_UPDATE msg=audit(1560913896.581:244): pid=1265 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:rpm_t:s0 msg='sw="ntpdate-4.2.6p5-25.el7_3.2.x86_64" sw_type=rpm key_enforce=0 gpg_res=0 root_dir="/" comm="rpm" exe="/usr/bin/rpm" hostname=? addr=?  terminal=? res=success'
>>
>> These are the denials that I'm seeing:
>> type=AVC msg=audit(1560913896.581:243): avc:  denied  { audit_write } for  pid=1265 comm="rpm" capability=29 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=capability permissive=1
>>
>> type=AVC msg=audit(1561298132.446:240): avc:  denied  { create } for pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
>> type=AVC msg=audit(1561298132.446:241): avc:  denied  { write } for pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
>> type=AVC msg=audit(1561298132.446:241): avc:  denied  { nlmsg_relay } for  pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
>> type=AVC msg=audit(1561298132.447:243): avc:  denied  { read } for pid=1266 comm="rpm" scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:system_r:rpm_t:s0 tclass=netlink_audit_socket permissive=1
> 
> There is an interface for that: logging_send_audit_msgs(rpm_t)
> 

Good call, I missed that.  I will submit an updated patch shortly.

>>
>> Signed-off-by: Dave Sugar <dsugar@tresys.com>
>> ---
>>   policy/modules/admin/rpm.te | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
>> index 0e6e9c03..a28a24d3 100644
>> --- a/policy/modules/admin/rpm.te
>> +++ b/policy/modules/admin/rpm.te
>> @@ -73,7 +73,7 @@ files_tmpfs_file(rpm_script_tmpfs_t)
>>   # rpm Local policy
>>   #
>>   
>> -allow rpm_t self:capability { chown dac_override fowner fsetid ipc_lock mknod setfcap setgid setuid sys_chroot sys_nice sys_tty_config };
>> +allow rpm_t self:capability { audit_write chown dac_override fowner fsetid ipc_lock mknod setfcap setgid setuid sys_chroot sys_nice sys_tty_config };
>>   allow rpm_t self:process { transition signal_perms getsched setsched getsession getpgid setpgid getcap setcap share getattr setexec setfscreate noatsecure siginh setrlimit rlimitinh dyntransition execmem setkeycreate setsockcreate getrlimit };
>>   allow rpm_t self:fd use;
>>   allow rpm_t self:fifo_file rw_fifo_file_perms;
>> @@ -87,6 +87,7 @@ allow rpm_t self:msgq create_msgq_perms;
>>   allow rpm_t self:msg { send receive };
>>   allow rpm_t self:file rw_file_perms;
>>   allow rpm_t self:netlink_kobject_uevent_socket create_socket_perms;
>> +allow rpm_t self:netlink_audit_socket { nlmsg_relay create_socket_perms };
>>   
>>   allow rpm_t rpm_log_t:file { append_file_perms create_file_perms setattr_file_perms };
>>   logging_log_filetrans(rpm_t, rpm_log_t, file)
>> -- 
>> 2.21.0
>>
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] grant rpm permission to map rpm_var_lib_t
  2019-07-02 15:30 ` [PATCH 1/5] grant rpm permission to map rpm_var_lib_t Sugar, David
@ 2019-07-09  0:39   ` Chris PeBenito
  0 siblings, 0 replies; 12+ messages in thread
From: Chris PeBenito @ 2019-07-09  0:39 UTC (permalink / raw)
  To: Sugar, David, selinux-refpolicy

On 7/2/19 11:30 AM, Sugar, David wrote:
> type=AVC msg=audit(1560913896.432:218): avc:  denied  { map } for pid=1265 comm="rpm" path="/var/lib/rpm/__db.001" dev="dm-0" ino=2223 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=file permissive=1
> 
> Signed-off-by: Dave Sugar <dsugar@tresys.com>
> ---
>   policy/modules/admin/rpm.te | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
> index e00b8ddd..0e6e9c03 100644
> --- a/policy/modules/admin/rpm.te
> +++ b/policy/modules/admin/rpm.te
> @@ -111,6 +111,7 @@ files_lock_filetrans(rpm_t, rpm_lock_t, file)
>   
>   manage_dirs_pattern(rpm_t, rpm_var_lib_t, rpm_var_lib_t)
>   manage_files_pattern(rpm_t, rpm_var_lib_t, rpm_var_lib_t)
> +mmap_read_files_pattern(rpm_t, rpm_var_lib_t, rpm_var_lib_t)
>   files_var_lib_filetrans(rpm_t, rpm_var_lib_t, { dir file })
>   
>   manage_dirs_pattern(rpm_t, rpm_var_run_t, rpm_var_run_t)

Merged.

-- 
Chris PeBenito

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/5] grant rpm permissions to map locale_t
  2019-07-02 15:30 ` [PATCH 3/5] grant rpm permissions to map locale_t Sugar, David
@ 2019-07-09  0:39   ` Chris PeBenito
  0 siblings, 0 replies; 12+ messages in thread
From: Chris PeBenito @ 2019-07-09  0:39 UTC (permalink / raw)
  To: Sugar, David, selinux-refpolicy

On 7/2/19 11:30 AM, Sugar, David wrote:
> type=AVC msg=audit(1560913896.408:217): avc:  denied  { map } for pid=1265 comm="rpm" path="/usr/lib/locale/locale-archive" dev="dm-0" ino=24721 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:object_r:locale_t:s0 tclass=file permissive=1
> 
> Signed-off-by: Dave Sugar <dsugar@tresys.com>
> ---
>   policy/modules/admin/rpm.te | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
> index a28a24d3..7020276c 100644
> --- a/policy/modules/admin/rpm.te
> +++ b/policy/modules/admin/rpm.te
> @@ -207,6 +207,8 @@ libs_run_ldconfig(rpm_t, rpm_roles)
>   
>   logging_send_syslog_msg(rpm_t)
>   
> +miscfiles_read_localization(rpm_t)
> +
>   seutil_manage_src_policy(rpm_t)
>   seutil_manage_bin_policy(rpm_t)

Merged.

-- 
Chris PeBenito

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/5] Allow rpm to map file contexts
  2019-07-02 15:30 ` [PATCH 4/5] Allow rpm to map file contexts Sugar, David
@ 2019-07-09  0:40   ` Chris PeBenito
  0 siblings, 0 replies; 12+ messages in thread
From: Chris PeBenito @ 2019-07-09  0:40 UTC (permalink / raw)
  To: Sugar, David, selinux-refpolicy

On 7/2/19 11:30 AM, Sugar, David wrote:
> type=AVC msg=audit(1560944465.365:270): avc:  denied  { map } for pid=1265 comm="rpm" path="/etc/selinux/clip/contexts/files/file_contexts.bin" dev="dm-0" ino=44911 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:object_r:file_context_t:s0 tclass=file permissive=1
> 
> Signed-off-by: Dave Sugar <dsugar@tresys.com>
> ---
>   policy/modules/admin/rpm.te | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
> index 7020276c..111fcb01 100644
> --- a/policy/modules/admin/rpm.te
> +++ b/policy/modules/admin/rpm.te
> @@ -211,6 +211,7 @@ miscfiles_read_localization(rpm_t)
>   
>   seutil_manage_src_policy(rpm_t)
>   seutil_manage_bin_policy(rpm_t)
> +seutil_read_file_contexts(rpm_t)
>   
>   userdom_use_user_terminals(rpm_t)
>   userdom_use_unpriv_users_fds(rpm_t)

Merged.

-- 
Chris PeBenito

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] Allow rpm scripts to alter systemd services
  2019-07-02 15:30 ` [PATCH 5/5] Allow rpm scripts to alter systemd services Sugar, David
@ 2019-07-09  0:40   ` Chris PeBenito
  0 siblings, 0 replies; 12+ messages in thread
From: Chris PeBenito @ 2019-07-09  0:40 UTC (permalink / raw)
  To: Sugar, David, selinux-refpolicy

On 7/2/19 11:30 AM, Sugar, David wrote:
> In RPM scripts it is common to enable/start services that are being
> installed.  This allows rpm_script_t to manage sysemd units
> 
> type=USER_AVC msg=audit(1561033935.758:283): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  denied  { enable } for auid=n/a uid=0 gid=0 path="/usr/lib/systemd/system/ntpdate.service" cmdline="systemctl preset ntpdate.service" scontext=system_u:system_r:rpm_script_t:s0 tcontext=system_u:object_r:ntpd_unit_t:s0 tclass=service exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'
> type=USER_AVC msg=audit(1561033935.837:286): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  denied  { enable } for auid=n/a uid=0 gid=0 path="/usr/lib/systemd/system/ntpd.service" cmdline="systemctl preset ntpd.service" scontext=system_u:system_r:rpm_script_t:s0 tcontext=system_u:object_r:ntpd_unit_t:s0 tclass=service exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'
> 
> type=USER_AVC msg=audit(1561059114.937:239): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  denied  { reload } for auid=n/a uid=0 gid=0 cmdline="systemctl preset ntpdate.service" scontext=system_u:system_r:rpm_script_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=system exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?'
> 
> Signed-off-by: Dave Sugar <dsugar@tresys.com>
> ---
>   policy/modules/admin/rpm.te | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te
> index 111fcb01..c572c741 100644
> --- a/policy/modules/admin/rpm.te
> +++ b/policy/modules/admin/rpm.te
> @@ -345,6 +345,8 @@ auth_dontaudit_getattr_shadow(rpm_script_t)
>   auth_use_nsswitch(rpm_script_t)
>   
>   init_domtrans_script(rpm_script_t)
> +init_manage_all_units(rpm_script_t)
> +init_reload(rpm_script_t)
>   init_telinit(rpm_script_t)
>   
>   libs_exec_ld_so(rpm_script_t)

Merged.

-- 
Chris PeBenito

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, back to index

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-02 15:30 [PATCH 0/5] Updates for RPM module Sugar, David
2019-07-02 15:30 ` [PATCH 1/5] grant rpm permission to map rpm_var_lib_t Sugar, David
2019-07-09  0:39   ` Chris PeBenito
2019-07-02 15:30 ` [PATCH 3/5] grant rpm permissions to map locale_t Sugar, David
2019-07-09  0:39   ` Chris PeBenito
2019-07-02 15:30 ` [PATCH 2/5] grant permission for rpm to write to audit log Sugar, David
2019-07-02 16:03   ` Dominick Grift
2019-07-02 17:40     ` Sugar, David
2019-07-02 15:30 ` [PATCH 4/5] Allow rpm to map file contexts Sugar, David
2019-07-09  0:40   ` Chris PeBenito
2019-07-02 15:30 ` [PATCH 5/5] Allow rpm scripts to alter systemd services Sugar, David
2019-07-09  0:40   ` Chris PeBenito

SELinux-Refpolicy Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux-refpolicy/0 selinux-refpolicy/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux-refpolicy selinux-refpolicy/ https://lore.kernel.org/selinux-refpolicy \
		selinux-refpolicy@vger.kernel.org selinux-refpolicy@archiver.kernel.org
	public-inbox-index selinux-refpolicy


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux-refpolicy


AGPL code for this site: git clone https://public-inbox.org/ public-inbox