diff options
author | Shrikant Bobade <shrikant_bobade@mentor.com> | 2016-08-29 19:06:33 +0530 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2016-09-01 14:30:46 -0400 |
commit | 6cd54990a2428083dc87b53bd5e79a34f5864279 (patch) | |
tree | 45184ae05f75754f23de3f3705a91417a8c9fc62 | |
parent | 34ab910f6414ff6eb8495bc6c727f0808e5bd8f8 (diff) | |
download | meta-selinux-6cd54990a2428083dc87b53bd5e79a34f5864279.tar.gz |
refpolicy-minimum: audit: logging: getty: audit related allow rules
add allow rules for audit.log file & resolve dependent avc denials.
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/0002-refpolicy-minimum-audit-logging-getty-audit-related-.patch | 67 | ||||
-rw-r--r-- | recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb | 1 |
2 files changed, 68 insertions, 0 deletions
diff --git a/recipes-security/refpolicy/refpolicy-minimum/0002-refpolicy-minimum-audit-logging-getty-audit-related-.patch b/recipes-security/refpolicy/refpolicy-minimum/0002-refpolicy-minimum-audit-logging-getty-audit-related-.patch new file mode 100644 index 0000000..23bc397 --- /dev/null +++ b/recipes-security/refpolicy/refpolicy-minimum/0002-refpolicy-minimum-audit-logging-getty-audit-related-.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From edbc234baecfbf5b8e2dbadc976750071d5e7f7f Mon Sep 17 00:00:00 2001 | ||
2 | From: Shrikant Bobade <shrikant_bobade@mentor.com> | ||
3 | Date: Fri, 26 Aug 2016 17:51:44 +0530 | ||
4 | Subject: [PATCH 2/9] refpolicy-minimum: audit: logging: getty: audit related | ||
5 | allow rules | ||
6 | |||
7 | add allow rules for audit.log file & resolve dependent avc denials. | ||
8 | |||
9 | without this change we are getting audit avc denials mixed into bootlog & | ||
10 | audit other avc denials. | ||
11 | |||
12 | audit: type=1400 audit(): avc: denied { getattr } for pid=217 comm="mount" | ||
13 | name="/" dev="proc" ino=1 scontext=system_u:system_r:mount_t:s0 tcontext=system_0 | ||
14 | audit: type=1400 audit(): avc: denied { sendto } for pid=310 comm="klogd" | ||
15 | path="/run/systemd/journal/dev-log" scontext=sy0 | ||
16 | audit: type=1400 audit(): avc: denied { sendto } for pid=310 comm="klogd" | ||
17 | path="/run/systemd/journal/dev-log" scontext=system_u:system_r:klogd_t:s0 | ||
18 | audit(): avc: denied { open } for pid=540 comm="agetty" path="/var/ | ||
19 | volatile/log/wtmp" dev="tmpfs" ino=9536 scontext=system_u:system_r:getty_t | ||
20 | :s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=0 | ||
21 | |||
22 | Upstream-Status: Pending | ||
23 | |||
24 | Signed-off-by: Shrikant Bobade <shrikant_bobade@mentor.com> | ||
25 | --- | ||
26 | policy/modules/system/getty.te | 3 +++ | ||
27 | policy/modules/system/logging.te | 8 ++++++++ | ||
28 | 2 files changed, 11 insertions(+) | ||
29 | |||
30 | diff --git a/policy/modules/system/getty.te b/policy/modules/system/getty.te | ||
31 | index f6743ea..84eaf77 100644 | ||
32 | --- a/policy/modules/system/getty.te | ||
33 | +++ b/policy/modules/system/getty.te | ||
34 | @@ -139,3 +139,6 @@ optional_policy(` | ||
35 | optional_policy(` | ||
36 | udev_read_db(getty_t) | ||
37 | ') | ||
38 | + | ||
39 | +allow getty_t tmpfs_t:dir search; | ||
40 | +allow getty_t tmpfs_t:file { open write lock }; | ||
41 | diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te | ||
42 | index 9b18aad..fdf86ef 100644 | ||
43 | --- a/policy/modules/system/logging.te | ||
44 | +++ b/policy/modules/system/logging.te | ||
45 | @@ -238,6 +238,7 @@ allow audisp_t self:unix_stream_socket create_stream_socket_perms; | ||
46 | allow audisp_t self:unix_dgram_socket create_socket_perms; | ||
47 | |||
48 | allow audisp_t auditd_t:unix_stream_socket rw_socket_perms; | ||
49 | +allow audisp_t initrc_t:unix_dgram_socket sendto; | ||
50 | |||
51 | manage_sock_files_pattern(audisp_t, audisp_var_run_t, audisp_var_run_t) | ||
52 | files_pid_filetrans(audisp_t, audisp_var_run_t, sock_file) | ||
53 | @@ -569,3 +570,10 @@ optional_policy(` | ||
54 | # log to the xconsole | ||
55 | xserver_rw_console(syslogd_t) | ||
56 | ') | ||
57 | + | ||
58 | + | ||
59 | +allow auditd_t tmpfs_t:file { getattr setattr create open read append }; | ||
60 | +allow auditd_t tmpfs_t:dir { open read search add_name write getattr search }; | ||
61 | +allow auditd_t initrc_t:unix_dgram_socket sendto; | ||
62 | + | ||
63 | +allow klogd_t initrc_t:unix_dgram_socket sendto; | ||
64 | \ No newline at end of file | ||
65 | -- | ||
66 | 1.9.1 | ||
67 | |||
diff --git a/recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb b/recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb index 16592e5..9e1dc9b 100644 --- a/recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb +++ b/recipes-security/refpolicy/refpolicy-minimum_2.20151208.bb | |||
@@ -73,4 +73,5 @@ SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' ${SYSTEMD_REFPO | |||
73 | 73 | ||
74 | SYSTEMD_REFPOLICY_PATCHES = " \ | 74 | SYSTEMD_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 | " | 77 | " |