Skip to content

Commit

Permalink
chore: Run ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed May 3, 2024
1 parent 4d6918b commit 0b6b76a
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 18 deletions.
4 changes: 3 additions & 1 deletion tools/aircyber/aircyber.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@
ws.append(["tab", "implementation_groups", "implementation_groups"])

ws1 = wb_output.create_sheet("controls")
ws1.append(["assessable", "depth", "ref_id", "name", "description", "implementation_groups"])
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")
Expand Down
10 changes: 8 additions & 2 deletions tools/ccm/convert_ccm.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ def pretify_content(content):
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(["lite", "foundational", "foundational controls that should be implemented by any organization, regardless of their budget, maturity and risk profile"])
ws2.append(
[
"lite",
"foundational",
"foundational controls that should be implemented by any organization, regardless of their budget, maturity and risk profile",
]
)
ws2.append(["full", "systematic ", "systematic assessment of a cloud implementation"])
print("generate ", output_file_name)
wb_output.save(output_file_name)
24 changes: 20 additions & 4 deletions tools/cis/convert_cis.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
else:
safeguard_index += 1
safeguard = f"{control},{safeguard_index}"
implementation_groups = "IG1,IG2,IG3" if ig1 else "IG2,IG3" if ig2 else "IG3"
implementation_groups = (
"IG1,IG2,IG3" if ig1 else "IG2,IG3" if ig2 else "IG3"
)
output_table.append(
("x", 2, safeguard, title, description, implementation_groups)
)
Expand Down Expand Up @@ -73,14 +75,28 @@
ws.append(["tab", "implementation_groups", "implementation_groups"])

ws1 = wb_output.create_sheet("controls")
ws1.append(["assessable", "depth", "ref_id", "name", "description", "implementation_groups"])
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(
[
"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)
Expand Down
14 changes: 10 additions & 4 deletions tools/convert_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def read_header(row):
if annotation:
req_node["annotation"] = annotation
if implementation_groups:
req_node["implementation_groups"] = implementation_groups.split(',')
req_node["implementation_groups"] = implementation_groups.split(",")
threats = row[header["threats"]].value if "threats" in header else None
reference_controls = (
row[header["reference_controls"]].value
Expand Down Expand Up @@ -404,13 +404,19 @@ def read_header(row):
"description": library_vars["framework_description"],
}
if "framework_min_score" in library_vars:
library["objects"]["framework"]["min_score"] = library_vars["framework_min_score"]
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"]
library["objects"]["framework"]["max_score"] = library_vars[
"framework_max_score"
]
if scores_definition:
library["objects"]["framework"]["scores_definition"] = scores_definition
if implementation_groups_definition:
library["objects"]["framework"]["implementation_groups_definition"] = implementation_groups_definition
library["objects"]["framework"]["implementation_groups_definition"] = (
implementation_groups_definition
)
library["objects"]["framework"]["requirement_nodes"] = requirement_nodes

if has_reference_controls:
Expand Down
25 changes: 18 additions & 7 deletions tools/tisax/convert_tisax.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
req_sga = None
req_vehicle = None
further_info = None
ex_normal=None
ex_high=None
ex_very_high=None
ex_normal = None
ex_high = None
ex_very_high = None
if title == "Information Security":
(
_,
Expand Down Expand Up @@ -127,10 +127,19 @@
output_table.append(("", level, control_number, control_question, ""))
output_table.append(("x", level + 1, "", "(must)", req_must, "must"))
if req_should and req_should != "None":
output_table.append(("x", level + 1, "", "(should)", req_should, "should"))
output_table.append(
("x", level + 1, "", "(should)", req_should, "should")
)
if req_high and req_high != "None":
output_table.append(
("x", level + 1, "", "(for high protection needs)", req_high, "high")
(
"x",
level + 1,
"",
"(for high protection needs)",
req_high,
"high",
)
)
if req_very_high and req_very_high != "None":
output_table.append(
Expand All @@ -140,7 +149,7 @@
"",
"(for very high protection needs)",
req_very_high,
"very_high"
"very_high",
)
)
if req_sga and req_sga != "None":
Expand Down Expand Up @@ -194,7 +203,9 @@
ws.append(["tab", "implementation_groups", "implementation_groups"])

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

Expand Down

0 comments on commit 0b6b76a

Please sign in to comment.