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