Skip to main content
Pulumi logo Pulumi logo
  1. Docs
  2. Reference
  3. Pre-built Policy Packs
  4. HITRUST
  5. Google Cloud

HITRUST CSF 11.5 - Google Cloud

    This page lists all 72 policies in the HITRUST CSF 11.5 pack for Google Cloud, as published in hitrust-google-cloud version 2.1.1.

    Policies by control

    01.a Access Control Policy — A privilege management process shall be implemented and include the allocation of different levels of access privileges, the authorization process for such privileges, and the maintenance of all privileges on a system.

    01.b User Registration — There shall be a formal user registration and de-registration procedure in place governing the allocation of access rights to all information systems and services.

    01.c Privilege Management — The allocation and use of privileges shall be restricted and controlled. The use of privileged utility programs shall be restricted and tightly controlled.

    01.p Secure Log-on Procedures — Secure logon procedures shall be implemented to prevent unauthorized access. Where password authentication is used, the system shall enforce a secure password policy.

    01.u Limitation of Connection Time — Connection times shall be limited to minimize the opportunity for unauthorized access.

    01.v Information Access Restriction — Access to systems and applications shall be restricted in accordance with the access control policy.

    06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.

    09.b Change Management — Changes to systems, applications and supporting infrastructure shall be controlled.

    09.d Separation of Development Test and Operational Environments — Segregation of test, development and operational environments shall be maintained to ensure that the test and development environments do not adversely impact the operational environment.

    09.e Service Delivery — Automated logging procedures shall be implemented to enable monitoring and detection of security events.

    09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.

    09.z Publicly Available Information — Publicly available information shall be protected against unauthorized modification or deletion.

    10.c Control of Internal Processing — Controls shall be in place to ensure the correct processing of information in applications.

    10.d Message Integrity — Messages shall be protected against unauthorized modification. Integrity controls shall be applied to detect unauthorized modification of information.

    10.e Output Data Validation — Output data shall be validated to ensure that stored data is not corrupted as a result of processing errors or deliberate acts.

    10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.

    10.h Control of Operational Software — There shall be restrictions on the installation of software by users. Controls shall be in place to restrict access to program source code.

    10.k Change Control Procedures — Change control procedures shall be established to ensure adequate assessment and authorization of all changes to information processing facilities.

    10.m Control of Technical Vulnerabilities — Vulnerabilities shall be identified and associated with risk levels. Technical vulnerabilities of information systems shall be managed in a timely fashion.

    12.a Including Information Security in the Business Continuity Management — Information security continuity shall be embedded in the organization’s business continuity management systems.

    Policy details

    artifactregistry-customer-kms

    Severity: high · Enforcement: advisory

    Require Artifact Registry repositories to use customer-managed Cloud KMS keys for encryption

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Configure Customer-Managed KMS Key
    const repository = new gcp.artifactregistry.Repository("my-repository", {
        repositoryId: "my-repo",
        format: "DOCKER",
        kmsKeyName: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Specify customer-managed KMS key
        // ... other config
    });
    

    artifactregistry-immutable-images

    Severity: medium · Enforcement: advisory

    Require Artifact Registry repositories to disallow mutable images for security and compliance

    • 10.h Control of Operational Software — There shall be restrictions on the installation of software by users. Controls shall be in place to restrict access to program source code.
    Remediation
    Fix: Enable Immutable Tags for Docker Repositories
    const repository = new gcp.artifactregistry.Repository("my-repository", {
        repositoryId: "my-repo",
        format: "DOCKER",
        dockerConfig: {
            immutableTags: true,  // Prevent tag overwrites to ensure image integrity
        },
        // ... other config
    });
    

    bigquery-dataset-kms

    Severity: high · Enforcement: advisory

    Require BigQuery datasets to use customer-managed Cloud KMS keys

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Configure Customer-Managed KMS Key
    const dataset = new gcp.bigquery.Dataset("my-dataset", {
        datasetId: "example_dataset",
        defaultEncryptionConfiguration: {
            kmsKeyName: cryptoKey.id,  // Set customer-managed KMS key for encryption
        },
        // ... other config
    });
    

    bigtable-change-streams

    Severity: medium · Enforcement: advisory

    Require Bigtable tables to have change streams enabled for change tracking

    • 10.c Control of Internal Processing — Controls shall be in place to ensure the correct processing of information in applications.
    Remediation
    Fix: Enable Change Stream Retention
    const bigtableTable = new gcp.bigtable.Table("my-table", {
        instanceName: "my-bigtable-instance",
        changeStreamRetention: "72h0m0s",  // Enable change streams with 3-day retention
        // ... other config
    });
    

    bucket-access-logging

    Severity: medium · Enforcement: advisory

    Require Cloud Storage buckets to have access logging enabled for audit trails

    • 09.e Service Delivery — Automated logging procedures shall be implemented to enable monitoring and detection of security events.
    Remediation
    Fix: Enable Access Logging
    const bucket = new gcp.storage.Bucket("my-bucket", {
        location: "US",
        logging: {
            logBucket: "my-logging-bucket",  // Specify the bucket for access logs
            logObjectPrefix: "bucket-logs/", // Optional prefix for log objects
        },
        // ... other config
    });
    

    bucket-customer-managed-kms

    Severity: high · Enforcement: advisory

    Require Cloud Storage buckets to use customer-managed Cloud KMS keys for encryption

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Configure Customer-Managed KMS Key
    const bucket = new gcp.storage.Bucket("my-bucket", {
        location: "US",
        encryption: {
            defaultKmsKeyName: "projects/my-project/locations/us/keyRings/my-keyring/cryptoKeys/my-key",  // Specify customer-managed KMS key
        },
        // ... other config
    });
    

    bucket-dlp-access

    Severity: medium · Enforcement: advisory

    Require Cloud Storage buckets to have appropriate access for data classification services like Cloud DLP

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Grant DLP Service Account Access
    const bucketIamPolicy = new gcp.storage.BucketIAMPolicy("bucket-iam", {
        bucket: bucket.name,
        policyData: JSON.stringify({
            bindings: [
                {
                    role: "roles/storage.objectViewer",
                    members: [
                        "serviceAccount:service-{project-number}@dlp-api.iam.gserviceaccount.com",  // Grant DLP service account access
                    ],
                },
                // ... other bindings
            ],
        }),
    });
    

    bucket-iam-least-privilege

    Severity: high · Enforcement: advisory

    Enforce least privilege access for Cloud Storage bucket IAM policies

    • 01.v Information Access Restriction — Access to systems and applications shall be restricted in accordance with the access control policy.
    Remediation
    Fix: Use Specific Least Privilege Roles
    // Instead of overly broad roles like storage.admin or storage.objectAdmin
    // Use specific roles based on actual needs:
    
    // For read-only access
    const viewerBinding = new gcp.storage.BucketIAMBinding("viewer-binding", {
        bucket: bucket.name,
        role: "roles/storage.objectViewer",  // Read-only access to objects
        members: ["user:viewer@example.com"],
    });
    
    // For write-only access
    const creatorBinding = new gcp.storage.BucketIAMBinding("creator-binding", {
        bucket: bucket.name,
        role: "roles/storage.objectCreator",  // Write-only access (no read)
        members: ["serviceAccount:app@project.iam.gserviceaccount.com"],
    });
    
    // Avoid these overly broad roles:
    // - roles/storage.admin
    // - roles/storage.objectAdmin
    // - roles/owner
    // - roles/editor
    

    bucket-lifecycle

    Severity: medium · Enforcement: advisory

    Require Cloud Storage buckets to have lifecycle management policies configured

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Configure Lifecycle Rules
    const bucket = new gcp.storage.Bucket("my-bucket", {
        location: "US",
        lifecycleRules: [
            {
                action: {
                    type: "Delete",  // Delete old objects
                },
                condition: {
                    age: 365,  // After 365 days
                },
            },
            {
                action: {
                    type: "SetStorageClass",
                    storageClass: "NEARLINE",  // Archive to cheaper storage
                },
                condition: {
                    age: 90,  // After 90 days
                },
            },
        ],
        // ... other config
    });
    

    bucket-multi-region

    Severity: medium · Enforcement: advisory

    Require Cloud Storage buckets to have multi-region replication for business continuity

    • 12.a Including Information Security in the Business Continuity Management — Information security continuity shall be embedded in the organization’s business continuity management systems.
    Remediation
    Fix: Configure Multi-Region Replication
    // Option 1: Use multi-region location
    const bucket = new gcp.storage.Bucket("my-bucket", {
        location: "US",  // Multi-region location (US, EU, or ASIA)
        // ... other config
    });
    
    // Option 2: Use dual-region location
    const bucket = new gcp.storage.Bucket("my-bucket", {
        location: "NAM4",  // Dual-region location
        // ... other config
    });
    
    // Option 3: Use custom placement with multiple data locations
    const bucket = new gcp.storage.Bucket("my-bucket", {
        location: "US",
        customPlacementConfig: {
            dataLocations: ["US-EAST1", "US-WEST1"],  // Specify at least 2 regions
        },
        // ... other config
    });
    

    bucket-no-public-read

    Severity: critical · Enforcement: advisory

    Require Cloud Storage buckets to disallow public read access

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Enforce Public Access Prevention
    const bucket = new gcp.storage.Bucket("my-bucket", {
        location: "US",
        publicAccessPrevention: "enforced",  // Prevent all public access
        // ... other config
    });
    

    bucket-uniform-access

    Severity: high · Enforcement: advisory

    Require Cloud Storage buckets to have uniform bucket-level access enabled

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Enable Uniform Bucket-Level Access
    const bucket = new gcp.storage.Bucket("my-bucket", {
        location: "US",
        uniformBucketLevelAccess: true,  // Enable uniform bucket-level access
        // ... other config
    });
    

    bucket-versioning

    Severity: medium · Enforcement: advisory

    Ensure Cloud Storage bucket versioning is enabled

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation

    Enable versioning on Cloud Storage buckets by setting versioning.enabled to true to protect against accidental deletion or modification.

    Example Pulumi TypeScript:

    import * as gcp from "@pulumi/gcp";
    
    const bucket = new gcp.storage.Bucket("versioned-bucket", {
        location: "US",
        versioning: {
            enabled: true,
        },
    });
    

    Example Pulumi TypeScript:

    import * as gcp from "@pulumi/gcp";
    
    const bucket = new gcp.storage.Bucket("my-bucket", {
        location: "US",
        versioning: {
            enabled: true,
        },
    });
    

    cloud-armor

    Severity: high · Enforcement: advisory

    Require public-facing applications to have Cloud Armor protection

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Configure Cloud Armor Security Policy
    // Create Cloud Armor security policy with protection rules
    const securityPolicy = new gcp.compute.SecurityPolicy("web-security-policy", {
        rules: [
            {
                action: "rate_based_ban",
                priority: 1000,
                match: {
                    versionedExpr: "SRC_IPS_V1",
                    config: {
                        srcIpRanges: ["*"],
                    },
                },
                rateLimitOptions: {
                    conformAction: "allow",
                    exceedAction: "deny(429)",
                    rateLimitThreshold: {
                        count: 100,
                        intervalSec: 60,
                    },
                },
                description: "Rate limiting rule",
            },
        ],
    });
    
    // Attach security policy to backend service
    const backendService = new gcp.compute.BackendService("web-backend", {
        protocol: "HTTPS",
        securityPolicy: securityPolicy.id,  // Attach Cloud Armor for DDoS and WAF protection
        // ... other config
    });
    

    cloud-build-logging

    Severity: medium · Enforcement: advisory

    Require Cloud Build triggers to have secure logging configurations

    • 09.z Publicly Available Information — Publicly available information shall be protected against unauthorized modification or deletion.
    Remediation
    Fix: Configure Secure Logging
    const trigger = new cloudbuild.Trigger("my-trigger", {
        build: {
            logsBucket: "gs://my-logs-bucket/build-logs",  // Configure centralized logs bucket
            options: {
                logging: "CLOUD_LOGGING_ONLY",  // Use Cloud Logging for audit trails
            },
            // ... other config
        },
        // ... other config
    });
    

    cloud-cdn-armor

    Severity: medium · Enforcement: advisory

    Require Cloud CDN to have Cloud Armor configuration for DDoS protection

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Attach Cloud Armor Security Policy to CDN
    // Create a Cloud Armor security policy
    const securityPolicy = new gcp.compute.SecurityPolicy("cdn-security-policy", {
        rules: [{
            action: "deny(403)",
            priority: 1000,
            match: {
                versionedExpr: "SRC_IPS_V1",
                config: {
                    srcIpRanges: ["9.9.9.0/24"],
                },
            },
            description: "Deny access to example IP range",
        }],
    });
    
    // For BackendService: attach security policy
    const backendService = new gcp.compute.BackendService("cdn-backend", {
        enableCdn: true,
        securityPolicy: securityPolicy.id,  // Attach Cloud Armor policy for DDoS protection
        // ... other config
    });
    
    // For BackendBucket: attach edge security policy
    const backendBucket = new gcp.compute.BackendBucket("cdn-bucket-backend", {
        enableCdn: true,
        edgeSecurityPolicy: securityPolicy.id,  // Attach Cloud Armor policy for DDoS protection
        // ... other config
    });
    

    cloud-cdn-origin-tls

    Severity: high · Enforcement: advisory

    Require Cloud CDN to use secure TLS to origin

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Enable HTTPS Protocol for CDN Backend Service
    const backendService = new gcp.compute.BackendService("cdn-backend", {
        enableCdn: true,
        protocol: "HTTPS",  // Use HTTPS for secure communication to origin
        // ... other config
    });
    

    cloud-tasks-retry-configuration

    Severity: medium · Enforcement: advisory

    Require Cloud Tasks queues to have proper retry configuration for business continuity

    • 12.a Including Information Security in the Business Continuity Management — Information security continuity shall be embedded in the organization’s business continuity management systems.
    Remediation
    Fix: Configure Retry Policy with Max Attempts
    const queue = new gcp.cloudtasks.Queue("my-queue", {
        retryConfig: {
            maxAttempts: 10,  // Set reasonable max retry attempts
            maxRetryDuration: "3600s",  // Set max retry duration (1 hour)
            minBackoff: "0.1s",
            maxBackoff: "3600s",
        },
        // ... other config
    });
    

    cloudfunctions-documentation

    Severity: low · Enforcement: advisory

    Require Cloud Functions to have adequate documentation

    • 09.b Change Management — Changes to systems, applications and supporting infrastructure shall be controlled.
    Remediation
    Fix: Add Function Documentation
    const func = new gcp.cloudfunctions.Function("my-function", {
        description: "Processes customer orders from Pub/Sub and stores results in BigQuery",  // Add descriptive documentation
        labels: {
            purpose: "order-processing",  // Document function purpose
            team: "backend-team",  // Document ownership
            // ... other labels
        },
        // ... other config
    });
    

    cloudfunctions-execution-time

    Severity: low · Enforcement: advisory

    Limit Cloud Functions execution time to prevent extended access

    • 01.u Limitation of Connection Time — Connection times shall be limited to minimize the opportunity for unauthorized access.
    Remediation
    Fix: Limit Execution Timeout
    const func = new gcp.cloudfunctions.Function("my-function", {
        timeout: 60,  // Set reasonable timeout in seconds (max 540)
        // ... other config
    });
    
    // For Cloud Functions v2
    const funcV2 = new gcp.cloudfunctionsv2.Function("my-function-v2", {
        serviceConfig: {
            timeoutSeconds: 60,  // Set reasonable timeout in seconds (max 540)
        },
        // ... other config
    });
    

    cloudfunctions-iam-source-restrictions

    Severity: high · Enforcement: advisory

    Require Cloud Functions IAM bindings to configure source restrictions

    • 01.c Privilege Management — The allocation and use of privileges shall be restricted and controlled. The use of privileged utility programs shall be restricted and tightly controlled.
    Remediation
    Fix: Use Specific IAM Members
    const iamMember = new gcp.cloudfunctions.FunctionIamMember("my-function-invoker", {
        cloudFunction: myFunction.name,
        role: "roles/cloudfunctions.invoker",
        member: "serviceAccount:my-service@project.iam.gserviceaccount.com",  // Use specific service account instead of allUsers
        // ... other config
    });
    

    cloudfunctions-kms-env-vars

    Severity: medium · Enforcement: advisory

    Require Cloud Functions environment variables to be encrypted with Cloud KMS

    • 10.d Message Integrity — Messages shall be protected against unauthorized modification. Integrity controls shall be applied to detect unauthorized modification of information.
    Remediation
    Fix: Encrypt Environment Variables with KMS
    const func = new gcp.cloudfunctions.Function("my-function", {
        environmentVariables: {
            API_KEY: "sensitive-value",
            DATABASE_URL: "postgres://...",
        },
        kmsKeyName: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Add KMS key for encryption
        // ... other config
    });
    

    cloudfunctions-logging

    Severity: low · Enforcement: advisory

    Require Cloud Functions to have logging configuration enabled

    • 10.e Output Data Validation — Output data shall be validated to ensure that stored data is not corrupted as a result of processing errors or deliberate acts.
    Remediation
    Fix: Enable Logging Configuration
    const func = new gcp.cloudfunctions.Function("my-function", {
        environmentVariables: {
            LOG_FORMAT: "json",  // Enable structured logging
            LOG_LEVEL: "INFO",  // Set appropriate log level
        },
        labels: {
            "log-sink": "cloud-logging",  // Configure log sink
        },
        // ... other config
    });
    

    cloudfunctions-runtime-versions

    Severity: medium · Enforcement: advisory

    Restrict Cloud Functions to approved runtime versions only

    • 10.h Control of Operational Software — There shall be restrictions on the installation of software by users. Controls shall be in place to restrict access to program source code.
    Remediation
    Fix: Use Approved Runtime Version
    const func = new gcp.cloudfunctions.Function("my-function", {
        runtime: "nodejs20",  // Use current supported runtime (e.g., nodejs20, python311, go121)
        // ... other config
    });
    

    cloudsql-backup

    Severity: medium · Enforcement: advisory

    Require Cloud SQL instances to have backup retention enabled

    • 12.a Including Information Security in the Business Continuity Management — Information security continuity shall be embedded in the organization’s business continuity management systems.
    Remediation
    Fix: Enable Backup Configuration
    const sqlInstance = new gcp.sql.DatabaseInstance("my-sql-instance", {
        databaseVersion: "POSTGRES_15",
        settings: {
            backupConfiguration: {
                enabled: true,  // Enable backups
                pointInTimeRecoveryEnabled: true,  // Enable PITR for PostgreSQL/MySQL
            },
            // ... other config
        },
    });
    

    cloudsql-high-availability

    Severity: medium · Enforcement: advisory

    Ensure Cloud SQL instances have regional high availability enabled

    • 12.a Including Information Security in the Business Continuity Management — Information security continuity shall be embedded in the organization’s business continuity management systems.
    Remediation

    Enable regional high availability for Cloud SQL instances by setting availabilityType to ‘REGIONAL’. This provides automatic failover and data replication across zones within a region.

    Example Pulumi TypeScript:

    import * as gcp from "@pulumi/gcp";
    
    const instance = new gcp.sql.DatabaseInstance("my-db-instance", {
        databaseVersion: "POSTGRES_15",
        region: "us-central1",
        settings: {
            tier: "db-f1-micro",
            availabilityType: "REGIONAL",
        },
    });
    

    cloudsql-patching

    Severity: medium · Enforcement: advisory

    Require Cloud SQL instances to use managed service patching

    • 10.k Change Control Procedures — Change control procedures shall be established to ensure adequate assessment and authorization of all changes to information processing facilities.
    Remediation
    Fix: Configure Maintenance Window for Automatic Patching
    const sqlInstance = new gcp.sql.DatabaseInstance("my-sql-instance", {
        databaseVersion: "POSTGRES_15",
        settings: {
            maintenanceWindow: {
                updateTrack: "stable",  // Use stable update track for patching
                day: 7,  // Saturday (1=Sunday, 7=Saturday)
                hour: 3,  // 3 AM
            },
            // ... other config
        },
    });
    

    cloudsql-private-ip

    Severity: critical · Enforcement: advisory

    Restrict public access for Cloud SQL instances

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation

    Disable public IP by setting ipv4Enabled to false and configure privateNetwork in ipConfiguration. Remove authorized networks that allow 0.0.0.0/0 access.

    Example Pulumi TypeScript:

    import * as gcp from "@pulumi/gcp";
    
    const instance = new gcp.sql.DatabaseInstance("my-db-instance", {
        databaseVersion: "POSTGRES_15",
        region: "us-central1",
        settings: {
            tier: "db-f1-micro",
            ipConfiguration: {
                ipv4Enabled: false,
                privateNetwork: "projects/my-project/global/networks/my-vpc",
            },
        },
    });
    

    cloudsql-secure-credentials

    Severity: high · Enforcement: advisory

    Require Cloud SQL instances to use secure master credentials management

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Use IAM Authentication and Secure Password Management
    // For Cloud SQL instance: Enable IAM authentication
    const sqlInstance = new gcp.sql.DatabaseInstance("my-sql-instance", {
        databaseVersion: "POSTGRES_15",
        settings: {
            databaseFlags: [
                {
                    name: "cloudsql_iam_authentication",
                    value: "on",  // Enable IAM authentication
                },
            ],
            passwordValidationPolicy: {
                enablePasswordPolicy: true,  // Enable password validation
            },
            // ... other config
        },
        // Do not set rootPassword - use auto-generated or Secret Manager
    });
    
    // For Cloud SQL users: Use IAM-based authentication
    const sqlUser = new gcp.sql.User("my-sql-user", {
        instance: sqlInstance.name,
        name: "user@example.com",
        type: "CLOUD_IAM_USER",  // Use IAM user type instead of built-in
        // Do not set password field for IAM users
    });
    

    cloudsql-ssl

    Severity: high · Enforcement: advisory

    Require Cloud SQL connections to use SSL/TLS encryption

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Require SSL/TLS for All Connections
    const sqlInstance = new gcp.sql.DatabaseInstance("my-sql-instance", {
        databaseVersion: "POSTGRES_15",
        settings: {
            ipConfiguration: {
                sslMode: "ENCRYPTED_ONLY",  // Require SSL/TLS for all connections
                // ... other config
            },
        },
    });
    

    compute-instance-encrypted-attached-disk

    Severity: medium · Enforcement: advisory

    Require Compute Engine instances to have encrypted attached disks

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Encrypt Attached Disks with CMEK
    const instance = new compute.Instance("my-instance", {
        attachedDisks: [{
            source: myDisk.selfLink,
            kmsKeySelfLink: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Use CMEK for attached disk encryption
        }],
        // ... other config
    });
    

    compute-instance-encrypted-boot-disk

    Severity: medium · Enforcement: advisory

    Require Compute Engine instances to have encrypted boot disks

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Enable Boot Disk Encryption with CMEK
    const instance = new compute.Instance("my-instance", {
        bootDisk: {
            initializeParams: {
                image: "debian-cloud/debian-11",
            },
            kmsKeySelfLink: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Use customer-managed encryption key
        },
        // ... other config
    });
    

    compute-no-public-ip

    Severity: high · Enforcement: advisory

    Ensure Compute Engine instances are not publicly accessible

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation

    Remove accessConfigs from networkInterfaces to disable external IP assignment:

    new gcp.compute.Instance("my-instance", {
      networkInterfaces: [{
        network: "my-vpc",
        subnetwork: "my-subnet",
        // accessConfigs: [], // Remove or set to empty array
      }],
      canIpForward: false,
    });
    

    Use Cloud NAT or load balancers for controlled external access.

    compute-osconfig-vulnerability

    Severity: medium · Enforcement: advisory

    Require OS Config agent for vulnerability management on compute instances

    • 10.m Control of Technical Vulnerabilities — Vulnerabilities shall be identified and associated with risk levels. Technical vulnerabilities of information systems shall be managed in a timely fashion.
    Remediation
    Fix: Enable OS Config Agent
    const instance = new compute.Instance("my-instance", {
        metadata: {
            "enable-osconfig": "TRUE",  // Enable OS Config for vulnerability scanning
            "enable-guest-attributes": "TRUE",  // Enable guest attributes for older agent versions
        },
        // ... other config
    });
    

    database-network-access

    Severity: critical · Enforcement: advisory

    Enforce strict network access controls for database resources

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Configure Strict Network Access Controls
    const sqlInstance = new gcp.sql.DatabaseInstance("my-sql-instance", {
        databaseVersion: "POSTGRES_15",
        settings: {
            ipConfiguration: {
                ipv4Enabled: false,  // Disable public IP
                privateNetwork: "projects/my-project/global/networks/my-vpc",  // Use private network
                sslMode: "ENCRYPTED_ONLY",  // Require SSL/TLS
                // Do not include overly broad authorized networks
            },
        },
        deletionProtection: true,  // Enable deletion protection
        // ... other config
    });
    

    dataflow-kms

    Severity: high · Enforcement: advisory

    Require Dataflow jobs and pipelines to use customer-managed Cloud KMS keys

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Configure KMS Encryption for Dataflow
    const job = new dataflow.Job("my-job", {
        kmsKeyName: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Use CMEK for data encryption
        // ... other config
    });
    
    // For Dataflow Pipeline
    const pipeline = new dataflow.Pipeline("my-pipeline", {
        workload: {
            dataflowFlexTemplateRequest: {
                launchParameter: {
                    environment: {
                        kmsKeyName: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Use CMEK for data encryption
                    },
                },
            },
        },
        // ... other config
    });
    

    environment-label

    Severity: low · Enforcement: advisory

    Require all labelable resources to have an environment label

    • 09.d Separation of Development Test and Operational Environments — Segregation of test, development and operational environments shall be maintained to ensure that the test and development environments do not adversely impact the operational environment.
    Remediation
    Fix: Add Valid Environment Label

    Add an environment label with a valid value (development, staging, or production) to your GCP resources:

    const instance = new gcp.compute.Instance("my-instance", {
        labels: {
            environment: "production",  // Required: valid environment label
            // ... other labels
        },
        // ... other config
    });
    
    // For Cloud SQL instances, use userLabels within settings
    const sqlInstance = new gcp.sql.DatabaseInstance("my-database", {
        settings: {
            userLabels: {
                environment: "staging",  // Required: valid environment label
            },
            // ... other settings
        },
        // ... other config
    });
    
    // For GKE clusters, use resourceLabels
    const cluster = new gcp.container.Cluster("my-cluster", {
        resourceLabels: {
            environment: "development",  // Required: valid environment label
        },
        // ... other config
    });
    

    filestore-customer-kms

    Severity: low · Enforcement: advisory

    Require Filestore instances to use customer-managed Cloud KMS keys for encryption

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Configure Customer-Managed KMS Key
    const filestoreKey = new gcp.kms.CryptoKey("filestore-key", {
        name: "filestore-key",
        keyRing: filestoreKeyring.id,
    });
    
    const instance = new gcp.filestore.Instance("instance", {
        tier: "ENTERPRISE",
        kmsKeyName: filestoreKey.id,  // Specify customer-managed KMS key
        // ... other config
    });
    

    firestore-pitr

    Severity: medium · Enforcement: advisory

    Firestore databases must have Point-In-Time Recovery (PITR) enabled for business continuity

    • 12.a Including Information Security in the Business Continuity Management — Information security continuity shall be embedded in the organization’s business continuity management systems.
    Remediation
    Fix: Enable Point-In-Time Recovery
    const firestoreDb = new gcp.firestore.Database("my-firestore-db", {
        name: "my-database",
        locationId: "us-central",
        type: "FIRESTORE_NATIVE",
        pointInTimeRecoveryEnablement: "POINT_IN_TIME_RECOVERY_ENABLED",  // Enable PITR
        // ... other config
    });
    

    firewall-no-http-ingress

    Severity: critical · Enforcement: advisory

    Require firewall rules to disallow inbound HTTP traffic from unauthorized sources

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Use HTTPS Instead of HTTP
    const firewallRule = new gcp.compute.Firewall("allow-https", {
        network: network.id,
        direction: "INGRESS",
        allows: [{
            protocol: "tcp",
            ports: ["443"],  // Use HTTPS (port 443) instead of HTTP (port 80)
        }],
        sourceRanges: ["0.0.0.0/0"],
        // ... other config
    });
    

    firewall-no-public-ingress

    Severity: critical · Enforcement: advisory

    Require firewall rules to disallow public internet ingress unless specifically authorized

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Use Private Network Ranges or Source Tags
    const firewallRule = new gcp.compute.Firewall("allow-private-ingress", {
        network: network.id,
        direction: "INGRESS",
        allows: [{
            protocol: "tcp",
            ports: ["443"],
        }],
        sourceRanges: ["10.0.0.0/8", "192.168.0.0/16"],  // Use private ranges instead of 0.0.0.0/0
        // Or use source tags for internal traffic control:
        // sourceTags: ["web-tier"],
        // ... other config
    });
    

    firewall-ssh-rdp

    Severity: high · Enforcement: advisory

    Enforce firewall rule restrictions for SSH and RDP access

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Restrict SSH/RDP Access to Specific Sources
    const firewallRule = new gcp.compute.Firewall("allow-ssh-restricted", {
        network: network.id,
        direction: "INGRESS",
        allows: [{
            protocol: "tcp",
            ports: ["22"],
        }],
        sourceRanges: ["10.0.0.0/8", "192.168.1.0/24"],  // Restrict to specific IP ranges, not 0.0.0.0/0
        targetTags: ["ssh-access"],
        // ... other config
    });
    

    firewall-strict

    Severity: high · Enforcement: advisory

    Enforce strict firewall rules with explicit allow/deny configuration

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Configure Explicit and Restrictive Firewall Rules
    const firewallRule = new gcp.compute.Firewall("strict-firewall-rule", {
        network: network.id,
        direction: "INGRESS",  // Explicitly specify direction
        allows: [{
            protocol: "tcp",
            ports: ["443"],  // Specify explicit ports, not all ports
        }],
        sourceRanges: ["10.0.0.0/24"],  // Use restrictive source ranges for sensitive ports
        targetTags: ["web-servers"],  // Specify explicit targets
        // ... other config
    });
    

    gke-private-endpoints

    Severity: high · Enforcement: advisory

    Require GKE cluster API endpoints to be private

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation
    Fix: Enable Private Cluster Configuration
    const cluster = new gcp.container.Cluster("my-cluster", {
        privateClusterConfig: {
            enablePrivateEndpoint: true,  // Restrict control plane access to private networks
            enablePrivateNodes: true,      // Assign only private IPs to cluster nodes
            masterIpv4CidrBlock: "172.16.0.0/28",  // CIDR block for the master
        },
        // ... other config
    });
    

    gke-secrets-encryption

    Severity: high · Enforcement: advisory

    Require GKE clusters to have Application-layer Secrets Encryption enabled

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Enable Application-layer Secrets Encryption
    const cluster = new gcp.container.Cluster("my-cluster", {
        databaseEncryption: {
            state: "ENCRYPTED",  // Enable secrets encryption
            keyName: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Specify KMS key
        },
        // ... other config
    });
    

    hardcoded-secrets

    Severity: critical · Enforcement: advisory

    Prohibit hardcoded secrets in code and configuration

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Remove Hardcoded Secrets

    Remove hardcoded secrets from resource configuration.

    Example Violations

    Compute Instance with hardcoded secrets:

    const instance = new gcp.compute.Instance("my-instance", {
        machineType: "e2-medium",
        bootDisk: { /* ... */ },
        networkInterfaces: [{ /* ... */ }],
        metadataStartupScript: `#!/bin/bash
    export DATABASE_PASSWORD="mySecretPassword123"
    export API_KEY="AIzaSyAbc123def456ghi789jkl012mno345pqr678"
    mysql -u admin -p"hardcodedPassword" -h db.example.com
    `,
    });
    

    Cloud Function with hardcoded environment variables:

    const cloudFunction = new gcp.cloudfunctions.Function("my-function", {
        runtime: "nodejs20",
        environmentVariables: {
            "DATABASE_PASSWORD": "mySecretPassword123",
            "API_KEY": "AIzaSyAbc123def456ghi789jkl012mno345pqr678",
        },
    });
    

    Cloud SQL with hardcoded root password:

    const sqlInstance = new gcp.sql.DatabaseInstance("my-db", {
        databaseVersion: "POSTGRES_15",
        rootPassword: "myHardcodedPassword123",
    });
    

    iam-no-broad-roles

    Severity: critical · Enforcement: advisory

    Enforce least privilege access control by prohibiting overly broad roles

    • 01.c Privilege Management — The allocation and use of privileges shall be restricted and controlled. The use of privileged utility programs shall be restricted and tightly controlled.
    Remediation
    Fix: Use Specific Least-Privilege Roles
    const binding = new gcp.projects.IAMBinding("service-binding", {
        project: "my-project",
        role: "roles/storage.objectViewer",  // Use specific roles instead of broad ones
        members: [
            "serviceAccount:my-app@my-project.iam.gserviceaccount.com",
        ],
        // Avoid overly broad roles like:
        // - roles/owner (full project access)
        // - roles/editor (write access to most resources)
        // Use specific roles: roles/storage.objectViewer, roles/pubsub.publisher, etc.
    });
    

    instance-template-customer-kms

    Severity: high · Enforcement: advisory

    Require instance templates to use customer-managed Cloud KMS keys for disk encryption

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Configure Customer-Managed KMS Keys
    const template = new gcp.compute.InstanceTemplate("my-template", {
        disks: [{
            boot: true,
            sourceImage: "debian-cloud/debian-11",
            diskEncryptionKey: {
                kmsKeySelfLink: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Use CMEK for disk encryption
            },
        }],
        // ... other config
    });
    

    instance-template-encrypted-boot-disk

    Severity: medium · Enforcement: advisory

    Require instance templates to have encrypted boot disks

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Enable Boot Disk Encryption
    const template = new compute.InstanceTemplate("my-template", {
        disks: [{
            boot: true,
            sourceImage: "debian-cloud/debian-11",
            diskEncryptionKey: {
                kmsKeySelfLink: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Enable encryption with KMS key
            },
        }],
        // ... other config
    });
    

    instance-template-encrypted-disk

    Severity: medium · Enforcement: advisory

    Require instance templates to have encrypted disks

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Enable Disk Encryption
    const template = new compute.InstanceTemplate("my-template", {
        disks: [{
            boot: true,
            sourceImage: "debian-cloud/debian-11",
            diskEncryptionKey: {
                kmsKeySelfLink: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Enable encryption for all disks
            },
        }],
        // ... other config
    });
    

    instance-template-no-public-ip

    Severity: high · Enforcement: advisory

    Ensure Managed Instance Group launch templates have public IP addresses disabled

    • 09.m Network Controls — Networks shall be managed and controlled in order to protect the organization from threats and to maintain security for the systems and applications using the network, including information in transit.
    Remediation

    Disable public IP in instance template:

    new gcp.compute.InstanceTemplate("my-template", {
      networkInterfaces: [{
        network: "my-vpc",
        subnetwork: "my-subnet",
        accessConfigs: [], // Empty array disables public IP
      }],
      // ... other config
    });
    

    This prevents unintended public accessibility.

    kms-key-configuration

    Severity: low · Enforcement: advisory

    Require proper Cloud KMS key creation and configuration

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Configure KMS Key with Version Template
    const cryptoKey = new gcp.kms.CryptoKey("my-crypto-key", {
        name: "my-key",
        keyRing: keyRing.id,
        versionTemplate: {
            algorithm: "GOOGLE_SYMMETRIC_ENCRYPTION",  // Specify cryptographic algorithm
            protectionLevel: "HSM",  // Set protection level (SOFTWARE, HSM, EXTERNAL, EXTERNAL_VPC)
        },
        rotationPeriod: "7776000s",  // Optional: Configure 90-day rotation period
        purpose: "ENCRYPT_DECRYPT",  // Optional: Explicitly set key purpose
        // ... other config
    });
    

    kms-key-iam

    Severity: high · Enforcement: advisory

    Require proper access controls for Cloud KMS key IAM policies

    • 01.a Access Control Policy — A privilege management process shall be implemented and include the allocation of different levels of access privileges, the authorization process for such privileges, and the maintenance of all privileges on a system.
    Remediation
    Fix: Use Least-Privilege IAM Roles
    // Use specific roles instead of overprivileged roles
    const cryptoKeyBinding = new gcp.kms.CryptoKeyIAMBinding("key-access", {
        cryptoKeyId: cryptoKey.id,
        role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",  // Use specific role
        members: [
            "serviceAccount:my-service@project.iam.gserviceaccount.com",  // Use specific service accounts
            "group:security-team@example.com",  // Or specific groups
        ],
        // Avoid: roles/owner, roles/editor, roles/cloudkms.admin
        // Avoid: allUsers, allAuthenticatedUsers, domain-wide access
        // ... other config
    });
    

    kms-key-lifecycle

    Severity: low · Enforcement: advisory

    Require proper Cloud KMS key deletion and lifecycle management

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Configure Key Lifecycle Management
    const cryptoKey = new kms.CryptoKey("my-crypto-key", {
        name: "my-key",
        keyRing: keyRing.id,
        destroyScheduledDuration: "2592000s",  // Set 30-day scheduled destruction period
        skipInitialVersionCreation: false,  // Create initial key version
        versionTemplate: {
            algorithm: "GOOGLE_SYMMETRIC_ENCRYPTION",
            protectionLevel: "SOFTWARE",
        },
        // ... other config
    });
    

    kms-key-rotation

    Severity: high · Enforcement: advisory

    Require Cloud KMS keys to have key rotation enabled

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Enable Automatic Key Rotation
    const cryptoKey = new kms.CryptoKey("my-crypto-key", {
        name: "my-key",
        keyRing: keyRing.id,
        rotationPeriod: "7776000s",  // Enable rotation every 90 days
        versionTemplate: {
            algorithm: "GOOGLE_SYMMETRIC_ENCRYPTION",
            protectionLevel: "SOFTWARE",
        },
        // ... other config
    });
    

    load-balancer-health-checks

    Severity: medium · Enforcement: advisory

    Require Cloud Load Balancers to enable health checks for monitoring backend instance health

    • 12.a Including Information Security in the Business Continuity Management — Information security continuity shall be embedded in the organization’s business continuity management systems.
    Remediation
    Fix: Configure Health Checks for Backend Service
    // Create a health check
    const healthCheck = new gcp.compute.HealthCheck("backend-health-check", {
        httpHealthCheck: {
            port: 80,
            requestPath: "/health",
        },
        checkIntervalSec: 10,
        timeoutSec: 5,
    });
    
    // Attach health check to backend service
    const backendService = new gcp.compute.BackendService("my-backend", {
        healthChecks: [healthCheck.id],  // Configure health checks for monitoring
        backends: [/* ... */],
        // ... other config
    });
    

    load-balancer-logging

    Severity: low · Enforcement: advisory

    Enable Load Balancer logging for monitoring

    • 09.z Publicly Available Information — Publicly available information shall be protected against unauthorized modification or deletion.
    Remediation

    Enable logging on backend services by configuring logConfig.enable: true and set logConfig.sampleRate (1.0 for full logging, lower values for sampling). Ensure logs are retained in Cloud Logging for security analysis and troubleshooting.

    Pulumi TypeScript Example:

    import * as gcp from "@pulumi/gcp";
    
    // For global backend service
    const backendService = new gcp.compute.BackendService("my-backend", {
        logConfig: {
            enable: true,
            sampleRate: 1.0  // 1.0 = 100% logging, 0.5 = 50% sampling
        },
        // ... other configuration
    });
    
    // For regional backend service
    const regionBackendService = new gcp.compute.RegionBackendService("my-region-backend", {
        logConfig: {
            enable: true,
            sampleRate: 1.0
        },
        // ... other configuration
    });
    

    load-balancer-multi-zone

    Severity: medium · Enforcement: advisory

    Require Cloud Load Balancers to be configured across multiple zones for high availability

    • 12.a Including Information Security in the Business Continuity Management — Information security continuity shall be embedded in the organization’s business continuity management systems.
    Remediation
    Fix: Configure Backends Across Multiple Zones
    // Create instance groups in multiple zones
    const instanceGroup1 = new gcp.compute.InstanceGroup("backend-zone-a", {
        zone: "us-central1-a",
        instances: [/* ... */],
    });
    
    const instanceGroup2 = new gcp.compute.InstanceGroup("backend-zone-b", {
        zone: "us-central1-b",
        instances: [/* ... */],
    });
    
    // Configure backend service with multi-zone backends
    const backendService = new gcp.compute.BackendService("multi-zone-backend", {
        backends: [
            { group: instanceGroup1.id },  // Backend in zone A
            { group: instanceGroup2.id },  // Backend in zone B for high availability
        ],
        // ... other config
    });
    

    load-balancer-tls

    Severity: high · Enforcement: advisory

    Ensure Load Balancer uses TLS/HTTPS listeners only

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation

    Configure forwarding rules to use port 443 for HTTPS traffic. Use TargetHttpsProxy instead of TargetHttpProxy. For HTTP listeners, ensure they redirect to HTTPS via URL map configuration. Remove standalone HTTP listeners without HTTPS redirection.

    Pulumi TypeScript Example:

    import * as gcp from "@pulumi/gcp";
    
    // Create SSL certificate (or use existing)
    const sslCert = new gcp.compute.ManagedSslCertificate("my-cert", {
        managed: {
            domains: ["example.com"]
        }
    });
    
    // Create HTTPS target proxy
    const httpsProxy = new gcp.compute.TargetHttpsProxy("https-proxy", {
        urlMap: urlMap.id,
        sslCertificates: [sslCert.id]
    });
    
    // Create forwarding rule on port 443
    const httpsForwardingRule = new gcp.compute.GlobalForwardingRule("https-rule", {
        target: httpsProxy.id,
        portRange: "443",
        ipProtocol: "TCP",
        loadBalancingScheme: "EXTERNAL"
    });
    
    // Optional: HTTP to HTTPS redirect
    const httpProxy = new gcp.compute.TargetHttpProxy("http-proxy", {
        urlMap: redirectUrlMap.id  // URL map configured for redirect
    });
    
    const httpForwardingRule = new gcp.compute.GlobalForwardingRule("http-rule", {
        target: httpProxy.id,
        portRange: "80",
        ipProtocol: "TCP",
        loadBalancingScheme: "EXTERNAL"
    });
    

    persistent-disk-customer-kms

    Severity: high · Enforcement: advisory

    Require Persistent Disks to use customer-managed encryption keys

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Enable Customer-Managed Encryption Keys
    const disk = new compute.Disk("my-disk", {
        diskEncryptionKey: {
            kmsKeySelfLink: "projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",  // Use customer-managed KMS key
        },
        // ... other config
    });
    

    private-service-connect

    Severity: high · Enforcement: advisory

    Require Private Service Connect endpoints to have restrictive security policies

    • 01.v Information Access Restriction — Access to systems and applications shall be restricted in accordance with the access control policy.
    Remediation
    Fix: Configure Secure Private Service Connect
    // Create Service Attachment with manual connection approval
    const serviceAttachment = new gcp.compute.ServiceAttachment("psc-service", {
        connectionPreference: "ACCEPT_MANUAL",  // Require manual approval for connections
        consumerAcceptLists: [{
            projectIdOrNum: "consumer-project-123",
            connectionLimit: 10,  // Limit connections to minimize attack surface
        }],
        targetService: backendService.id,
        // ... other config
    });
    
    // Create Forwarding Rule for PSC with internal load balancing
    const forwardingRule = new gcp.compute.ForwardingRule("psc-endpoint", {
        network: network.id,  // Specify network for proper isolation
        loadBalancingScheme: "INTERNAL",  // Use internal scheme for private connectivity
        target: serviceAttachment.id,
        // ... other config
    });
    

    pubsub-dead-letter-queue

    Severity: medium · Enforcement: advisory

    Require Pub/Sub subscriptions to have dead letter queue configuration

    • 12.a Including Information Security in the Business Continuity Management — Information security continuity shall be embedded in the organization’s business continuity management systems.
    Remediation
    Fix: Configure Dead Letter Queue
    const deadLetterTopic = new gcp.pubsub.Topic("dead-letter-topic", {});
    
    const subscription = new gcp.pubsub.Subscription("my-subscription", {
        topic: topic.name,
        deadLetterPolicy: {
            deadLetterTopic: deadLetterTopic.id,  // Specify dead letter topic
            maxDeliveryAttempts: 5,  // Set max delivery attempts before moving to DLQ
        },
        // ... other config
    });
    

    pubsub-encryption

    Severity: low · Enforcement: advisory

    Ensure Pub/Sub is encrypted with Cloud KMS

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation

    Configure kmsKeyName property when creating Pub/Sub topics to use customer-managed encryption keys (CMEK) for enhanced security and key management control.

    Example - Pub/Sub Topic with Customer-Managed Encryption:

    import * as gcp from "@pulumi/gcp";
    
    // Create KMS KeyRing and CryptoKey for encryption
    const keyRing = new gcp.kms.KeyRing("pubsub-keyring", {
        name: "pubsub-keyring",
        location: "us-central1"
    });
    
    const cryptoKey = new gcp.kms.CryptoKey("pubsub-key", {
        name: "pubsub-encryption-key",
        keyRing: keyRing.id,
        rotationPeriod: "7776000s"  // 90 days
    });
    
    // Grant Pub/Sub service account access to the key
    const binding = new gcp.kms.CryptoKeyIAMBinding("pubsub-key-binding", {
        cryptoKeyId: cryptoKey.id,
        role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
        members: ["serviceAccount:service-PROJECT_NUMBER@gcp-sa-pubsub.iam.gserviceaccount.com"]
    });
    
    // COMPLIANT: Topic with customer-managed encryption key
    const topicCompliant = new gcp.pubsub.Topic("encrypted-topic", {
        name: "secure-topic",
        kmsKeyName: cryptoKey.id,  // Compliant: CMEK configured
        messageRetentionDuration: "86400s"
    });
    
    // NON-COMPLIANT: Topic without CMEK (uses Google-managed keys)
    const topicNonCompliant = new gcp.pubsub.Topic("default-topic", {
        name: "insecure-topic"
        // Missing kmsKeyName - uses default Google-managed encryption
    });
    

    pubsub-message-retention

    Severity: medium · Enforcement: advisory

    Require Pub/Sub subscriptions to have appropriate message retention policies

    • 06.d Data Protection and Privacy of Covered Information — Covered information shall be protected against unauthorized disclosure, modification and destruction. For the purpose of this control, covered information includes protected health information, cardholder data, and other sensitive information.
    Remediation
    Fix: Configure Message Retention Duration
    const subscription = new gcp.pubsub.Subscription("my-subscription", {
        topic: topic.name,
        messageRetentionDuration: "604800s",  // Set retention to 7 days (in seconds)
        // ... other config
    });
    

    pubsub-subscription-iam-least-privilege

    Severity: high · Enforcement: advisory

    Enforce least privilege IAM policies for Pub/Sub subscriptions

    • 01.c Privilege Management — The allocation and use of privileges shall be restricted and controlled. The use of privileged utility programs shall be restricted and tightly controlled.
    Remediation
    Fix: Use Least Privilege IAM Roles
    const subscriptionIamBinding = new gcp.pubsub.SubscriptionIAMBinding("subscription-subscriber-binding", {
        subscription: subscription.id,
        role: "roles/pubsub.subscriber",  // Use specific role instead of admin/owner/editor
        members: [
            "serviceAccount:app-service@project.iam.gserviceaccount.com",  // Use specific service accounts instead of allUsers
        ],
    });
    

    pubsub-topic-iam-least-privilege

    Severity: high · Enforcement: advisory

    Enforce least privilege IAM policies for Pub/Sub topics

    • 01.c Privilege Management — The allocation and use of privileges shall be restricted and controlled. The use of privileged utility programs shall be restricted and tightly controlled.
    Remediation
    Fix: Use Least Privilege IAM Roles
    const topicIamBinding = new gcp.pubsub.TopicIAMBinding("topic-publisher-binding", {
        topic: topic.id,
        role: "roles/pubsub.publisher",  // Use specific role instead of admin/owner/editor
        members: [
            "serviceAccount:app-service@project.iam.gserviceaccount.com",  // Use specific service accounts instead of allUsers
        ],
    });
    

    resource-labeling

    Severity: low · Enforcement: advisory

    Require all GCP resources to have proper labeling for change tracking

    • 09.b Change Management — Changes to systems, applications and supporting infrastructure shall be controlled.
    Remediation
    Fix: Add Required Labels for Change Tracking

    Add the required labels (environment, team, owner) to your GCP resources:

    const instance = new gcp.compute.Instance("my-instance", {
        labels: {
            environment: "production",  // Required: environment label
            team: "platform",           // Required: team label
            owner: "john-doe",          // Required: owner label
            // ... other labels
        },
        // ... other config
    });
    
    // For Cloud SQL instances, use userLabels within settings
    const sqlInstance = new gcp.sql.DatabaseInstance("my-database", {
        settings: {
            userLabels: {
                environment: "production",  // Required: environment label
                team: "data",               // Required: team label
                owner: "jane-smith",        // Required: owner label
            },
            // ... other settings
        },
        // ... other config
    });
    
    // For GKE clusters, use resourceLabels
    const cluster = new gcp.container.Cluster("my-cluster", {
        resourceLabels: {
            environment: "production",  // Required: environment label
            team: "infrastructure",     // Required: team label
            owner: "ops-team",          // Required: owner label
        },
        // ... other config
    });
    

    secretmanager-customer-kms

    Severity: high · Enforcement: advisory

    Require Secret Manager secrets to use customer-managed Cloud KMS keys

    • 10.f Policy on the Use of Cryptographic Controls — Cryptographic controls shall be used in compliance with all relevant agreements, laws and regulations.
    Remediation
    Fix: Configure Customer-Managed KMS Encryption
    import * as gcp from "@pulumi/gcp";
    
    // Create a KMS KeyRing and CryptoKey
    const keyRing = new gcp.kms.KeyRing("my-keyring", {
        name: "secret-keyring",
        location: "us-central1",
    });
    
    const cryptoKey = new gcp.kms.CryptoKey("my-key", {
        name: "secret-encryption-key",
        keyRing: keyRing.id,
        rotationPeriod: "7776000s",  // 90 days
    });
    
    // Option 1: Auto-replication with customer-managed encryption
    const secretAuto = new gcp.secretmanager.Secret("my-secret-auto", {
        secretId: "my-cmek-secret",
        replication: {
            auto: {
                customerManagedEncryption: {
                    kmsKeyName: cryptoKey.id,  // Use customer-managed KMS key
                },
            },
        },
    });
    
    // Option 2: User-managed replication with customer-managed encryption
    const secretUserManaged = new gcp.secretmanager.Secret("my-secret-user", {
        secretId: "my-cmek-secret-regional",
        replication: {
            userManaged: {
                replicas: [
                    {
                        location: "us-central1",
                        customerManagedEncryption: {
                            kmsKeyName: cryptoKey.id,  // Use customer-managed KMS key
                        },
                    },
                    {
                        location: "us-east1",
                        customerManagedEncryption: {
                            kmsKeyName: cryptoKey.id,  // Specify for each replica
                        },
                    },
                ],
            },
        },
    });
    

    service-account-key

    Severity: critical · Enforcement: advisory

    Ensure proper service account key usage and prohibit insecure authentication methods

    • 01.p Secure Log-on Procedures — Secure logon procedures shall be implemented to prevent unauthorized access. Where password authentication is used, the system shall enforce a secure password policy.
    Remediation
    Fix: Use Strong Key Algorithm and Avoid Default Service Accounts
    const serviceAccount = new gcp.serviceaccount.Account("app-service-account", {
        accountId: "webapp-backend",  // Use application-specific service account
        displayName: "Web App Backend Service Account",
    });
    
    const serviceAccountKey = new gcp.serviceaccount.Key("app-key", {
        serviceAccountId: serviceAccount.name,
        keyAlgorithm: "KEY_ALG_RSA_2048",  // Use RSA_2048 or RSA_4096 for strong encryption
        // Avoid creating keys for default service accounts like:
        // - {project-number}-compute@developer.gserviceaccount.com
        // - {project-id}@appspot.gserviceaccount.com
    });
    

    service-account-restricted-names

    Severity: medium · Enforcement: advisory

    Restrict default service account creation with prohibited names

    • 01.b User Registration — There shall be a formal user registration and de-registration procedure in place governing the allocation of access rights to all information systems and services.
    Remediation
    Fix: Use Descriptive Service Account Names
    const serviceAccount = new gcp.serviceaccount.Account("backend-service-account", {
        accountId: "webapp-backend",  // Use specific, descriptive names (6-30 chars)
        displayName: "Web Application Backend Service Account",
        // Avoid generic/prohibited names like: default, admin, root, system, compute
        // Use names that describe the service purpose: webapp-backend, data-processor, etc.
    });
    

    single-environment-stack

    Severity: low · Enforcement: advisory

    Ensure all resources in a stack belong to the same environment

    • 09.d Separation of Development Test and Operational Environments — Segregation of test, development and operational environments shall be maintained to ensure that the test and development environments do not adversely impact the operational environment.
    Remediation
    Fix: Separate Resources into Environment-Specific Stacks

    Create separate Pulumi stacks for each environment to ensure proper separation:

    // Create separate stacks for each environment
    // Stack: dev-stack
    const devInstance = new gcp.compute.Instance("dev-instance", {
        labels: {
            environment: "development",  // All resources in this stack use "development"
            // ... other labels
        },
        // ... other config
    });
    
    // Stack: prod-stack
    const prodInstance = new gcp.compute.Instance("prod-instance", {
        labels: {
            environment: "production",  // All resources in this stack use "production"
            // ... other labels
        },
        // ... other config
    });
    

    subnetwork-flow-logs

    Severity: low · Enforcement: advisory

    Ensure VPC subnets have Flow Logs enabled for audit and monitoring

    • 09.z Publicly Available Information — Publicly available information shall be protected against unauthorized modification or deletion.
    Remediation

    Enable VPC Flow Logs on subnets by configuring logConfig with aggregationInterval (e.g., INTERVAL_5_SEC) and flowSampling (0.5 for 50% or 1.0 for 100%). Ensure flowSampling is greater than 0 to collect traffic logs.

    Pulumi TypeScript Example:

    import * as gcp from "@pulumi/gcp";
    
    const subnet = new gcp.compute.Subnetwork("my-subnet", {
        ipCidrRange: "10.0.0.0/24",
        network: network.id,
        region: "us-central1",
        logConfig: {
            aggregationInterval: "INTERVAL_5_SEC",  // or INTERVAL_30_SEC, INTERVAL_1_MIN, etc.
            flowSampling: 1.0,  // 1.0 = 100% sampling, 0.5 = 50%
            metadata: "INCLUDE_ALL_METADATA"
        },
        privateIpGoogleAccess: true
    });
    

    Valid aggregationInterval values: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN

      The infrastructure as code platform for any cloud.