Skip to contentSkip to conversation

Add interface to get status of rsyslog service

PATCH In review Sugar, David 2 participants 4 messages Feb 20, 2019 – Feb 21, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add interface to get status of rsyslog service

Updated based on feedback.

---
 policy/modules/system/logging.if | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
policy/modules/system/logging.if +19 -0
index 16091eb6..c86c4bd9 100644
@@ -427,6 +427,25 @@ interface(`logging_domtrans_syslog',`
 	')
 ')
 
+########################################
+## <summary>
+##	Allow specified domain to check status of syslog unit
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`logging_status_syslog',`
+	gen_require(`
+		type syslogd_unit_t;
+		class service status;
+	')
+
+	allow $1 syslogd_unit_t:service status;
+')
+
 ########################################
 ## <summary>
 ##	Set the attributes of syslog temporary files.
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/1 New interface to dontaudit access to cert_t

I'm seeing a bunch of denials for various processes (some refpolicy domains, some my own application domains) attempting to access /etc/pki. They seem to be working OK even with the denial. The tunable authlogin_nsswitch_use_ldap controls access to cert_t (for domains that are part of nsswitch_domain attribute). Use this new interface when that tunable is off to quiet the denials.

---
 policy/modules/system/authlogin.te |  2 ++
 policy/modules/system/miscfiles.if | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)
policy/modules/system/authlogin.te +2 -0
index 345e07f3..a98054c5 100644
@@ -431,6 +431,8 @@ sysnet_dns_name_resolve(nsswitch_domain)
 tunable_policy(`authlogin_nsswitch_use_ldap',`
 	miscfiles_read_generic_certs(nsswitch_domain)
 	sysnet_use_ldap(nsswitch_domain)
+',`
+	miscfiles_dontaudit_read_generic_certs(nsswitch_domain)
 ')
 
 optional_policy(`
policy/modules/system/miscfiles.if +21 -0
index 93c1f9c1..df11794a 100644
@@ -131,6 +131,27 @@ interface(`miscfiles_read_generic_certs',`
 	read_lnk_files_pattern($1, cert_t, cert_t)
 ')
 
+########################################
+## <summary>
+##	Do not audit attempts to read generic SSL/TLS certificates.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain to not audit.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`miscfiles_dontaudit_read_generic_certs',`
+	gen_require(`
+		type cert_t;
+	')
+
+	dontaudit $1 cert_t:dir list_dir_perms;
+	dontaudit $1 cert_t:file read_file_perms;
+	dontaudit $1 cert_t:lnk_file read_lnk_file_perms;
+')
+
 ########################################
 ## <summary>
 ##	Manage generic SSL/TLS certificates.
Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH v2] New interface to dontaudit access to cert_t

Quoted 50 lines · David

I'm seeing a bunch of denials for various processes (some refpolicy domains, some my own application domains) attempting to access /etc/pki. They seem to be working OK even with the denial. The tunable authlogin_nsswitch_use_ldap controls access to cert_t (for domains that are part of nsswitch_domain attribute). Use this new interface when that tunable is off to quiet the denials.

---
 policy/modules/system/authlogin.te |  2 ++
 policy/modules/system/miscfiles.if | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)
policy/modules/system/authlogin.te +2 -0
index 345e07f3..a98054c5 100644
@@ -431,6 +431,8 @@ sysnet_dns_name_resolve(nsswitch_domain)
 tunable_policy(`authlogin_nsswitch_use_ldap',`
 	miscfiles_read_generic_certs(nsswitch_domain)
 	sysnet_use_ldap(nsswitch_domain)
+',`
+	miscfiles_dontaudit_read_generic_certs(nsswitch_domain)
 ')
 
 optional_policy(`
policy/modules/system/miscfiles.if +14 -0
index 93c1f9c1..df11794a 100644
@@ -131,6 +131,27 @@ interface(`miscfiles_read_generic_certs',`
 	read_lnk_files_pattern($1, cert_t, cert_t)
 ')
 
+########################################
+## <summary>
+##	Do not audit attempts to read generic SSL/TLS certificates.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain to not audit.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`miscfiles_dontaudit_read_generic_certs',`
+	gen_require(`
+		type cert_t;

policy/modules/system/miscfiles.if interface(`miscfiles_read_generic_certs',` · line 157

Quoted 10 lines
policy/modules/system/miscfiles.if +7 -0
+	')
+
+	dontaudit $1 cert_t:dir list_dir_perms;
+	dontaudit $1 cert_t:file read_file_perms;
+	dontaudit $1 cert_t:lnk_file read_lnk_file_perms;
+')
+
 ########################################
 ## <summary>
 ##	Manage generic SSL/TLS certificates.

Merged.

Signature · 1 line
Chris PeBenito
#3 lore raw
In reply to Sugar, David
Quoted 28 lines · David

Updated based on feedback.

---
 policy/modules/system/logging.if | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
policy/modules/system/logging.if +12 -0
index 16091eb6..c86c4bd9 100644
@@ -427,6 +427,25 @@ interface(`logging_domtrans_syslog',`
 	')
 ')
 
+########################################
+## <summary>
+##	Allow specified domain to check status of syslog unit
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`logging_status_syslog',`
+	gen_require(`

policy/modules/system/logging.if interface(`logging_domtrans_syslog',` · line 451

Quoted 10 lines
policy/modules/system/logging.if +7 -0
+		type syslogd_unit_t;
+		class service status;
+	')
+
+	allow $1 syslogd_unit_t:service status;
+')
+
 ########################################
 ## <summary>
 ##	Set the attributes of syslog temporary files.

Merged.

Signature · 1 line
Chris PeBenito