⭐ Add GCP Security Command Center and VPC Service Controls resources#7118
Merged
⭐ Add GCP Security Command Center and VPC Service Controls resources#7118
Conversation
This comment has been minimized.
This comment has been minimized.
a3abf0c to
cba95f7
Compare
Contributor
Add two new GCP service areas to the provider: **Security Command Center (SCC):** - Sources, Findings, NotificationConfigs, MuteConfigs, BigQueryExports - Available at org level (gcp.organization.scc*) and project level (gcp.project.sccFindings) - Uses wildcard source listing (sources/-) for cross-source finding queries **VPC Service Controls (Access Context Manager):** - AccessPolicies, AccessLevels, ServicePerimeters - Available at org level (gcp.organization.accessPolicies) - AccessLevels and ServicePerimeters lazy-loaded as sub-resources of AccessPolicy Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add state="ACTIVE" filter to listSCCFindings to avoid unbounded results - Remove unused service_accesscontextmanager constant (ACM is org-level only) - Update .lr comments to document active-only filtering - Add accesscontextmanager and scc to spelling expect.txt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cba95f7 to
fbbcf95
Compare
…ce check Use g.Id.Data directly in sccParent() instead of redundantly calling conn.OrganizationID(). Add comment explaining why org-level SCC methods skip isServiceEnabled. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Discovery would fatally crash when a GCP API was not enabled in the target project. Services like DNS, BigQuery, and GKE already had the serviceEnabled guard pattern, but 10 other services did not: Redis, Secret Manager, Pub/Sub, Cloud Run, Cloud Functions, Logging, KMS, Cloud SQL, Storage, and IAM. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Missing service-enabled guards on some GCP API methods will cause errors when the service is disabled
Additional findings (file/line not in diff):
- 🟡
providers/gcp/resources/logging.go:151—metrics()is missing theif !g.serviceEnabled { return nil, nil }guard that was added tobuckets(). This will cause API calls to fail when the logging service is not enabled. Add the same guard at the top of this method. - 🟡
providers/gcp/resources/logging.go:263—sinks()is also missing theserviceEnabledguard. Same fix needed. - 🟡
providers/gcp/resources/cloudrun.go:260—operations()is missing theserviceEnabledguard whileregions(),services(), andjobs()all have it. Add the same check here for consistency.
Address review: add guards to metrics(), sinks() on loggingservice and operations() on cloudRunService for consistency with other methods. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gcp.organization.scc*) and project level (gcp.project.sccFindings)gcp.organization.accessPolicies) with lazy-loaded sub-resourcesDetails
Security Command Center
gcp.scc.sourcegcp.organization.sccSourcesgcp.scc.findinggcp.organization.sccFindingsgcp.project.sccFindingsgcp.scc.notificationConfiggcp.organization.sccNotificationConfigsgcp.scc.muteConfiggcp.organization.sccMuteConfigsgcp.scc.bigQueryExportgcp.organization.sccBigQueryExportsFindings use the
-wildcard (sources/-) to list across all sources. Project-level findings include aisServiceEnabledcheck.VPC Service Controls
gcp.accesscontextmanager.accessPolicygcp.organization.accessPoliciesgcp.accesscontextmanager.accessLevelaccessPolicy.accessLevels(lazy)gcp.accesscontextmanager.servicePerimeteraccessPolicy.servicePerimeters(lazy)Example queries
Test plan
make providers/build/gcp && make providers/install/gcpmql shell gcp --organization-id <ORG_ID>→ querygcp.organization.sccSources,gcp.organization.sccFindingsmql shell gcp --project-id <PROJECT_ID>→ querygcp.project.sccFindingsmql shell gcp --organization-id <ORG_ID>→ querygcp.organization.accessPolicies { accessLevels servicePerimeters }🤖 Generated with Claude Code