Parse sysctl
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from parsing.postfix import Parsing
|
||||
from issues.postfix import postfix
|
||||
|
||||
class Postfix:
|
||||
def __init__(self):
|
||||
self._objects = dict()
|
||||
self._reports = dict()
|
||||
|
||||
self._postfix()
|
||||
|
||||
self._parsing = Parsing(self._objects)
|
||||
|
||||
def _postfix(self):
|
||||
self._objects = postfix()
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from parsing.sysctl import Parsing
|
||||
from issues.sysctl import sysctl
|
||||
|
||||
|
||||
class Sysctl:
|
||||
def __init__(self):
|
||||
self._objects = dict()
|
||||
self._reports = dict()
|
||||
self._audit = list()
|
||||
|
||||
self._audit.append({
|
||||
'audit': 'file',
|
||||
'value': '/etc/sysctl.conf',
|
||||
})
|
||||
self._audit.append({
|
||||
'audit': 'process',
|
||||
'value': 'sysctl -a',
|
||||
})
|
||||
|
||||
self._sysctl()
|
||||
|
||||
self._parsing = Parsing(self._objects, self._audit)
|
||||
|
||||
def _sysctl(self):
|
||||
self._objects = sysctl()
|
||||
|
||||
def runAudit(self):
|
||||
# Read /etc/sysctl.conf
|
||||
self._parsing.runParsing()
|
||||
#self._reports.append(self._parsing.getResults())
|
||||
self._reports = self._parsing.getResults()
|
||||
|
||||
# Run process sysctl
|
||||
|
||||
def getReports(self) -> dict:
|
||||
return self._reports
|
||||
|
||||
Reference in New Issue
Block a user