Skip to content

Commit b61b6cb

Browse files
andoniafjfagoagas
andauthored
feat(sdk): add provider identity fields to OCSF unmapped output (#10240)
Co-authored-by: Pepe Fagoaga <pepe@prowler.com>
1 parent 71ee421 commit b61b6cb

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

prowler/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
4242
- OpenStack image service with 6 security checks [(#10096)](https://github.com/prowler-cloud/prowler/pull/10096)
4343
- IaC `--provider-uid` flag to specify the provider UID for the IaC provider [(#10233)](https://github.com/prowler-cloud/prowler/pull/10233)
4444
- `provider_uid` field in OCSF `unmapped` output for provider identification [(#10231)](https://github.com/prowler-cloud/prowler/pull/10231)
45+
- `provider` field in OCSF `unmapped` output for provider name availability regardless of cloud object presence [(#10240)](https://github.com/prowler-cloud/prowler/pull/10240)
4546

4647
### 🔄 Changed
4748

prowler/lib/outputs/ocsf/ocsf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def transform(self, findings: List[Finding]) -> None:
179179
"compliance": finding.compliance,
180180
"scan_id": str(scan_id),
181181
"provider_uid": finding.provider_uid or finding.account_uid,
182+
"provider": finding.provider,
182183
},
183184
)
184185
if finding.provider != "kubernetes":

tests/lib/outputs/ocsf/ocsf_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def test_transform(self):
114114
"notes": findings[0].metadata.Notes,
115115
"compliance": findings[0].compliance,
116116
"provider_uid": findings[0].account_uid,
117+
"provider": findings[0].provider,
117118
}
118119

119120
# Test with int timestamp (UNIX timestamp)
@@ -221,6 +222,7 @@ def test_batch_write_data_to_file(self):
221222
"notes": "test-notes",
222223
"compliance": {"test-compliance": "test-compliance"},
223224
"provider_uid": "123456789012",
225+
"provider": "aws",
224226
},
225227
"activity_name": "Create",
226228
"activity_id": 1,
@@ -357,6 +359,7 @@ def test_finding_output_cloud_pass_low_muted(self):
357359
"notes": finding_output.metadata.Notes,
358360
"compliance": finding_output.compliance,
359361
"provider_uid": finding_output.account_uid,
362+
"provider": finding_output.provider,
360363
}
361364

362365
# ResourceDetails
@@ -438,6 +441,7 @@ def test_finding_output_kubernetes(self):
438441
"namespace: ", ""
439442
)
440443
assert finding_ocsf.unmapped["provider_uid"] == "test-k8s-context"
444+
assert finding_ocsf.unmapped["provider"] == "kubernetes"
441445

442446
def test_finding_output_cloud_fail_low_not_muted(self):
443447
finding_output = generate_finding_output(

0 commit comments

Comments
 (0)