mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 21:11:53 +00:00
fix(api): populate compliance data in check_metadata for findings (#10449)
This commit is contained in:
@@ -7,6 +7,7 @@ All notable changes to the **Prowler API** are documented in this file.
|
||||
### 🐞 Fixed
|
||||
|
||||
- Finding groups list/latest now apply computed status/severity filters and finding-level prefilters (delta, region, service, category, resource group, scan, resource type), plus `check_title` support for sort/filter consistency [(#10428)](https://github.com/prowler-cloud/prowler/pull/10428)
|
||||
- Populate compliance data inside `check_metadata` for findings, which was always returned as `null` [(#10449)](https://github.com/prowler-cloud/prowler/pull/10449)
|
||||
|
||||
## [1.23.0] (Prowler v5.22.0)
|
||||
|
||||
|
||||
@@ -677,6 +677,7 @@ def _process_finding_micro_batch(
|
||||
|
||||
# Create finding object (don't save yet)
|
||||
check_metadata = finding.get_metadata()
|
||||
check_metadata["compliance"] = finding.compliance
|
||||
finding_instance = Finding(
|
||||
tenant_id=tenant_id,
|
||||
uid=finding_uid,
|
||||
|
||||
@@ -1411,7 +1411,9 @@ class TestProcessFindingMicroBatch:
|
||||
assert created_finding.status == StatusChoices.PASS
|
||||
assert created_finding.delta == Finding.DeltaChoices.NEW
|
||||
assert created_finding.muted is False
|
||||
assert created_finding.check_metadata == finding.metadata
|
||||
expected_metadata = {**finding.metadata, "compliance": finding.compliance}
|
||||
assert created_finding.check_metadata == expected_metadata
|
||||
assert created_finding.check_metadata["compliance"] == finding.compliance
|
||||
assert created_finding.resource_regions == [finding.region]
|
||||
assert created_finding.resource_services == [finding.service_name]
|
||||
assert created_finding.resource_types == [finding.resource_type]
|
||||
|
||||
Reference in New Issue
Block a user