Parsing postfix
This commit is contained in:
+5
-3
@@ -67,7 +67,10 @@ def main():
|
||||
print("Auditing the system...")
|
||||
for audit in AUDIT_SYSTEM:
|
||||
if audit not in configs["system"]["exclude_plugins"]:
|
||||
report["system"][audit] = dispatcher.runPlugin(audit, configs["system"][audit])
|
||||
report["system"][audit] = dispatcher.runPlugin(
|
||||
audit,
|
||||
configs["system"][audit]
|
||||
)
|
||||
|
||||
if args.audit == "application":
|
||||
print("Auditing the application...")
|
||||
@@ -84,8 +87,7 @@ def sysctl(*args) -> dict:
|
||||
|
||||
@Dispatcher.register_plugins
|
||||
def postfix(*args) -> dict:
|
||||
arguments = args[1]
|
||||
postfix = Postfix()
|
||||
postfix = Postfix(args[1])
|
||||
postfix.runAudit()
|
||||
return postfix.getReports()
|
||||
|
||||
|
||||
+9
-2
@@ -4,19 +4,26 @@ from audit.system.plugins.postfix.parsing import Parsing
|
||||
from audit.system.plugins.postfix.postfix import postfix
|
||||
|
||||
class Postfix:
|
||||
def __init__(self):
|
||||
def __init__(self, arguments):
|
||||
self._objects = dict()
|
||||
self._reports = dict()
|
||||
self._arguments = arguments
|
||||
|
||||
self._postfix()
|
||||
|
||||
self._parsing = Parsing(self._objects)
|
||||
self._parsing = Parsing(self._objects, arguments)
|
||||
|
||||
def _postfix(self):
|
||||
"""
|
||||
Store all data to analyze in the object variable
|
||||
"""
|
||||
self._objects = postfix()
|
||||
|
||||
def runAudit(self):
|
||||
print("Running test for postfix")
|
||||
self._parsing.runParsing()
|
||||
|
||||
self._reports = self._parsing.getResults()
|
||||
|
||||
def getReports(self) -> dict:
|
||||
return self._reports
|
||||
|
||||
+2
-5
@@ -28,12 +28,9 @@ class Sysctl:
|
||||
|
||||
def runAudit(self):
|
||||
print("Running test for sysctl")
|
||||
# Read /etc/sysctl.conf
|
||||
self._parsing.runParsing()
|
||||
#self._reports.append(self._parsing.getResults())
|
||||
self._reports = self._parsing.getResults()
|
||||
|
||||
# Run process sysctl
|
||||
self._parsing.runParsing()
|
||||
self._reports = self._parsing.getResults()
|
||||
|
||||
def getReports(self) -> dict:
|
||||
return self._reports
|
||||
|
||||
Reference in New Issue
Block a user