Skip to content

Commit

Permalink
adapt cis generator script
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-intuitem committed Apr 27, 2024
1 parent de8d228 commit c73e461
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 10 additions & 2 deletions tools/cis/convert_cis.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
else:
safeguard_index += 1
safeguard = f"{control},{safeguard_index}"
implementation_groups = "1" if ig1 else "1,2" if ig2 else "1,2,3"
implementation_groups = "IG1,IG2,IG3" if ig1 else "IG2,IG3" if ig2 else "IG3"
output_table.append(
("x", 2, safeguard, title, description, implementation_groups)im
("x", 2, safeguard, title, description, implementation_groups)
)
else:
print(f"Ignored tab: {title}")
Expand All @@ -70,10 +70,18 @@
ws.append(["framework_name", "CIS Controls v8"])
ws.append(["framework_description", "CIS Controls v8"])
ws.append(["tab", "controls", "requirements"])
ws.append(["tab", "implementation_groups", "implementation_groups"])

ws1 = wb_output.create_sheet("controls")
ws1.append(["assessable", "depth", "ref_id", "name", "description", "implementation_groups"])
for row in output_table:
ws1.append(row)

ws2 = wb_output.create_sheet("implementation_groups")
ws2.append(["ref_id", "name", "description"])
ws2.append(["IG1", "Essential Cyber Hygiene", "Minimum standard of information security for all enterprises."])
ws2.append(["IG2", "", "For enterprises managing IT infrastructure of multiple departments with differing risk profiles."])
ws2.append(["IG3", "", "To secure sensitive and confidential data."])

print("generate ", output_file_name)
wb_output.save(output_file_name)
6 changes: 4 additions & 2 deletions tools/convert_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,11 @@ def read_header(row):
"ref_id": library_vars["framework_ref_id"],
"name": library_vars["framework_name"],
"description": library_vars["framework_description"],
"min_score": library_vars["framework_min_score"],
"max_score": library_vars["framework_max_score"],
}
if "framework_min_score" in library_vars:
library["objects"]["framework"]["min_score"] = library_vars["framework_min_score"]
if "framework_max_score" in library_vars:
library["objects"]["framework"]["max_score"] = library_vars["framework_max_score"]
if scores_definition:
library["objects"]["framework"]["scores_definition"] = scores_definition
if implementation_groups_definition:
Expand Down

0 comments on commit c73e461

Please sign in to comment.