Skip to contentSkip to conversation

setroubleshoot: Fix sealert message for capability2

PATCH In review Vit Mojzis 1 participant 2 messages Aug 8, 2016 SELinux security module

lore
Share & tools
lore

Vit Mojzis

author
#0 lore raw

PATCH 1/1 setroubleshoot: Fix sealert message for capability2

Sealert didn't know "capability2" class which caused capability2 denials (e.g. block_suspend) to be reported as "access" denials.

type=AVC msg=audit(1468324670.938:596175): avc: denied { block_suspend } for pid=8442 comm="smtp" capability=36 scontext=system_u:system_r:postfix_smtp_t:s0 tcontext=system_u:system_r:postfix_smtp_t:s0 tclass=capability2

SELinux is preventing smtp from block_suspend access on the capability2 Unknown.

---
 framework/src/setroubleshoot/signature.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
framework/src/setroubleshoot/signature.py +2 -1
index 77ecc35..1f60c74 100755
@@ -212,6 +212,7 @@ class_dict['process'] = _("process")
 class_dict['filesystem'] = _("filesystem")
 class_dict['node'] = _("node")
 class_dict['capability'] = _("capability")
+class_dict['capability2'] = _("capability2")
 
 def translate_class(tclass):
     if tclass in list(class_dict.keys()):
@@ -447,7 +448,7 @@ class SEFaultSignatureInfo(XmlSerialize):
         if self.tclass == "process":
             return P_(_("SELinux is preventing %s from using the %s access on a process."), _("SELinux is preventing %s from using the '%s' accesses on a process."), len(self.sig.access)) % (self.spath, ", ".join(self.sig.access))
 
-        if self.tclass == "capability":
+        if self.tclass in ["capability", "capability2"]:
             return P_(_("SELinux is preventing %s from using the %s capability."), _("SELinux is preventing %s from using the '%s' capabilities."), len(self.sig.access)) % (self.spath, ", ".join(self.sig.access))
         if self.tpath == "(null)":
             return P_(_("SELinux is preventing %s from %s access on the %s labeled %s."), _("SELinux is preventing %s from '%s' accesses on the %s labeled %s."), len(self.sig.access)) % (self.spath, ", ".join(self.sig.access), translate_class(self.tclass), self.tcontext.type)
Signature · 1 line
2.5.5
author
#1 lore raw

Please disregard this patch. I accidentally sent it to the wrong address.

----- Original Message -----
From: "Vit Mojzis" <[email protected]>
To: [email protected]
Cc: [email protected], "Vit Mojzis" <[email protected]>
Sent: Monday, August 8, 2016 10:13:26 AM
Subject: [PATCH] setroubleshoot: Fix sealert message for capability2

Sealert didn't know "capability2" class which caused capability2 denials (e.g. block_suspend) to be reported as "access" denials.

type=AVC msg=audit(1468324670.938:596175): avc: denied { block_suspend } for pid=8442 comm="smtp" capability=36 scontext=system_u:system_r:postfix_smtp_t:s0 tcontext=system_u:system_r:postfix_smtp_t:s0 tclass=capability2

SELinux is preventing smtp from block_suspend access on the capability2 Unknown.

---
 framework/src/setroubleshoot/signature.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
framework/src/setroubleshoot/signature.py +0 -0
index 77ecc35..1f60c74 100755

@@ -212,6 +212,7 @@ class_dict['process'] = _("process")
class_dict['filesystem'] = _("filesystem") class_dict['node'] = _("node") class_dict['capability'] = _("capability")
+class_dict['capability2'] = _("capability2")

def translate_class(tclass):
if tclass in list(class_dict.keys()):
@@ -447,7 +448,7 @@ class SEFaultSignatureInfo(XmlSerialize):
if self.tclass == "process":
return P_(_("SELinux is preventing %s from using the %s access on a process."), _("SELinux is preventing %s from using the '%s' accesses on a process."), len(self.sig.access)) % (self.spath, ", ".join(self.sig.access))

- if self.tclass == "capability":
+ if self.tclass in ["capability", "capability2"]:
return P_(_("SELinux is preventing %s from using the %s capability."), _("SELinux is preventing %s from using the '%s' capabilities."), len(self.sig.access)) % (self.spath, ", ".join(self.sig.access))
if self.tpath == "(null)":
return P_(_("SELinux is preventing %s from %s access on the %s labeled %s."), _("SELinux is preventing %s from '%s' accesses on the %s labeled %s."), len(self.sig.access)) % (self.spath, ", ".join(self.sig.access), translate_class(self.tclass), self.tcontext.type)

Signature · 1 line
2.5.5