42 lines
947 B
Python
42 lines
947 B
Python
#!/usr/bin/env python
|
|
|
|
from argparse import ArgumentParser
|
|
from core.sysctl import Sysctl
|
|
from core.postfix import Postfix
|
|
from report import generateHtmlReport
|
|
|
|
|
|
def checkArguments():
|
|
args = ArgumentParser(description="Check Gitlab repositories")
|
|
args.add_argument('-a', '--audit', help="Kind of audit", choices=['system', 'application'])
|
|
return args.parse_args()
|
|
|
|
def main():
|
|
args = checkArguments()
|
|
|
|
# If audit is not specified
|
|
if args.audit is None:
|
|
print("Please, you must specify the audit type")
|
|
exit(1)
|
|
|
|
# Report
|
|
report = dict()
|
|
report['system'] = None
|
|
|
|
# Audit application
|
|
if args.audit == "application":
|
|
pass
|
|
|
|
# Audit system
|
|
if args.audit == "system":
|
|
sysctl = Sysctl()
|
|
sysctl.runAudit()
|
|
|
|
# Getting reports
|
|
report['sysctl'] = sysctl.getReports()
|
|
|
|
generateHtmlReport(report)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|