aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2009-02-25 19:27:16 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2009-02-25 19:27:16 +0000
commit7f144159110c5922252bee03808d503825d7099e (patch)
treed7029a67c8df047626c84dff5fb0fe43eb244ae7 /src
parent4c48f502037a666d404eaaf5c15a42072b148490 (diff)
downloadmsec-7f144159110c5922252bee03808d503825d7099e.tar
msec-7f144159110c5922252bee03808d503825d7099e.tar.gz
msec-7f144159110c5922252bee03808d503825d7099e.tar.bz2
msec-7f144159110c5922252bee03808d503825d7099e.tar.xz
msec-7f144159110c5922252bee03808d503825d7099e.zip
Added sample AppArmor plugin.
Diffstat (limited to 'src')
-rw-r--r--src/msec/config.py1
-rw-r--r--src/msec/plugins/apparmor.py27
2 files changed, 27 insertions, 1 deletions
diff --git a/src/msec/config.py b/src/msec/config.py
index c6df685..2b98c84 100644
--- a/src/msec/config.py
+++ b/src/msec/config.py
@@ -100,7 +100,6 @@ SETTINGS = {'BASE_LEVEL': ("libmsec.base_level",
'ENABLE_SUDO': ("libmsec.enable_sudo", ['yes', 'no', 'wheel']),
'ENABLE_PAM_WHEEL_FOR_SU': ("libmsec.enable_pam_wheel_for_su", ['yes', 'no']),
'ENABLE_SULOGIN': ("libmsec.enable_sulogin", ['yes', 'no']),
- 'ENABLE_APPARMOR': ("libmsec.enable_apparmor", ['yes', 'no']),
'ENABLE_POLICYKIT': ("libmsec.enable_policykit", ['yes', 'no']),
# password stuff
'ENABLE_PASSWORD': ("libmsec.enable_password", ['yes', 'no']),
diff --git a/src/msec/plugins/apparmor.py b/src/msec/plugins/apparmor.py
new file mode 100644
index 0000000..40fd969
--- /dev/null
+++ b/src/msec/plugins/apparmor.py
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+"""AppArmor plugin for msec """
+
+# main plugin class name
+PLUGIN = "apparmor"
+
+import os
+
+# configuration
+import config
+
+class apparmor:
+ def __init__(self, log=None, configfiles=None, root=None):
+ # initializing plugin
+ self.log = log
+ self.configfiles = configfiles
+ self.root = root
+
+ # configuring entry in global settings
+ param = 'ENABLE_APPARMOR'
+ callback = "apparmor.enable_apparmor"
+ valid_values = ['yes', 'no']
+ config.SETTINGS[param] = (callback, valid_values)
+
+ def enable_apparmor(self, params):
+ if self.log:
+ self.log.info("AppArmor plugin: not implemented yet!")