Skip to content

Commit 961b247

Browse files
authored
feat(compliance): add csa ccm for the alibabacloud provider (#10061)
1 parent 6abd518 commit 961b247

File tree

8 files changed

+7478
-0
lines changed

8 files changed

+7478
-0
lines changed

api/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ All notable changes to the **Prowler API** are documented in this file.
1717
- Support CSA CCM 4.0 for the GCP provider [(#10042)](https://github.com/prowler-cloud/prowler/pull/10042)
1818
- Support CSA CCM 4.0 for the Azure provider [(#10039)](https://github.com/prowler-cloud/prowler/pull/10039)
1919
- Support CSA CCM 4.0 for the Oracle Cloud provider [(#10057)](https://github.com/prowler-cloud/prowler/pull/10057)
20+
- Support CSA CCM 4.0 for the Alibaba Cloud provider [(#10061)](https://github.com/prowler-cloud/prowler/pull/10061)
2021

2122
### 🔐 Security
2223

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from prowler.lib.outputs.compliance.cis.cis_kubernetes import KubernetesCIS
3636
from prowler.lib.outputs.compliance.cis.cis_m365 import M365CIS
3737
from prowler.lib.outputs.compliance.cis.cis_oraclecloud import OracleCloudCIS
38+
from prowler.lib.outputs.compliance.csa.csa_alibabacloud import AlibabaCloudCSA
3839
from prowler.lib.outputs.compliance.csa.csa_aws import AWSCSA
3940
from prowler.lib.outputs.compliance.csa.csa_azure import AzureCSA
4041
from prowler.lib.outputs.compliance.csa.csa_gcp import GCPCSA
@@ -142,6 +143,7 @@
142143
],
143144
"alibabacloud": [
144145
(lambda name: name.startswith("cis_"), AlibabaCloudCIS),
146+
(lambda name: name.startswith("csa_"), AlibabaCloudCSA),
145147
(
146148
lambda name: name == "prowler_threatscore_alibabacloud",
147149
ProwlerThreatScoreAlibaba,
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
@@ -16,6 +16,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
1616
- CSA CCM 4.0 for the Oracle Cloud provider [(#10057)](https://github.com/prowler-cloud/prowler/pull/10057)
1717
- OCI regions updater script and CI workflow [(#10020)](https://github.com/prowler-cloud/prowler/pull/10020)
1818
- `image` provider for container image scanning with Trivy integration [(#9984)](https://github.com/prowler-cloud/prowler/pull/9984)
19+
- CSA CCM 4.0 for the Alibaba Cloud provider [(#10061)](https://github.com/prowler-cloud/prowler/pull/10061)
1920

2021
### 🔄 Changed
2122

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_m365 import M365CIS
6767
from prowler.lib.outputs.compliance.cis.cis_oraclecloud import OracleCloudCIS
6868
from prowler.lib.outputs.compliance.compliance import display_compliance_table
69+
from prowler.lib.outputs.compliance.csa.csa_alibabacloud import AlibabaCloudCSA
6970
from prowler.lib.outputs.compliance.csa.csa_aws import AWSCSA
7071
from prowler.lib.outputs.compliance.csa.csa_azure import AzureCSA
7172
from prowler.lib.outputs.compliance.csa.csa_gcp import GCPCSA
@@ -1113,6 +1114,18 @@ def streaming_callback(findings_batch):
11131114
)
11141115
generated_outputs["compliance"].append(cis)
11151116
cis.batch_write_data_to_file()
1117+
elif compliance_name == "csa_ccm_4.0_alibabacloud":
1118+
filename = (
1119+
f"{output_options.output_directory}/compliance/"
1120+
f"{output_options.output_filename}_{compliance_name}.csv"
1121+
)
1122+
csa_ccm_4_0_alibabacloud = AlibabaCloudCSA(
1123+
findings=finding_outputs,
1124+
compliance=bulk_compliance_frameworks[compliance_name],
1125+
file_path=filename,
1126+
)
1127+
generated_outputs["compliance"].append(csa_ccm_4_0_alibabacloud)
1128+
csa_ccm_4_0_alibabacloud.batch_write_data_to_file()
11161129
elif compliance_name == "prowler_threatscore_alibabacloud":
11171130
filename = (
11181131
f"{output_options.output_directory}/compliance/"

0 commit comments

Comments
 (0)