Parse sysctl

This commit is contained in:
gbucchino
2023-06-07 16:49:12 +02:00
parent 8b2e9cbd29
commit 882cdf805f
9 changed files with 328 additions and 46 deletions
+16
View File
@@ -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()
+39
View File
@@ -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