Skip to content

⭐ Add GCP Security Command Center and VPC Service Controls resources#7118

Merged
tas50 merged 5 commits intomainfrom
feat/gcp-scc-vpc-service-controls
Apr 6, 2026
Merged

⭐ Add GCP Security Command Center and VPC Service Controls resources#7118
tas50 merged 5 commits intomainfrom
feat/gcp-scc-vpc-service-controls

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Apr 5, 2026

Summary

  • Add Security Command Center (SCC) resources: Sources, Findings, NotificationConfigs, MuteConfigs, BigQueryExports — available at org level (gcp.organization.scc*) and project level (gcp.project.sccFindings)
  • Add VPC Service Controls (Access Context Manager) resources: AccessPolicies, AccessLevels, ServicePerimeters — available at org level (gcp.organization.accessPolicies) with lazy-loaded sub-resources
  • Both are critical security services that were previously missing from the GCP provider

Details

Security Command Center

Resource Org-level Project-level
gcp.scc.source gcp.organization.sccSources
gcp.scc.finding gcp.organization.sccFindings gcp.project.sccFindings
gcp.scc.notificationConfig gcp.organization.sccNotificationConfigs
gcp.scc.muteConfig gcp.organization.sccMuteConfigs
gcp.scc.bigQueryExport gcp.organization.sccBigQueryExports

Findings use the - wildcard (sources/-) to list across all sources. Project-level findings include a isServiceEnabled check.

VPC Service Controls

Resource Access
gcp.accesscontextmanager.accessPolicy gcp.organization.accessPolicies
gcp.accesscontextmanager.accessLevel accessPolicy.accessLevels (lazy)
gcp.accesscontextmanager.servicePerimeter accessPolicy.servicePerimeters (lazy)

Example queries

gcp.organization.sccFindings { category severity state resourceName }
gcp.organization.accessPolicies { title servicePerimeters { title perimeterType status } }
gcp.project.sccFindings { category severity findingClass }

Test plan

  • Build provider: make providers/build/gcp && make providers/install/gcp
  • Test SCC at org level: mql shell gcp --organization-id <ORG_ID> → query gcp.organization.sccSources, gcp.organization.sccFindings
  • Test SCC at project level: mql shell gcp --project-id <PROJECT_ID> → query gcp.project.sccFindings
  • Test VPC SC: mql shell gcp --organization-id <ORG_ID> → query gcp.organization.accessPolicies { accessLevels servicePerimeters }
  • Verify graceful handling when SCC API is not enabled (project-level returns null)

🤖 Generated with Claude Code

@github-actions

This comment has been minimized.

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New GCP SCC and VPC Service Controls resources are missing required IAM permissions in gcp.permissions.json, and the unused service_accesscontextmanager constant suggests a missing service-enabled guard.

@mondoo-code-review mondoo-code-review bot dismissed their stale review April 5, 2026 21:25

Superseded by new review

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GCP permissions file still missing SCC and Access Context Manager entries needed for least-privilege documentation.

@tas50 tas50 force-pushed the feat/gcp-scc-vpc-service-controls branch from a3abf0c to cba95f7 Compare April 5, 2026 21:32
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds GCP Security Command Center and VPC Service Controls resources with clean implementation following existing patterns.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

Test Results

6 119 tests  ±0   6 115 ✅ ±0   2m 4s ⏱️ -12s
  439 suites ±0       4 💤 ±0 
   35 files   ±0       0 ❌ ±0 

Results for commit 879c097. ± Comparison against base commit 21f6518.

♻️ This comment has been updated with latest results.

tas50 and others added 2 commits April 5, 2026 18:11
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>
@tas50 tas50 force-pushed the feat/gcp-scc-vpc-service-controls branch from cba95f7 to fbbcf95 Compare April 6, 2026 01:12
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New GCP SCC and VPC Service Controls resources are functional but have a minor correctness issue in organization ID handling.

tas50 and others added 2 commits April 5, 2026 18:19
…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>
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:151metrics() is missing the if !g.serviceEnabled { return nil, nil } guard that was added to buckets(). 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:263sinks() is also missing the serviceEnabled guard. Same fix needed.
  • 🟡 providers/gcp/resources/cloudrun.go:260operations() is missing the serviceEnabled guard while regions(), services(), and jobs() 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>
@mondoo-code-review mondoo-code-review bot dismissed their stale review April 6, 2026 03:37

Superseded by new review

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds missing service-enabled guards to prevent API calls when logging/cloudrun services are disabled.

@tas50 tas50 merged commit 5435589 into main Apr 6, 2026
22 checks passed
@tas50 tas50 deleted the feat/gcp-scc-vpc-service-controls branch April 6, 2026 03:45
@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant