summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShrikant Bobade <shrikant_bobade@mentor.com>2016-08-29 19:06:47 +0530
committerJoe MacDonald <joe_macdonald@mentor.com>2016-09-01 14:30:46 -0400
commit2b022c1f4bd2369f7b66b764b2d16c7f19680e93 (patch)
tree5cdb9855cda5d9287dda4768b7a0b6548f973926
parent6cd54990a2428083dc87b53bd5e79a34f5864279 (diff)
downloadmeta-selinux-2b022c1f4bd2369f7b66b764b2d16c7f19680e93.tar.gz
refpolicy-minimum: systemd: mount: logging: authlogin: add allow rules
add allow rules for avc denails for systemd, mount, logging & authlogin modules. without this change we are getting avc. denials from these modules. Signed-off-by: Shrikant Bobade <shrikant_bobade@mentor.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--recipes-security/refpolicy/refpolicy-minimum/0003-refpolicy-minimum-systemd-mount-logging-authlogin-ad.patch93
-rw-r--r--recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb1
2 files changed, 94 insertions, 0 deletions
diff --git a/recipes-security/refpolicy/refpolicy-minimum/0003-refpolicy-minimum-systemd-mount-logging-authlogin-ad.patch b/recipes-security/refpolicy/refpolicy-minimum/0003-refpolicy-minimum-systemd-mount-logging-authlogin-ad.patch
new file mode 100644
index 0000000..35a8e1b
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy-minimum/0003-refpolicy-minimum-systemd-mount-logging-authlogin-ad.patch
@@ -0,0 +1,93 @@
1From edae03ea521a501a2b3229383609f1aec85575c1 Mon Sep 17 00:00:00 2001
2From: Shrikant Bobade <shrikant_bobade@mentor.com>
3Date: Fri, 26 Aug 2016 17:53:37 +0530
4Subject: [PATCH 3/9] refpolicy-minimum: systemd: mount: logging: authlogin:
5 add allow rules
6
7add allow rules for avc denails for systemd, mount, logging & authlogin
8modules.
9
10without this change we are getting avc denial like these:
11
12type=AVC msg=audit(): avc: denied { sendto } for pid=893 comm="systemd-
13tmpfile" path="/run/systemd/journal/socket" scontext=system_u:system_r:
14systemd_tmpfiles_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=
15unix_dgram_socket permissive=0
16
17type=AVC msg=audit(): avc: denied { open } for pid=703 comm="systemd-
18tmpfile" path="/proc/1/environ" dev="proc" ino=8841 scontext=system_u:
19system_r:systemd_tmpfiles_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=
20file permissive=0
21
22type=AVC msg=audit(): avc: denied { read write } for pid=486 comm="mount"
23path="socket:[9717]" dev="sockfs" ino=9717 scontext=system_u:system_r:
24mount_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=udp_socket
25
26type=AVC msg=audit(): avc: denied { unix_read unix_write } for pid=292
27comm="syslogd" key=1095648583 scontext=system_u:system_r:syslogd_t:s0
28tcontext=system_u:system_r:syslogd_t:s0 tclass=shm permissive=1
29
30Upstream-Status: Pending
31
32Signed-off-by: Shrikant Bobade <shrikant_bobade@mentor.com>
33---
34 policy/modules/system/authlogin.te | 2 ++
35 policy/modules/system/logging.te | 7 ++++++-
36 policy/modules/system/mount.te | 3 +++
37 policy/modules/system/systemd.te | 6 ++++++
38 4 files changed, 17 insertions(+), 1 deletion(-)
39
40diff --git a/policy/modules/system/authlogin.te b/policy/modules/system/authlogin.te
41index f80dfcb..5fab54a 100644
42--- a/policy/modules/system/authlogin.te
43+++ b/policy/modules/system/authlogin.te
44@@ -464,3 +464,5 @@ optional_policy(`
45 samba_read_var_files(nsswitch_domain)
46 samba_dontaudit_write_var_files(nsswitch_domain)
47 ')
48+
49+allow chkpwd_t proc_t:filesystem getattr;
50diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
51index fdf86ef..107db03 100644
52--- a/policy/modules/system/logging.te
53+++ b/policy/modules/system/logging.te
54@@ -576,4 +576,9 @@ allow auditd_t tmpfs_t:file { getattr setattr create open read append };
55 allow auditd_t tmpfs_t:dir { open read search add_name write getattr search };
56 allow auditd_t initrc_t:unix_dgram_socket sendto;
57
58-allow klogd_t initrc_t:unix_dgram_socket sendto;
59\ No newline at end of file
60+allow klogd_t initrc_t:unix_dgram_socket sendto;
61+
62+allow syslogd_t self:shm create;
63+allow syslogd_t self:sem { create read unix_write write };
64+allow syslogd_t self:shm { read unix_read unix_write write };
65+allow syslogd_t tmpfs_t:file { read write };
66diff --git a/policy/modules/system/mount.te b/policy/modules/system/mount.te
67index 1c2fc33..b699309 100644
68--- a/policy/modules/system/mount.te
69+++ b/policy/modules/system/mount.te
70@@ -229,3 +229,6 @@ optional_policy(`
71 files_etc_filetrans_etc_runtime(unconfined_mount_t, file)
72 unconfined_domain(unconfined_mount_t)
73 ')
74+
75+allow mount_t proc_t:filesystem getattr;
76+allow mount_t initrc_t:udp_socket { read write };
77diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
78index fdb9fef..734d455 100644
79--- a/policy/modules/system/systemd.te
80+++ b/policy/modules/system/systemd.te
81@@ -262,3 +262,9 @@ tunable_policy(`systemd_tmpfiles_manage_all',`
82 files_relabel_non_security_dirs(systemd_tmpfiles_t)
83 files_relabel_non_security_files(systemd_tmpfiles_t)
84 ')
85+
86+allow systemd_tmpfiles_t init_t:dir search;
87+allow systemd_tmpfiles_t proc_t:filesystem getattr;
88+allow systemd_tmpfiles_t init_t:file read;
89+allow systemd_tmpfiles_t initrc_t:unix_dgram_socket sendto;
90+allow systemd_tmpfiles_t self:capability net_admin;
91--
921.9.1
93
diff --git a/recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb b/recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb
index 9e1dc9b..f4b80bc 100644
--- a/recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb
+++ b/recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb
@@ -74,4 +74,5 @@ SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' ${SYSTEMD_REFPO
74SYSTEMD_REFPOLICY_PATCHES = " \ 74SYSTEMD_REFPOLICY_PATCHES = " \
75 file://0001-refpolicy-minimum-systemd-unconfined-lib-add-systemd.patch \ 75 file://0001-refpolicy-minimum-systemd-unconfined-lib-add-systemd.patch \
76 file://0002-refpolicy-minimum-audit-logging-getty-audit-related-.patch \ 76 file://0002-refpolicy-minimum-audit-logging-getty-audit-related-.patch \
77 file://0003-refpolicy-minimum-systemd-mount-logging-authlogin-ad.patch \
77 " 78 "