mirror of
https://github.com/prowler-cloud/prowler.git
synced 2025-12-19 05:17:47 +00:00
chore(compliance): update CIS 4.0 for M365 (#7699)
Co-authored-by: MrCloudSec <hello@mistercloudsec.com>
This commit is contained in:
committed by
GitHub
parent
ea3c71e22c
commit
7c3a53908b
@@ -4,7 +4,7 @@ import sys
|
||||
|
||||
# Convert a CSV file following the CIS 4.0 M365 Benchmark into a Prowler v3.0 Compliance JSON file
|
||||
# CSV fields:
|
||||
# Section #,Recommendation #,Profile,Title,Assessment Status,Description,Rationale Statement,Impact Statement,Remediation Procedure,Audit Procedure,Additional Information,CIS Controls,CIS Safeguards 1 (v8),CIS Safeguards 2 (v8),CIS Safeguards 3 (v8),v8 IG1,v8 IG2,v8 IG3,CIS Safeguards 1 (v7),CIS Safeguards 2 (v7),CIS Safeguards 3 (v7),v7 IG1,v7 IG2,v7 IG3,References,Default Value
|
||||
# Section #;Recommendation #;Profile;Title;Assessment Status;Description;Rationale Statement;Impact Statement;Remediation Procedure;Audit Procedure;Additional Information;CIS Controls;CIS Safeguards 1 (v8);CIS Safeguards 2 (v8);CIS Safeguards 3 (v8);v8 IG1;v8 IG2;v8 IG3;CIS Safeguards 1 (v7);CIS Safeguards 2 (v7);CIS Safeguards 3 (v7);v7 IG1;v7 IG2;v7 IG3;References;Default Value
|
||||
|
||||
# Get the CSV filename to convert from
|
||||
file_name = sys.argv[1]
|
||||
@@ -15,7 +15,7 @@ output = {"Framework": "CIS", "Version": "4.0", "Requirements": []}
|
||||
# Open the CSV file and read the rows
|
||||
try:
|
||||
with open(file_name, newline="", encoding="utf-8") as f:
|
||||
reader = csv.reader(f, delimiter=",")
|
||||
reader = csv.reader(f, delimiter=";")
|
||||
next(reader) # Skip the header row
|
||||
for row in reader:
|
||||
attribute = {
|
||||
@@ -29,6 +29,7 @@ try:
|
||||
"AuditProcedure": row[9],
|
||||
"AdditionalInformation": row[10],
|
||||
"References": row[24],
|
||||
"DefaultValue": row[25],
|
||||
}
|
||||
if row[4] != "":
|
||||
output["Requirements"].append(
|
||||
@@ -42,7 +43,7 @@ try:
|
||||
except UnicodeDecodeError:
|
||||
# If there is an error reading the file with the default encoding, try with ISO-8859-1
|
||||
with open(file_name, newline="", encoding="ISO-8859-1") as f:
|
||||
reader = csv.reader(f, delimiter=",")
|
||||
reader = csv.reader(f, delimiter=";")
|
||||
next(reader) # Skip the header row
|
||||
for row in reader:
|
||||
attribute = {
|
||||
@@ -56,6 +57,7 @@ except UnicodeDecodeError:
|
||||
"AuditProcedure": row[9],
|
||||
"AdditionalInformation": row[10],
|
||||
"References": row[24],
|
||||
"DefaultValue": row[25],
|
||||
}
|
||||
if row[4] != "":
|
||||
output["Requirements"].append(
|
||||
|
||||
Reference in New Issue
Block a user