-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(compliance): add C5 for GCP provider #9097
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
Conversation
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
|
✅ All necessary |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9097 +/- ##
==========================================
+ Coverage 88.50% 88.59% +0.08%
==========================================
Files 93 338 +245
Lines 3524 25388 +21864
==========================================
+ Hits 3119 22493 +19374
- Misses 405 2895 +2490
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| def transform( | ||
| self, | ||
| findings: list[Finding], | ||
| compliance: Compliance, | ||
| compliance_name: str, | ||
| ) -> None: |
Check warning
Code scanning / CodeQL
Signature mismatch in overriding method Warning
Output.transform
This call
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 25 days ago
To fix the issue, the method signature of GCPC5.transform should exactly match its base class's (ComplianceOutput.transform). Based on the error, the base method apparently takes two arguments. So:
- Change the method signature in
GCPC5from accepting 4 arguments (findings, compliance, compliance_name) to 2 arguments, likely (findings, compliance)—but you should match exactly what the parent defines. - Within the subclass method, adapt usage to extract
compliance_namefrom the compliance object if available, or otherwise revise the implementation so it doesn't depend on an extra argument that the caller won't supply. - Specifically, any usage of
compliance_nameinside the method must be refactored to obtain its value from thecomplianceargument, or via another property/logic.
No other changes are necessary beyond correcting the method's signature and internal usage.
-
Copy modified lines R38-R39
| @@ -21,7 +21,6 @@ | ||
| self, | ||
| findings: list[Finding], | ||
| compliance: Compliance, | ||
| compliance_name: str, | ||
| ) -> None: | ||
| """ | ||
| Transforms a list of findings into GCP C5 compliance format. | ||
| @@ -36,7 +35,8 @@ | ||
| """ | ||
| for finding in findings: | ||
| # Get the compliance requirements for the finding | ||
| finding_requirements = finding.compliance.get(compliance_name, []) | ||
| # Assume compliance_name can be inferred as compliance.Name | ||
| finding_requirements = finding.compliance.get(compliance.Name, []) | ||
| for requirement in compliance.Requirements: | ||
| if requirement.Id in finding_requirements: | ||
| for attribute in requirement.Attributes: |
🔒 Container Security ScanImage: 📊 Vulnerability Summary
2 package(s) affected
|
🔒 Container Security ScanImage: 📊 Vulnerability Summary
3 package(s) affected
|
AdriiiPRodri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API side LGTM!
Description
This PR adds C5 compliance framework for the GCP provider.

Screen.Recording.2025-10-30.at.15.48.49.mov
Steps to review
Please add a detailed description of how to review this PR.
Checklist
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.