Add a fact about apparmor, to see if that's loaded or not

This commit is contained in:
Michael Scherer 2016-11-10 16:48:05 +01:00 committed by Brian Coca
parent 5bbab91452
commit 0847a137d3

View file

@ -175,6 +175,7 @@ class Facts(object):
self.get_cmdline()
self.get_public_ssh_host_keys()
self.get_selinux_facts()
self.get_apparmor_facts()
self.get_caps_facts()
self.get_fips_facts()
self.get_pkg_mgr_facts()
@ -468,6 +469,13 @@ class Facts(object):
except (AttributeError,OSError):
self.facts['selinux']['type'] = 'unknown'
def get_apparmor_facts(self):
self.facts['apparmor'] = {}
if os.path.exists('/sys/kernel/security/apparmor'):
self.facts['apparmor']['status'] = 'enabled'
else:
self.facts['apparmor']['status'] = 'disabled'
def get_caps_facts(self):
capsh_path = self.module.get_bin_path('capsh')
if capsh_path: