Update postfix audit
This commit is contained in:
parent
9e5ae61c69
commit
3cd25dce85
@ -11,8 +11,6 @@ class Parsing(ParsingBase):
|
|||||||
self._reports = dict()
|
self._reports = dict()
|
||||||
self._objects = objects
|
self._objects = objects
|
||||||
self._postfix_file = arguments["postfix_file"]
|
self._postfix_file = arguments["postfix_file"]
|
||||||
print(self._objects)
|
|
||||||
print(arguments)
|
|
||||||
|
|
||||||
def runParsing(self):
|
def runParsing(self):
|
||||||
# Generate report
|
# Generate report
|
||||||
@ -30,9 +28,18 @@ class Parsing(ParsingBase):
|
|||||||
data = fdata.read()
|
data = fdata.read()
|
||||||
lines = data.splitlines()
|
lines = data.splitlines()
|
||||||
|
|
||||||
|
obj = self._objects['regexp'].split("=")
|
||||||
|
directive = obj[0].strip()
|
||||||
|
value = obj[1].strip()
|
||||||
|
print(self._objects)
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
line = line.decode('utf-8')
|
line = line.decode('utf-8')
|
||||||
print(line)
|
grDirective = re.search(directive, line)
|
||||||
|
if grDirective:
|
||||||
|
grValue = re.search(value, line)
|
||||||
|
if grValue:
|
||||||
|
print(line)
|
||||||
|
|
||||||
def _generateReport(self, objects):
|
def _generateReport(self, objects):
|
||||||
# We can generate the report
|
# We can generate the report
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
def postfix() -> dict:
|
def postfix() -> list:
|
||||||
postfix = dict()
|
postfix = list()
|
||||||
postfix['regexp'] = "inet_interfaces = all"
|
postfix.append({
|
||||||
postfix['replace'] = "inet_interfaces = loopback-only"
|
'directive': "inet_interfaces",
|
||||||
|
'value': "loopback-only",
|
||||||
|
})
|
||||||
return postfix
|
return postfix
|
||||||
|
@ -23,7 +23,8 @@ def generateHtmlReport(data):
|
|||||||
#print(plugin)
|
#print(plugin)
|
||||||
dataJinja2['plugins'].append(f"{plugin}.html.j2")
|
dataJinja2['plugins'].append(f"{plugin}.html.j2")
|
||||||
|
|
||||||
if 'postfix' in dataJinja2['plugins']:
|
if 'postfix' in data['system']:
|
||||||
|
#print(data['system']['postfix'])
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if 'sysctl' in data['system']:
|
if 'sysctl' in data['system']:
|
||||||
|
Loading…
Reference in New Issue
Block a user