Google Cloud Provider (GCP)
The RegScale CLI integrates with Google Cloud Platform to synchronize assets, security findings, and compliance data from GCP Security Command Center (SCC) into RegScale for continuous monitoring and compliance automation.
Overview
This integration enables:
- Asset Synchronization: Import GCP resources as RegScale assets
- Findings Synchronization: Import SCC security findings as RegScale vulnerabilities (the platform opens one issue per vulnerability)
- Compliance Automation: Map SCC findings to compliance controls (NIST 800-53, FedRAMP, CIS, PCI-DSS, SOC2)
- Evidence Collection: Automated evidence gathering for audit trails
- Inventory Export: Export GCP resource inventory for analysis
Prerequisites
- Active GCP account with appropriate permissions
- GCP project with Security Command Center enabled
- Service account with required IAM roles
- RegScale CLI installed and configured (
regscale init)
Setup
Step 1: Create a GCP Project (if needed)
- Navigate to the GCP Console
- Click the project dropdown and select New Project
- Enter a project name and click Create
Step 2: Enable Required APIs
Core APIs (Required)
# Security Command Center API - Required for findings and compliance
gcloud services enable securitycenter.googleapis.com
# Cloud Asset API - Required for asset inventory
gcloud services enable cloudasset.googleapis.com
# Resource Manager API - Required for project/org metadata
gcloud services enable cloudresourcemanager.googleapis.com
Optional APIs (based on inventory scope)
Enable these APIs to collect inventory for specific resource types:
# Compute resources
gcloud services enable compute.googleapis.com
gcloud services enable container.googleapis.com
gcloud services enable run.googleapis.com
gcloud services enable cloudfunctions.googleapis.com
gcloud services enable appengine.googleapis.com
# Storage & Database
gcloud services enable storage.googleapis.com
gcloud services enable sqladmin.googleapis.com
gcloud services enable spanner.googleapis.com
gcloud services enable bigtable.googleapis.com
gcloud services enable firestore.googleapis.com
gcloud services enable redis.googleapis.com
# Security & Compliance
gcloud services enable iam.googleapis.com
gcloud services enable cloudkms.googleapis.com
gcloud services enable logging.googleapis.com
# Networking
gcloud services enable dns.googleapis.com
Step 3: Create a Service Account
- Navigate to IAM & Admin > Service Accounts in the GCP Console
- Click Create Service Account
- Enter a name (e.g.,
regscale-integration) and description - Click Create and Continue
- Assign the required roles (see Required IAM Permissions)
- Click Done
Step 4: Generate Service Account Key
- Click on the newly created service account
- Navigate to the Keys tab
- Click Add Key > Create new key
- Select JSON format
- Click Create to download the key file
- Store the key file securely (do not commit to version control)
Required IAM Permissions
Minimum Required Roles
These roles are required for basic functionality:
| Role | Purpose | Required For |
|---|---|---|
roles/securitycenter.findingsViewer | View Security Command Center findings | sync_findings, sync_compliance |
roles/securitycenter.sourcesViewer | View SCC sources and compliance posture | sync_compliance, collect_evidence |
roles/cloudasset.viewer | View Cloud Asset Inventory | sync_assets, inventory |
Optional Roles (for comprehensive inventory)
These roles provide access to additional resource details:
| Role | Purpose |
|---|---|
roles/iam.securityReviewer | IAM policies, service accounts, and roles |
roles/logging.viewer | Log sinks, metrics, and audit logs |
roles/cloudkms.viewer | KMS key rings and crypto keys |
roles/compute.viewer | Compute Engine instances, disks, networks |
roles/storage.objectViewer | Cloud Storage bucket metadata |
roles/container.viewer | GKE clusters and node pools |
Granting Permissions
Organization-Level (Recommended for full visibility)
Organization-level permissions provide visibility across all projects:
# Set variables
SERVICE_ACCOUNT="regscale-integration@YOUR_PROJECT.iam.gserviceaccount.com"
ORG_ID="123456789012" # Your numeric organization ID
# Grant required roles
gcloud organizations add-iam-policy-binding $ORG_ID \
--member="serviceAccount:$SERVICE_ACCOUNT" \
--role="roles/securitycenter.findingsViewer"
gcloud organizations add-iam-policy-binding $ORG_ID \
--member="serviceAccount:$SERVICE_ACCOUNT" \
--role="roles/securitycenter.sourcesViewer"
gcloud organizations add-iam-policy-binding $ORG_ID \
--member="serviceAccount:$SERVICE_ACCOUNT" \
--role="roles/cloudasset.viewer"
# Optional: Additional roles for comprehensive inventory
gcloud organizations add-iam-policy-binding $ORG_ID \
--member="serviceAccount:$SERVICE_ACCOUNT" \
--role="roles/iam.securityReviewer"
gcloud organizations add-iam-policy-binding $ORG_ID \
--member="serviceAccount:$SERVICE_ACCOUNT" \
--role="roles/logging.viewer"
Project-Level
For single-project scanning:
# Set variables
SERVICE_ACCOUNT="regscale-integration@YOUR_PROJECT.iam.gserviceaccount.com"
PROJECT_ID="my-gcp-project"
# Grant required roles
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:$SERVICE_ACCOUNT" \
--role="roles/securitycenter.findingsViewer"
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:$SERVICE_ACCOUNT" \
--role="roles/cloudasset.viewer"
Folder-Level
For folder-scoped scanning:
# Set variables
SERVICE_ACCOUNT="regscale-integration@YOUR_PROJECT.iam.gserviceaccount.com"
FOLDER_ID="987654321098" # Your numeric folder ID
# Grant required roles
gcloud resource-manager folders add-iam-policy-binding $FOLDER_ID \
--member="serviceAccount:$SERVICE_ACCOUNT" \
--role="roles/securitycenter.findingsViewer"
gcloud resource-manager folders add-iam-policy-binding $FOLDER_ID \
--member="serviceAccount:$SERVICE_ACCOUNT" \
--role="roles/cloudasset.viewer"
Configuration
Configuration File (init.yaml)
Add the following settings to your init.yaml file:
Required Settings
# Path to service account JSON key file
gcpCredentials: '/path/to/service-account-key.json'
# Scan scope: project, organization, or folder
gcpScanType: 'project'
Scope-Dependent Settings
Based on your gcpScanType, configure the appropriate scope identifier:
# For project scope
gcpProjectId: 'my-gcp-project'
# For organization scope
gcpOrganizationId: '123456789012' # Numeric organization ID
# For folder scope
gcpFolderId: '987654321098' # Numeric folder ID
Optional Settings
# Compliance framework for control mapping
# Options: NIST800-53R5, CIS_GCP, FedRAMP, PCI-DSS, SOC2
gcpComplianceFramework: 'NIST800-53R5'
# Cache time-to-live in hours (reduces API calls)
gcpCacheTTLHours: 8
# Evidence collection mode: attachments or records
gcpEvidenceMode: 'attachments'
Complete Configuration Examples
Project-Level Scanning
gcpCredentials: '/secure/path/gcp-regscale-sa.json'
gcpScanType: 'project'
gcpProjectId: 'my-gcp-project'
Organization-Level Compliance Scanning
gcpCredentials: '/secure/path/gcp-regscale-sa.json'
gcpScanType: 'organization'
gcpOrganizationId: '123456789012'
gcpComplianceFramework: 'FedRAMP'
gcpCacheTTLHours: 8
gcpEvidenceMode: 'attachments'
Folder-Level Scanning
gcpCredentials: '/secure/path/gcp-regscale-sa.json'
gcpScanType: 'folder'
gcpFolderId: '987654321098'
gcpComplianceFramework: 'NIST800-53R5'
Authentication Methods
The GCP integration supports multiple authentication methods to accommodate different deployment scenarios.
Method 1: Service Account JSON File (Recommended for local use)
Store the service account key as a JSON file:
# In init.yaml
gcpCredentials: '/path/to/service-account-key.json'
Or via environment variable:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
Method 2: Base64-Encoded JSON (Recommended for CI/CD and unattended runs)
Encode your credentials for secure storage in environment variables or secrets managers:
# Encode the credentials
cat service-account-key.json | base64 > credentials.b64
# View the encoded string
cat credentials.b64
Configure in init.yaml:
gcpCredentialsJsonBase64: 'eyJ0eXBlIjoic2VydmljZV9hY2NvdW50IiwicHJvamVjdF9pZCI6Li4ufQ=='
Or via environment variable:
export GCP_CREDENTIALS_JSON_BASE64=$(cat service-account-key.json | base64)
Method 3: Raw JSON String
For environments where file storage is not available:
# In init.yaml (ensure proper YAML escaping)
gcpCredentialsJson: '{"type": "service_account", "project_id": "my-project", ...}'
Or via environment variable:
export GCP_CREDENTIALS_JSON='{"type": "service_account", "project_id": "my-project", ...}'
Credential Priority Order
When multiple credential sources are configured, the integration uses this priority order:
- Command-line flags (
--credentials-json-base64,--credentials-json,--credentials-file) - Environment variables (
GCP_CREDENTIALS_JSON_BASE64,GCP_CREDENTIALS_JSON,GOOGLE_APPLICATION_CREDENTIALS) - Configuration file settings (
gcpCredentialsJsonBase64,gcpCredentialsJson,gcpCredentials)
CLI Commands
Authentication Test
Validate your GCP credentials and API access:
# Using credentials file path
regscale gcp authenticate --credentials-file /path/to/key.json
# Using base64-encoded credentials
regscale gcp authenticate --credentials-json-base64 "eyJ0eXBlIjoi..."
Asset Synchronization
Sync GCP resources to RegScale as assets:
# Basic usage
regscale gcp sync_assets --regscale-ssp-id 123
# With scope options
regscale gcp sync_assets --regscale-ssp-id 123 \
--scope organization \
--organization-id 123456789012
# With filtering
regscale gcp sync_assets --regscale-ssp-id 123 \
--asset-types "compute.googleapis.com/Instance,storage.googleapis.com/Bucket" \
--labels "env=prod,team=security"
# Force refresh (bypass cache)
regscale gcp sync_assets --regscale-ssp-id 123 --force-refresh
Options:
| Option | Description |
|---|---|
--regscale-ssp-id | RegScale Security Plan ID (required) |
--scope | Scan scope: project, organization, or folder |
--project-id | GCP project ID (for project scope) |
--organization-id | GCP organization ID (for organization scope) |
--asset-types | Filter by asset types (comma-separated) |
--labels | Filter by GCP labels (e.g., env=prod,team=security) |
--force-refresh | Bypass cache and fetch fresh data |
Findings Synchronization
Sync Security Command Center findings to RegScale as vulnerabilities.
What sync_findings writes
sync_findings writes vulnerabilities to the security plan. It does not write issues. The RegScale platform opens
the issues from these vulnerabilities.
- Findings: one vulnerability for each SCC finding. The key is the finding's own SCC name (for example
organizations/123/sources/456/findings/abc), not its affected resource. So two findings on one resource are two
vulnerabilities. An active finding is Open. A finding that SCC marksINACTIVE(remediated) is Closed. - Control-test rows: Closed vulnerabilities for the passed control tests. The control tests are a fixed list of
50 control and category pairs over 13 NIST controls (AC-2, AC-3, AC-5, AC-6, AU-2, AU-9, AU-11, CA-3, CP-9, IA-2,
SC-7, SC-12 and SI-4). This list is not the category table below. The rows are keyed by category, so the tests of
one category share one row. If all 50 tests pass, the run writes 45 rows. - A control test does not pass, and gets no row, if an active finding in the run maps to its control or has its
category. - A run whose scope is not the
init.yamlscope writes no control-test rows. - With
--generate-evidence, the command also runs the compliance pass thatcollect_evidenceruns, with issue
creation and control-status updates off. That pass syncs assets and writes evidence to the plan. It takes its mode
fromgcpEvidenceMode. It does not run with--dry-run, and it does not use--offsetor--limit.
Which findings sync_findings imports
sync_findings imports every SCC finding that SCC returns for the scope, active or INACTIVE, after these options:
--severity-filterkeeps only the severities that you name.--sourceskeeps only the SCC sources that you name. If no source matches, the command logs a warning and imports
findings from all sources.--offsetand--limitkeep one slice of the run's records: the findings first, then the control-test rows. A
run with either option closes nothing.
A finding takes its NIST controls from its own SCC compliance entries for NIST 800-53. Both sync_findings and
sync_compliance read these entries in the same way, so a tagged finding maps to the same controls in both
commands. If the standard of an entry names 800-53, for example nist-800-53 or NIST SP 800-53, the entry counts.
If the standard is only nist, the entry counts when its version is empty, a revision such as R5, or 800-53.
Entries for other NIST standards, such as nist-csf or nist-800-171, do not count. If a finding has no NIST
800-53 entries, it takes its controls from the category table below. A finding with no control from either source
is still imported, with no control labels.
Warning: do not use --severity-filter or --sources in a run of the init.yaml scope. That run closes the plan's
GCP vulnerabilities that the filter skipped. It also writes passed control-test rows for the controls of the skipped
findings. Use these filters only in a run whose scope is not the init.yaml scope, which closes nothing.
Category-to-control mapping
If a finding carries no NIST 800-53 tags of its own, sync_findings and sync_compliance map it by one table: this
table plus the 9 pairs below. An untagged vulnerability finding whose category is not in the table maps to SI-2 in
both commands. An example is a SOFTWARE_VULNERABILITY (CVE) finding.
| NIST control | Name | SCC categories |
|---|---|---|
| AC-17 | Remote Access | OPEN_SSH_PORT, OPEN_RDP_PORT, PUBLIC_IP_ADDRESS, OPEN_TELNET_PORT, COMPUTE_SECURE_BOOT, OS_LOGIN_DISABLED |
| AC-2 | Account Management | ADMIN_SERVICE_ACCOUNT, USER_MANAGED_SERVICE_ACCOUNT_KEY, SERVICE_ACCOUNT_KEY_NOT_ROTATED, DEFAULT_SERVICE_ACCOUNT_USED, OVER_PRIVILEGED_SERVICE_ACCOUNT_USER, MFA_NOT_ENFORCED |
| AC-3 | Access Enforcement | PUBLIC_BUCKET_ACL, BUCKET_POLICY_ONLY_DISABLED, NON_ORG_IAM_MEMBER, SQL_NO_ROOT_PASSWORD, PUBLIC_DATASET, ALLOYDB_PUBLIC_IP, CLOUD_SQL_PUBLIC_IP |
| AC-4 | Information Flow Enforcement | VPC_FLOW_LOGS_DISABLED, FLOW_LOGS_DISABLED, FIREWALL_RULE_LOGGING_DISABLED, PRIVATE_GOOGLE_ACCESS_DISABLED, LEGACY_NETWORK |
| AC-5 | Separation of Duties | KMS_ROLE_SEPARATION, SERVICE_ACCOUNT_ROLE_SEPARATION, PRIMITIVE_ROLES_USED, KMS_PROJECT_HAS_OWNER |
| AC-6 | Least Privilege | FULL_API_ACCESS, OVER_PRIVILEGED_SERVICE_ACCOUNT_USER, PRIMITIVE_ROLES_USED, OVER_PRIVILEGED_ACCOUNT, KMS_PROJECT_HAS_OWNER, ADMIN_SERVICE_ACCOUNT, OVER_PRIVILEGED_SCOPES |
| AU-12 | Audit Record Generation | AUDIT_LOGGING_DISABLED, FIREWALL_RULE_LOGGING_DISABLED, FLOW_LOGS_DISABLED, LOAD_BALANCER_LOGGING_DISABLED |
| AU-2 | Event Logging | AUDIT_LOGGING_DISABLED, AUDIT_CONFIG_NOT_MONITORED, BUCKET_LOGGING_DISABLED, CLOUD_AUDIT_LOGGING_DISABLED |
| AU-3 | Content of Audit Records | AUDIT_LOGGING_DISABLED, LOG_NOT_EXPORTED, BUCKET_LOGGING_DISABLED |
| AU-6 | Audit Record Review, Analysis, and Reporting | AUDIT_CONFIG_NOT_MONITORED, FLOW_LOGS_DISABLED, DNS_LOGGING_DISABLED, LOG_NOT_EXPORTED |
| AU-9 | Protection of Audit Information | PUBLIC_LOG_BUCKET, LOCKED_RETENTION_POLICY_NOT_SET, OBJECT_VERSIONING_DISABLED, BUCKET_IAM_NOT_MONITORED |
| CA-7 | Continuous Monitoring | FLOW_LOGS_DISABLED, FIREWALL_RULE_LOGGING_DISABLED, AUDIT_LOGGING_DISABLED, WEB_UI_ENABLED, MONITORING_ACCOUNT_NOT_CONFIGURED |
| CM-2 | Baseline Configuration | DEFAULT_SERVICE_ACCOUNT_USED, LEGACY_NETWORK, INSTANCE_TEMPLATE_NOT_FOUND, OUTDATED_LIBRARY |
| CM-6 | Configuration Settings | SQL_NO_ROOT_PASSWORD, SQL_WEAK_ROOT_PASSWORD, COMPUTE_SECURE_BOOT, IP_FORWARDING_ENABLED, SERIAL_PORT_ENABLED, COS_NOT_USED, LEGACY_AUTHORIZATION_ENABLED, INTEGRITY_MONITORING_DISABLED |
| CM-7 | Least Functionality | FULL_API_ACCESS, WEB_UI_ENABLED, SERIAL_PORT_ENABLED, IP_FORWARDING_ENABLED, LEGACY_AUTHORIZATION_ENABLED, LEGACY_METADATA_ENABLED |
| CM-8 | System Component Inventory | ASSET_INVENTORY_DISABLED, RESOURCE_NOT_FOUND |
| CP-9 | System Backup | AUTO_BACKUP_DISABLED, BUCKET_VERSIONING_DISABLED, OBJECT_VERSIONING_DISABLED, SNAPSHOT_NOT_FOUND |
| IA-2 | Identification and Authentication (Organizational Users) | MFA_NOT_ENFORCED, NON_ORG_IAM_MEMBER, OS_LOGIN_DISABLED, TWO_STEP_VERIFICATION_NOT_ENFORCED |
| IA-4 | Identifier Management | ADMIN_SERVICE_ACCOUNT, DEFAULT_SERVICE_ACCOUNT_USED, USER_MANAGED_SERVICE_ACCOUNT_KEY |
| IA-5 | Authenticator Management | SERVICE_ACCOUNT_KEY_NOT_ROTATED, SQL_NO_ROOT_PASSWORD, SQL_WEAK_ROOT_PASSWORD, USER_MANAGED_SERVICE_ACCOUNT_KEY, API_KEY_NOT_ROTATED, API_KEY_NOT_RESTRICTED |
| SC-12 | Cryptographic Key Establishment and Management | KMS_PROJECT_HAS_OWNER, KMS_KEY_NOT_ROTATED, KMS_ROLE_SEPARATION, KMS_PUBLIC_KEY, CMEK_DISABLED |
| SC-13 | Cryptographic Protection | WEAK_SSL_POLICY, CMEK_DISABLED, SQL_CMEK_DISABLED, BUCKET_CMEK_DISABLED, DISK_CSEK_DISABLED |
| SC-28 | Protection of Information at Rest | DISK_CSEK_DISABLED, CMEK_DISABLED, SQL_CMEK_DISABLED, BUCKET_CMEK_DISABLED, DEFAULT_ENCRYPTION_DISABLED |
| SC-7 | Boundary Protection | OPEN_CASSANDRA_PORT, OPEN_CISCOSECURE_WEBSM_PORT, OPEN_DIRECTORY_SERVICES_PORT, OPEN_DNS_PORT, OPEN_ELASTICSEARCH_PORT, OPEN_FTP_PORT, OPEN_HTTP_PORT, OPEN_LDAP_PORT, OPEN_MEMCACHED_PORT, OPEN_MONGODB_PORT, OPEN_MYSQL_PORT, OPEN_NETBIOS_PORT, OPEN_ORACLEDB_PORT, OPEN_POP3_PORT, OPEN_POSTGRESQL_PORT, OPEN_RDP_PORT, OPEN_REDIS_PORT, OPEN_SMTP_PORT, OPEN_SSH_PORT, OPEN_TELNET_PORT, NETWORK_POLICY_DISABLED, PUBLIC_IP_ADDRESS, PUBLIC_SQL_INSTANCE, FIREWALL_RULE_LOGGING_DISABLED, OVER_PRIVILEGED_ACCOUNT, MASTER_AUTHORIZED_NETWORKS_DISABLED, PRIVATE_CLUSTER_DISABLED |
| SC-8 | Transmission Confidentiality and Integrity | SSL_NOT_ENFORCED, WEAK_SSL_POLICY, REDIS_AUTH_DISABLED, COMPUTE_SECURE_BOOT, HTTPS_NOT_ENFORCED, LOAD_BALANCER_SSL_POLICY |
| SI-2 | Flaw Remediation | OUTDATED_LIBRARY, OUTDATED_DEPENDENCIES, VULNERABILITY_FOUND, WEB_VULNERABILITY_FOUND, CONTAINER_VULNERABILITY, AUTO_UPGRADE_DISABLED, NODE_AUTO_UPGRADE_DISABLED |
| SI-3 | Malicious Code Protection | MALWARE_DETECTED, SUSPICIOUS_ACTIVITY_DETECTED, BINARY_AUTHORIZATION_DISABLED, ANTIMALWARE_NOT_ENABLED |
| SI-4 | System Monitoring | FIREWALL_RULE_LOGGING_DISABLED, FLOW_LOGS_DISABLED, AUDIT_LOGGING_DISABLED, DNS_LOGGING_DISABLED, VPC_FLOW_LOGS_DISABLED, CLOUD_ARMOR_LOGGING_DISABLED, THREAT_DETECTION_DISABLED |
These 9 pairs come from the legacy control tests:
| SCC category | Also maps to |
|---|---|
AUDIT_LOGGING_DISABLED | AC-2 |
PUBLIC_BUCKET_ACL | AC-2 |
PUBLIC_DATASET | AC-2 |
LOCKED_RETENTION_POLICY_NOT_SET | AU-11 |
OBJECT_VERSIONING_DISABLED | AU-11 |
PUBLIC_IP_ADDRESS | CA-3 |
PUBLIC_SQL_INSTANCE | CA-3 |
SSL_NOT_ENFORCED | SC-7 |
WEAK_SSL_POLICY | SC-7 |
The table applies to sync_compliance with the NIST800-53R5 or FedRAMP framework. With the CIS_GCP,
PCI-DSS or SOC2 framework, sync_compliance uses that framework's own table. In every framework,
sync_compliance first uses the controls that SCC tags on the finding for that framework.
Commands:
# Basic usage
regscale gcp sync_findings --regscale-ssp-id 123
# With severity filter, for a project other than the init.yaml one (see the warning above)
regscale gcp sync_findings --regscale-ssp-id 123 \
--scope project --project-id my-other-project \
--severity-filter CRITICAL,HIGH
# With source filter, for a project other than the init.yaml one (see the warning above)
regscale gcp sync_findings --regscale-ssp-id 123 \
--scope project --project-id my-other-project \
--sources "SECURITY_HEALTH_ANALYTICS,EVENT_THREAT_DETECTION"
# Generate evidence for findings
regscale gcp sync_findings --regscale-ssp-id 123 \
--generate-evidence \
--control-ids "AC-1,AC-2,SC-7"
--scope, --project-id and --organization-id (or the GCP_PROJECT_ID and GCP_ORGANIZATION_ID environment
variables) choose the project or organization whose findings are synced; each falls back to init.yaml when not given.
A run whose resulting scope is not the init.yaml scope turns off mop-up and sends no passed control assessments, so it
never closes the plan's GCP findings outside that scope. Stale findings are closed only by a run of the init.yaml scope.
If init.yaml holds no gcpProjectId (project scope) or gcpOrganizationId (organization scope), because every run
passes --project-id or --organization-id instead, no run is the init.yaml scope: mop-up and passed control assessments stay off
for every run, so findings that leave SCC stay open. Set gcpScanType and that ID to the plan's GCP scope to have its
runs close them.
Options:
| Option | Description |
|---|---|
--regscale-ssp-id | RegScale Security Plan ID (required) |
--severity-filter | Filter by severity: CRITICAL, HIGH, MEDIUM, LOW |
--sources | Filter by SCC sources (comma-separated) |
--generate-evidence | Also run the compliance pass and write evidence to the plan |
--control-ids | Target specific control IDs |
--project-id | Project whose findings are synced at project scope; defaults to gcpProjectId |
--organization-id | Organization whose findings are synced at organization scope; defaults to gcpOrganizationId |
--scope | Scan scope: project, organization, or folder |
An untagged SOFTWARE_VULNERABILITY (CVE) finding maps to SI-2, as the category-to-control mapping section says. A finding that maps to no control is still imported, with no control labels. The run logs at INFO how many findings had no control. CVE findings carry their CVE id and CVSS v3 base score. Every finding names its affected resource, which links it to the asset that sync_assets created for that resource.
sync_compliance is different: it updates control status, so it uses only the findings it can map to a control.
Compliance Synchronization
Update RegScale control implementation status based on SCC compliance findings:
# Basic usage with default framework (NIST 800-53 R5)
regscale gcp sync_compliance --regscale-ssp-id 123
# Specify compliance framework
regscale gcp sync_compliance --regscale-ssp-id 123 \
--framework FedRAMP
# Create issues for failed controls
regscale gcp sync_compliance --regscale-ssp-id 123 \
--framework NIST800-53R5 \
--create-issues
# Update control status and create POAMs
regscale gcp sync_compliance --regscale-ssp-id 123 \
--framework FedRAMP \
--update-control-status \
--create-poams
Options:
| Option | Description |
|---|---|
--regscale-ssp-id | RegScale Security Plan ID (required) |
--framework | Compliance framework (see Supported Frameworks) |
--create-issues | Create RegScale issues for failed controls |
--update-control-status | Update control implementation status |
--create-poams | Mark failed controls as POAMs |
A control is assessed only on evidence. sync_compliance reads the active SCC findings, and a control fails when an
active finding maps to it. A control that no active finding maps to is left unassessed, so its status in RegScale is not
changed: the absence of a finding is not evidence that the control is met.
A vulnerability finding whose category has no control mapping, such as a SOFTWARE_VULNERABILITY (CVE) finding, is
assessed against the framework's vulnerability controls (SI-2 for NIST 800-53 R5 and FedRAMP), so SI-2 fails while
active CVE findings exist.
sync_findings maps such a finding to SI-2 too. If the framework table does not list a control that SCC tags on an
active finding, the control is still assessed. An example is IA-5(1). If the plan does not have that control, it is
skipped.
Evidence Collection
Collect compliance evidence from GCP for RegScale controls:
# Collect evidence as SSP attachments
regscale gcp collect_evidence --regscale-ssp-id 123 \
--mode attachments
# Collect evidence as individual records
regscale gcp collect_evidence --regscale-ssp-id 123 \
--mode records
# Target specific controls
regscale gcp collect_evidence --regscale-ssp-id 123 \
--control-ids "AC-1,AC-2,AU-2,SC-7"
Options:
| Option | Description |
|---|---|
--regscale-ssp-id | RegScale Security Plan ID (required) |
--mode | Evidence mode: attachments or records |
--control-ids | Target specific control IDs (comma-separated) |
--evidence-frequency | Collection frequency |
Inventory Export
Export GCP resource inventory to a JSON file for analysis:
# Export project inventory
regscale gcp inventory collect \
--scope project \
--project-id my-gcp-project \
--output-file gcp_inventory.json
# Export organization inventory
regscale gcp inventory collect \
--scope organization \
--organization-id 123456789012 \
--output-file org_inventory.json
# Filter by labels
regscale gcp inventory collect \
--scope project \
--project-id my-gcp-project \
--labels "env=prod" \
--output-file prod_inventory.json
Options:
| Option | Description |
|---|---|
--scope | Scan scope: project, organization, or folder |
--project-id | GCP project ID |
--organization-id | GCP organization ID |
--labels | Filter by GCP labels |
--output-file | Output file path |
Supported Compliance Frameworks
The GCP integration maps Security Command Center findings to the following compliance frameworks:
| Framework | Value | Description | Use Case |
|---|---|---|---|
| NIST 800-53 Rev 5 | NIST800-53R5 | NIST Special Publication 800-53 Revision 5 | Federal agencies, FedRAMP authorization |
| CIS GCP Benchmark | CIS_GCP | CIS Google Cloud Platform Foundation Benchmark | General security hardening |
| FedRAMP | FedRAMP | Federal Risk and Authorization Management Program | Cloud services for US government |
| PCI-DSS | PCI-DSS | Payment Card Industry Data Security Standard | Payment processing systems |
| SOC 2 | SOC2 | Service Organization Control 2 | SaaS providers, service organizations |
Framework Selection
Choose the framework that aligns with your compliance requirements:
# In init.yaml
gcpComplianceFramework: 'FedRAMP'
Or via command line:
regscale gcp sync_compliance --regscale-ssp-id 123 --framework FedRAMP
Severity Mapping
GCP Security Command Center finding severities are mapped to RegScale severity levels:
| GCP SCC Severity | RegScale Severity |
|---|---|
| CRITICAL | Critical |
| HIGH | High |
| MEDIUM | Moderate |
| LOW | Low |
Filtering by Severity
To import only some severities, use the --severity-filter option. The command does not read a severity filter from init.yaml. Read the
warning under Findings Synchronization before you use it in a run of the init.yaml scope.
regscale gcp sync_findings --regscale-ssp-id 123 --scope project --project-id my-other-project \
--severity-filter CRITICAL,HIGH,MEDIUM
Inventory Resources
The GCP integration collects the following resource types:
Compute Resources
- Compute Engine instances, disks, images, snapshots
- Instance groups and templates
- GKE clusters and node pools
- Cloud Run services and revisions
- Cloud Functions
- App Engine services and versions
Storage Resources
- Cloud Storage buckets
- Filestore instances and backups
Database Resources
- Cloud SQL instances
- Cloud Spanner instances
- BigTable instances
- Firestore databases
- Memorystore (Redis) instances
- BigQuery datasets
Networking Resources
- VPC networks and subnets
- Firewall rules
- Load balancers
- Cloud NAT gateways
- VPN gateways and tunnels
- Cloud DNS zones
Security Resources
- Service accounts and keys
- IAM policies and custom roles
- KMS key rings and crypto keys
- Security Command Center findings
Logging Resources
- Log sinks
- Log-based metrics
- Audit log configurations
Caching
The GCP integration caches inventory data to reduce API calls and improve performance.
Cache Settings
# Cache time-to-live in hours (default: 8)
gcpCacheTTLHours: 8
Cache Location
- Inventory cache:
artifacts/gcp/inventory.json - Session cache:
~/.regscale/gcp_sessions/
Bypassing Cache
To fetch fresh data and bypass the cache:
regscale gcp sync_assets --regscale-ssp-id 123 --force-refresh
Troubleshooting
Common Issues
"Permission denied" or "403 Forbidden" Errors
Cause: Service account lacks required IAM roles.
Solution:
- Verify the service account has the required roles at the correct scope level
- Organization-level permissions are required for
sync_compliance - Wait a few minutes after granting permissions for propagation
# Verify service account roles
gcloud projects get-iam-policy PROJECT_ID \
--flatten="bindings[].members" \
--filter="bindings.members:serviceAccount:YOUR_SERVICE_ACCOUNT"
"API not enabled" Errors
Cause: Required GCP API is not enabled for the project.
Solution: Enable the required API:
gcloud services enable securitycenter.googleapis.com
gcloud services enable cloudasset.googleapis.com
"Security Command Center is not enabled" Errors
Cause: SCC is not enabled for the organization/project.
Solution:
- Navigate to Security Command Center in the GCP Console
- Enable Security Command Center for your organization
- Wait for initial scan to complete (may take several hours)
Stale or Outdated Data
Cause: Cached data is being returned.
Solution: Use the --force-refresh flag:
regscale gcp sync_assets --regscale-ssp-id 123 --force-refresh
No Findings Returned
Cause: Severity filter is excluding all findings, or no findings exist.
Solution:
- Check the
--severity-filtersetting - Verify Security Health Analytics is enabled in SCC
- Check that findings exist in the SCC Console
# Include all severities: give no --severity-filter
regscale gcp sync_findings --regscale-ssp-id 123
Authentication Failures
Cause: Invalid or expired credentials.
Solution:
- Verify the JSON key file is valid and not corrupted
- Check that the service account has not been deleted
- Generate a new key if necessary
# Test authentication
regscale gcp authenticate --credentials-file /path/to/key.json
Validation Commands
Use these commands to validate your setup:
# Test authentication and credentials
regscale gcp authenticate --credentials-file /path/to/key.json
# Check what assets are visible
regscale gcp inventory collect \
--scope project \
--project-id my-project \
--output-file test_inventory.json
# Verify API access with gcloud
gcloud asset list --project=my-project --limit=5
gcloud scc findings list organizations/ORG_ID --limit=5
Debug Logging
Enable debug logging for detailed troubleshooting:
# Set log level to DEBUG
export LOGLEVEL=DEBUG
# Run command with verbose output
regscale gcp sync_findings --regscale-ssp-id 123
Security Best Practices
- Least Privilege: Grant only the minimum required permissions
- Key Rotation: Rotate service account keys regularly
- Secure Storage: Never commit credentials to version control
- Environment Variables: Use environment variables or secrets managers for CI/CD
- Audit Logging: Enable Cloud Audit Logs to track API access
- Service Account Naming: Use descriptive names to identify purpose (e.g.,
regscale-integration)
Environment Variables Reference
| Variable | Description | Example |
|---|---|---|
GOOGLE_APPLICATION_CREDENTIALS | Path to service account JSON key | /path/to/key.json |
GCP_CREDENTIALS_JSON | Raw JSON credentials string | {"type": "service_account"...} |
GCP_CREDENTIALS_JSON_BASE64 | Base64-encoded JSON credentials | eyJ0eXBlIjoi... |
GCP_PROJECT_ID | GCP project ID | my-gcp-project |
GCP_ORGANIZATION_ID | GCP organization ID | 123456789012 |
Related Resources
Updated 17 days ago
