From 68832c01b00e0d72dbc397a269efad3a0b8f6ac1 Mon Sep 17 00:00:00 2001 From: 1101-1 <70093559+1101-1@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:16:26 +0500 Subject: [PATCH] [plugins][feat]: Change SCC and Inspector2 details collection (#2300) --- plugins/aws/fix_plugin_aws/resource/inspector.py | 3 +-- plugins/gcp/fix_plugin_gcp/resources/scc.py | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/plugins/aws/fix_plugin_aws/resource/inspector.py b/plugins/aws/fix_plugin_aws/resource/inspector.py index a8b318dd6..fbdf652e6 100644 --- a/plugins/aws/fix_plugin_aws/resource/inspector.py +++ b/plugins/aws/fix_plugin_aws/resource/inspector.py @@ -115,8 +115,7 @@ def parse_finding(self, source: Json) -> Finding: if self.remediation and self.remediation.recommendation: remediation = self.remediation.recommendation.text or "" updated_at = self.updated_at - details = source.get("packageVulnerabilityDetails", {}) | source.get("codeVulnerabilityDetails", {}) - return Finding(finding_title, finding_severity, description, remediation, updated_at, details) + return Finding(finding_title, finding_severity, description, remediation, updated_at, None) @classmethod def collect_resources(cls, builder: GraphBuilder) -> None: diff --git a/plugins/gcp/fix_plugin_gcp/resources/scc.py b/plugins/gcp/fix_plugin_gcp/resources/scc.py index 1721851ef..19e025e5f 100644 --- a/plugins/gcp/fix_plugin_gcp/resources/scc.py +++ b/plugins/gcp/fix_plugin_gcp/resources/scc.py @@ -157,15 +157,11 @@ def parse_finding(self, source: Json) -> Optional[Finding]: else: remediation = None title = "unknown" - source_finding = source.get("finding", {}) source_resource = source.get("resource", {}) - details = source_finding.get("sourceProperties", {}) aws_metadata = source_resource.get("awsMetadata", {}) azure_metadata = source_resource.get("azureMetadata", {}) severity = SEVERITY_MAPPING.get(finding.severity or "") or Severity.medium - return Finding( - title, severity, description, remediation, finding.event_time, details | aws_metadata | azure_metadata - ) + return Finding(title, severity, description, remediation, finding.event_time, aws_metadata | azure_metadata) return None @classmethod