Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugins][feat]: Change SCC and Inspector2 details collection #2300

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions plugins/aws/fix_plugin_aws/resource/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 1 addition & 5 deletions plugins/gcp/fix_plugin_gcp/resources/scc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading