Skip to content

Commit 627088e

Browse files
authored
feat(compliance): add csa ccm for the oraclecloud provider (#10057)
1 parent 93ac38c commit 627088e

File tree

8 files changed

+7485
-5
lines changed

8 files changed

+7485
-5
lines changed

api/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ All notable changes to the **Prowler API** are documented in this file.
1313
- Attack Paths: Queries definition now has short description and attribution [(#9983)](https://github.com/prowler-cloud/prowler/pull/9983)
1414
- Attack Paths: Internet node is created while scan [(#9992)](https://github.com/prowler-cloud/prowler/pull/9992)
1515
- Attack Paths: Add full paths set from [pathfinding.cloud](https://pathfinding.cloud/) [(#10008)](https://github.com/prowler-cloud/prowler/pull/10008)
16-
- Support CSA CCM for the AWS provider [(#10018)](https://github.com/prowler-cloud/prowler/pull/10018)
16+
- Support CSA CCM 4.0 for the AWS provider [(#10018)](https://github.com/prowler-cloud/prowler/pull/10018)
1717
- Support CSA CCM 4.0 for the GCP provider [(#10042)](https://github.com/prowler-cloud/prowler/pull/10042)
18-
- Support CSA CCM for the Azure provider [(#10039)](https://github.com/prowler-cloud/prowler/pull/10039)
18+
- Support CSA CCM 4.0 for the Azure provider [(#10039)](https://github.com/prowler-cloud/prowler/pull/10039)
19+
- Support CSA CCM 4.0 for the Oracle Cloud provider [(#10057)](https://github.com/prowler-cloud/prowler/pull/10057)
1920

2021
### 🔐 Security
2122

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@
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_gcp import GCPCSA
4039
from prowler.lib.outputs.compliance.csa.csa_azure import AzureCSA
40+
from prowler.lib.outputs.compliance.csa.csa_gcp import GCPCSA
41+
from prowler.lib.outputs.compliance.csa.csa_oraclecloud import OracleCloudCSA
4142
from prowler.lib.outputs.compliance.ens.ens_aws import AWSENS
4243
from prowler.lib.outputs.compliance.ens.ens_azure import AzureENS
4344
from prowler.lib.outputs.compliance.ens.ens_gcp import GCPENS
@@ -137,6 +138,7 @@
137138
],
138139
"oraclecloud": [
139140
(lambda name: name.startswith("cis_"), OracleCloudCIS),
141+
(lambda name: name.startswith("csa_"), OracleCloudCSA),
140142
],
141143
"alibabacloud": [
142144
(lambda name: name.startswith("cis_"), AlibabaCloudCIS),
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ All notable changes to the **Prowler SDK** are documented in this file.
1212
- 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)
1313
- CSA CCM 4.0 for the AWS provider [(#10018)](https://github.com/prowler-cloud/prowler/pull/10018)
1414
- CSA CCM 4.0 for the GCP provider [(#10042)](https://github.com/prowler-cloud/prowler/pull/10042)
15-
- CSA CCM for the Azure provider [(#10039)](https://github.com/prowler-cloud/prowler/pull/10039)
15+
- CSA CCM 4.0 for the Azure provider [(#10039)](https://github.com/prowler-cloud/prowler/pull/10039)
16+
- CSA CCM 4.0 for the Oracle Cloud provider [(#10057)](https://github.com/prowler-cloud/prowler/pull/10057)
1617
- OCI regions updater script and CI workflow [(#10020)](https://github.com/prowler-cloud/prowler/pull/10020)
1718
- `image` provider for container image scanning with Trivy integration [(#9984)](https://github.com/prowler-cloud/prowler/pull/9984)
1819

prowler/__main__.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@
6767
from prowler.lib.outputs.compliance.cis.cis_oraclecloud import OracleCloudCIS
6868
from prowler.lib.outputs.compliance.compliance import display_compliance_table
6969
from prowler.lib.outputs.compliance.csa.csa_aws import AWSCSA
70-
from prowler.lib.outputs.compliance.csa.csa_gcp import GCPCSA
7170
from prowler.lib.outputs.compliance.csa.csa_azure import AzureCSA
71+
from prowler.lib.outputs.compliance.csa.csa_gcp import GCPCSA
72+
from prowler.lib.outputs.compliance.csa.csa_oraclecloud import OracleCloudCSA
7273
from prowler.lib.outputs.compliance.ens.ens_aws import AWSENS
7374
from prowler.lib.outputs.compliance.ens.ens_azure import AzureENS
7475
from prowler.lib.outputs.compliance.ens.ens_gcp import GCPENS
@@ -1072,6 +1073,18 @@ def streaming_callback(findings_batch):
10721073
)
10731074
generated_outputs["compliance"].append(cis)
10741075
cis.batch_write_data_to_file()
1076+
elif compliance_name == "csa_ccm_4.0_oraclecloud":
1077+
filename = (
1078+
f"{output_options.output_directory}/compliance/"
1079+
f"{output_options.output_filename}_{compliance_name}.csv"
1080+
)
1081+
csa_ccm_4_0_oraclecloud = OracleCloudCSA(
1082+
findings=finding_outputs,
1083+
compliance=bulk_compliance_frameworks[compliance_name],
1084+
file_path=filename,
1085+
)
1086+
generated_outputs["compliance"].append(csa_ccm_4_0_oraclecloud)
1087+
csa_ccm_4_0_oraclecloud.batch_write_data_to_file()
10751088
else:
10761089
filename = (
10771090
f"{output_options.output_directory}/compliance/"

0 commit comments

Comments
 (0)