Compare commits

...

2 Commits

Author SHA1 Message Date
Andoni A.
cb5fb5cf42 docs(sdk): add changelog entry for K8s OCSF provider_uid fix 2026-03-26 15:21:32 +01:00
Andoni A.
8290b5f76a fix(kubernetes): use cluster name as provider_uid in OCSF output
- Map provider_uid to provider.identity.cluster instead of context
- Ensures --cluster-name parameter is reflected in OCSF findings
- Update test assertion to match new provider_uid value
2026-03-26 15:17:20 +01:00
3 changed files with 6 additions and 2 deletions

View File

@@ -15,6 +15,10 @@ All notable changes to the **Prowler SDK** are documented in this file.
- Minimum Python version from 3.9 to 3.10 and updated classifiers to reflect supported versions (3.10, 3.11, 3.12) [(#10464)](https://github.com/prowler-cloud/prowler/pull/10464)
### 🐞 Fixed
- Kubernetes OCSF `provider_uid` now uses the cluster name instead of the context name, so `--cluster-name` is correctly reflected in findings [(#10483)](https://github.com/prowler-cloud/prowler/pull/10483)
---
## [5.22.1] (Prowler UNRELEASED)

View File

@@ -253,7 +253,7 @@ class Finding(BaseModel):
output_data["account_uid"] = get_nested_attribute(
provider, "identity.cluster"
)
output_data["provider_uid"] = provider.identity.context
output_data["provider_uid"] = provider.identity.cluster
output_data["region"] = f"namespace: {check_output.namespace}"
elif provider.type == "github":

View File

@@ -557,7 +557,7 @@ class TestFinding:
assert finding_output.resource_tags == {}
assert finding_output.partition is None
assert finding_output.account_uid == "test_cluster"
assert finding_output.provider_uid == "In-Cluster"
assert finding_output.provider_uid == "test_cluster"
assert finding_output.account_name == "context: In-Cluster"
assert finding_output.account_email is None
assert finding_output.account_organization_uid is None