feat(sdk): add provider identity fields to OCSF unmapped output (#10240)

Co-authored-by: Pepe Fagoaga <pepe@prowler.com>
This commit is contained in:
Andoni Alonso
2026-03-03 16:42:08 +01:00
committed by GitHub
parent 71ee4213b3
commit b61b6cba53
3 changed files with 6 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
- OpenStack image service with 6 security checks [(#10096)](https://github.com/prowler-cloud/prowler/pull/10096)
- IaC `--provider-uid` flag to specify the provider UID for the IaC provider [(#10233)](https://github.com/prowler-cloud/prowler/pull/10233)
- `provider_uid` field in OCSF `unmapped` output for provider identification [(#10231)](https://github.com/prowler-cloud/prowler/pull/10231)
- `provider` field in OCSF `unmapped` output for provider name availability regardless of cloud object presence [(#10240)](https://github.com/prowler-cloud/prowler/pull/10240)
### 🔄 Changed

View File

@@ -179,6 +179,7 @@ class OCSF(Output):
"compliance": finding.compliance,
"scan_id": str(scan_id),
"provider_uid": finding.provider_uid or finding.account_uid,
"provider": finding.provider,
},
)
if finding.provider != "kubernetes":

View File

@@ -114,6 +114,7 @@ class TestOCSF:
"notes": findings[0].metadata.Notes,
"compliance": findings[0].compliance,
"provider_uid": findings[0].account_uid,
"provider": findings[0].provider,
}
# Test with int timestamp (UNIX timestamp)
@@ -221,6 +222,7 @@ class TestOCSF:
"notes": "test-notes",
"compliance": {"test-compliance": "test-compliance"},
"provider_uid": "123456789012",
"provider": "aws",
},
"activity_name": "Create",
"activity_id": 1,
@@ -357,6 +359,7 @@ class TestOCSF:
"notes": finding_output.metadata.Notes,
"compliance": finding_output.compliance,
"provider_uid": finding_output.account_uid,
"provider": finding_output.provider,
}
# ResourceDetails
@@ -438,6 +441,7 @@ class TestOCSF:
"namespace: ", ""
)
assert finding_ocsf.unmapped["provider_uid"] == "test-k8s-context"
assert finding_ocsf.unmapped["provider"] == "kubernetes"
def test_finding_output_cloud_fail_low_not_muted(self):
finding_output = generate_finding_output(