Add exporter
This commit is contained in:
parent
5c7939c163
commit
b7485ef2f3
@ -4,6 +4,8 @@ import re
|
||||
from dataclasses import dataclass
|
||||
from typing import List
|
||||
|
||||
from dataclasses_json import dataclass_json
|
||||
|
||||
from lynis import lynis_parse
|
||||
from otseca import otseca_parse
|
||||
from testssl import testssl_parse
|
||||
@ -11,6 +13,7 @@ from testssl import testssl_parse
|
||||
BASE_SCAN_PATH = os.path.join("..", "raw_scans")
|
||||
|
||||
|
||||
@dataclass_json
|
||||
@dataclass
|
||||
class Result:
|
||||
path: str
|
||||
@ -18,6 +21,7 @@ class Result:
|
||||
result: dict
|
||||
|
||||
|
||||
@dataclass_json
|
||||
@dataclass
|
||||
class Run:
|
||||
id: int
|
||||
@ -50,7 +54,8 @@ def main():
|
||||
run.lynis_results.append(Result(path, nr, lynis_parse(path)))
|
||||
if "testssl-" in log_file:
|
||||
run.testssl_results.append(Result(path, nr, testssl_parse(path)))
|
||||
[print(run) for run in list_of_all]
|
||||
with open("bla.json", "w") as handle:
|
||||
handle.write(Run.schema().dumps(list_of_all, many=True))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user