Skip to content

Commit 29090ad

Browse files
authored
feat(compliance): add csa ccm for the azure provider (#10039)
1 parent 78bd9ad commit 29090ad

File tree

8 files changed

+7721
-0
lines changed

8 files changed

+7721
-0
lines changed

api/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All notable changes to the **Prowler API** are documented in this file.
99
- Attack Paths: Queries definition now has short description and attribution [(#9983)](https://github.com/prowler-cloud/prowler/pull/9983)
1010
- Attack Paths: Internet node is created while scan [(#9992)](https://github.com/prowler-cloud/prowler/pull/9992)
1111
- Support CSA CCM for the AWS provider [(#10018)](https://github.com/prowler-cloud/prowler/pull/10018)
12+
- Support CSA CCM for the Azure provider [(#10039)](https://github.com/prowler-cloud/prowler/pull/10039)
1213

1314
---
1415

api/src/backend/tasks/jobs/export.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from prowler.lib.outputs.compliance.cis.cis_m365 import M365CIS
3737
from prowler.lib.outputs.compliance.cis.cis_oraclecloud import OracleCloudCIS
3838
from prowler.lib.outputs.compliance.csa.csa_aws import AWSCSA
39+
from prowler.lib.outputs.compliance.csa.csa_azure import AzureCSA
3940
from prowler.lib.outputs.compliance.ens.ens_aws import AWSENS
4041
from prowler.lib.outputs.compliance.ens.ens_azure import AzureENS
4142
from prowler.lib.outputs.compliance.ens.ens_gcp import GCPENS
@@ -101,6 +102,7 @@
101102
(lambda name: name == "ccc_azure", CCC_Azure),
102103
(lambda name: name == "prowler_threatscore_azure", ProwlerThreatScoreAzure),
103104
(lambda name: name == "c5_azure", AzureC5),
105+
(lambda name: name.startswith("csa_"), AzureCSA),
104106
],
105107
"gcp": [
106108
(lambda name: name.startswith("cis_"), GCPCIS),
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import warnings
2+
3+
from dashboard.common_methods import get_section_containers_kisa_ismsp
4+
5+
warnings.filterwarnings("ignore")
6+
7+
8+
def get_table(data):
9+
data["REQUIREMENTS_ID"] = (
10+
data["REQUIREMENTS_ID"] + " - " + data["REQUIREMENTS_DESCRIPTION"]
11+
)
12+
13+
data["REQUIREMENTS_ID"] = data["REQUIREMENTS_ID"].apply(
14+
lambda x: x[:150] + "..." if len(str(x)) > 150 else x
15+
)
16+
17+
aux = data[
18+
[
19+
"REQUIREMENTS_ID",
20+
"REQUIREMENTS_ATTRIBUTES_SECTION",
21+
"CHECKID",
22+
"STATUS",
23+
"REGION",
24+
"ACCOUNTID",
25+
"RESOURCEID",
26+
]
27+
].copy()
28+
29+
return get_section_containers_kisa_ismsp(
30+
aux, "REQUIREMENTS_ATTRIBUTES_SECTION", "REQUIREMENTS_ID"
31+
)

prowler/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
1010
- `defender_safelinks_policy_enabled` check for M365 provider [(#9832)](https://github.com/prowler-cloud/prowler/pull/9832)
1111
- AI Skills: Added a skill for creating new Attack Paths queries in openCypher, compatible with Neo4j and Neptune [(#9975)](https://github.com/prowler-cloud/prowler/pull/9975)
1212
- CSA CCM 4.0 for the AWS provider [(#10018)](https://github.com/prowler-cloud/prowler/pull/10018)
13+
- CSA CCM for the Azure provider [(#10039)](https://github.com/prowler-cloud/prowler/pull/10039)
1314

1415
### 🔄 Changed
1516

prowler/__main__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
from prowler.lib.outputs.compliance.cis.cis_oraclecloud import OracleCloudCIS
6767
from prowler.lib.outputs.compliance.compliance import display_compliance_table
6868
from prowler.lib.outputs.compliance.csa.csa_aws import AWSCSA
69+
from prowler.lib.outputs.compliance.csa.csa_azure import AzureCSA
6970
from prowler.lib.outputs.compliance.ens.ens_aws import AWSENS
7071
from prowler.lib.outputs.compliance.ens.ens_azure import AzureENS
7172
from prowler.lib.outputs.compliance.ens.ens_gcp import GCPENS
@@ -742,6 +743,18 @@ def streaming_callback(findings_batch):
742743
)
743744
generated_outputs["compliance"].append(c5_azure)
744745
c5_azure.batch_write_data_to_file()
746+
elif compliance_name == "csa_ccm_4.0_azure":
747+
filename = (
748+
f"{output_options.output_directory}/compliance/"
749+
f"{output_options.output_filename}_{compliance_name}.csv"
750+
)
751+
csa_ccm_4_0_azure = AzureCSA(
752+
findings=finding_outputs,
753+
compliance=bulk_compliance_frameworks[compliance_name],
754+
file_path=filename,
755+
)
756+
generated_outputs["compliance"].append(csa_ccm_4_0_azure)
757+
csa_ccm_4_0_azure.batch_write_data_to_file()
745758
else:
746759
filename = (
747760
f"{output_options.output_directory}/compliance/"

0 commit comments

Comments
 (0)