Skip to content

Security: cloudon-one/terraform-google-modules

Security

SECURITY.md

Security Policy

Table of Contents

Reporting Security Vulnerabilities

We take the security of our GCP Terraform modules seriously. If you discover a security vulnerability, please report it responsibly.

🚨 How to Report

DO NOT create a public GitHub issue for security vulnerabilities.

Instead, please:

  1. Email: Send details to security@cloudon-one.com
  2. Subject: Include "SECURITY VULNERABILITY - GCP Terraform Modules"
  3. Include:
    • Description of the vulnerability
    • Steps to reproduce the issue
    • Potential impact assessment
    • Suggested remediation (if known)
    • Your contact information

πŸ”’ What to Include

Please provide as much information as possible:

- Module affected: [terraform-google-gke, terraform-google-cloudsql, etc.]
- Vulnerability type: [Authentication, Authorization, Data exposure, etc.]
- Affected versions: [1.0.0, 1.1.0, etc.]
- Attack vector: [Remote, Local, Physical]
- Impact level: [Critical, High, Medium, Low]
- Proof of concept: [Steps to reproduce]
- Proposed fix: [If available]

⏰ Response Timeline

We commit to the following response times:

  • Initial acknowledgment: Within 48 hours
  • Initial assessment: Within 5 business days
  • Status updates: Every 10 business days until resolved
  • Resolution: Varies by complexity and severity

πŸ† Recognition

We appreciate responsible disclosure and will:

  • Credit you in our security advisory (unless you prefer to remain anonymous)
  • Keep you informed throughout the investigation process
  • Provide updates on fix development and release timeline

Security Best Practices

πŸ›‘οΈ For Contributors

When contributing to this project:

  1. Never commit sensitive data:

    # Use .gitignore patterns
    *.tfvars
    *.tfstate
    *.tfstate.backup
    .terraform/
    secrets/
  2. Use secure coding practices:

    • Follow principle of least privilege
    • Validate all inputs and outputs
    • Use secure defaults
    • Implement proper error handling
  3. Security review checklist:

    • No hardcoded credentials or secrets
    • Proper IAM roles and permissions
    • Network security controls in place
    • Encryption at rest and in transit
    • Audit logging enabled
    • Resource deletion protection

πŸ—οΈ For Users

When using these modules:

  1. Secrets Management:

    # ❌ Don't do this
    variable "db_password" {
      default = "hardcoded-password"
    }
    
    # βœ… Do this instead
    variable "db_password" {
      description = "Database password - should be provided via environment variable"
      type        = string
      sensitive   = true
    }
  2. Network Security:

    # Enable private clusters
    private_cluster_config {
      enable_private_nodes    = true
      enable_private_endpoint = true
    }
    
    # Restrict authorized networks
    master_authorized_networks_config {
      cidr_blocks {
        cidr_block   = "10.0.0.0/8"  # Corporate network only
        display_name = "corporate-network"
      }
    }
  3. State File Security:

    # Use remote state with encryption
    terraform {
      backend "gcs" {
        bucket  = "terraform-state-bucket"
        prefix  = "terraform/state"
        encryption_key = "your-kms-key"
      }
    }

Version Support Policy

  • Active support: Regular updates, bug fixes, and security patches
  • Security fixes: Only critical security vulnerabilities
  • Critical fixes: Only security issues with CVSS >= 8.0
  • No support: No updates provided

Security Architecture

πŸ›οΈ Defense in Depth

Our modules implement multiple layers of security:

graph TB
    A[Internet] --> B[Cloud Armor WAF]
    B --> C[Load Balancer]
    C --> D[VPC Network]
    D --> E[Private GKE Cluster]
    D --> F[Private Cloud SQL]
    E --> G[Workload Identity]
    F --> H[Private IP Only]
    
    I[Bastion Host] --> D
    J[IAP Tunnel] --> I
    
    K[VPC Service Controls] --> D
    L[Binary Authorization] --> E
    M[Pod Security Standards] --> E
Loading

πŸ” Security Controls by Module

terraform-google-svc-projects

  • βœ… Project isolation and separation
  • βœ… Billing account association
  • βœ… API enablement control
  • βœ… Resource labeling for governance

terraform-google-svpc

  • βœ… Private subnets with no external IPs
  • βœ… Firewall rules with least privilege
  • βœ… VPC Flow Logs for monitoring
  • βœ… Private Google Access

terraform-google-gke

  • βœ… Private cluster with no public IPs
  • βœ… Workload Identity for pod authentication
  • βœ… Network policies for micro-segmentation
  • βœ… Binary Authorization for container security
  • βœ… Shielded GKE nodes with secure boot
  • βœ… Node auto-repair and auto-upgrade
  • βœ… Pod Security Standards enforcement

terraform-google-bastion

  • βœ… SSH key-based authentication only
  • βœ… IAP tunnel for secure access
  • βœ… Fail2ban for brute force protection
  • βœ… Audit logging of all sessions
  • βœ… Network-based access controls

terraform-google-cloudsql

  • βœ… Private IP configuration only
  • βœ… SSL/TLS encryption in transit
  • βœ… Encryption at rest
  • βœ… Automated backups with retention
  • βœ… Point-in-time recovery
  • βœ… Authorized networks restriction

terraform-google-iam

  • βœ… Principle of least privilege
  • βœ… Service account key rotation
  • βœ… Conditional IAM policies
  • βœ… IAM audit logging

terraform-google-vpc-sc

  • βœ… Data exfiltration protection
  • βœ… API access restrictions
  • βœ… Service perimeter enforcement
  • βœ… Ingress/egress rules

Compliance and Standards

πŸ… Compliance Frameworks

Our modules help achieve compliance with:

  • SOC 2 Type II
  • ISO 27001
  • PCI DSS (where applicable)
  • GDPR (data protection by design)
  • HIPAA (with additional configuration)

πŸ“‹ Security Standards

We follow these security standards:

  • CIS Google Cloud Platform Foundation Benchmark
  • NIST Cybersecurity Framework
  • OWASP Cloud Security Top 10
  • Google Cloud Security Best Practices

πŸ” Security Checklist

Before deploying to production:

  • All default passwords changed
  • Multi-factor authentication enabled
  • Network segmentation implemented
  • Encryption enabled for data at rest and in transit
  • Monitoring and alerting configured
  • Backup and disaster recovery tested
  • Security logging enabled
  • Vulnerability scanning configured
  • Access controls reviewed and documented
  • Incident response plan in place

Security Testing

πŸ§ͺ Automated Security Testing

We implement the following security tests:

  1. Static Analysis:

    # Terraform security scanning
    tfsec .
    checkov -f main.tf
    terrascan scan -t terraform
  2. Infrastructure Testing:

    # Test security controls
    terratest test/security_test.go
    inspec exec security-baseline
  3. Compliance Validation:

    # CIS benchmark validation
    gcloud compute instances list --format="table(name,status,zone,machineType)"

πŸ”’ Security Testing in CI/CD

name: Security Scan
on: [push, pull_request]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Run tfsec
        uses: aquasecurity/tfsec-sarif-action@v0.1.0
        with:
          sarif_file: tfsec.sarif
          
      - name: Run Checkov
        uses: bridgecrewio/checkov-action@master
        with:
          directory: .
          framework: terraform
          
      - name: Run Terrascan
        uses: accurics/terrascan-action@main
        with:
          iac_type: terraform

Incident Response

🚨 Security Incident Response Process

  1. Detection and Analysis (0-4 hours):

    • Identify and validate the security incident
    • Determine scope and impact
    • Assemble incident response team
    • Begin forensic preservation
  2. Containment and Eradication (4-24 hours):

    • Implement immediate containment measures
    • Remove threat from environment
    • Apply temporary fixes
    • Document all actions taken
  3. Recovery (24-72 hours):

    • Restore normal operations
    • Monitor for signs of compromise
    • Implement permanent fixes
    • Update security controls
  4. Post-Incident Activities (72+ hours):

    • Conduct lessons learned session
    • Update incident response procedures
    • Share findings with stakeholders
    • Implement preventive measures

πŸ“ž Emergency Contacts

Security Team: security@yourcompany.com
On-Call Engineering: oncall@yourcompany.com
Management Escalation: security-escalation@yourcompany.com

πŸ”§ Emergency Response Tools

# Immediate containment commands
gcloud compute instances stop INSTANCE_NAME --zone=ZONE
gcloud container clusters update CLUSTER_NAME --enable-network-policy
gcloud sql instances patch INSTANCE_NAME --no-backup

# Forensic data collection
gcloud logging read 'timestamp>="2024-01-01T00:00:00Z"'
gcloud compute instances get-serial-port-output INSTANCE_NAME

Security Updates and Notifications

πŸ“’ Security Advisories

Security advisories will be published:

  • GitHub Security Advisories: For version-specific vulnerabilities
  • Release Notes: For security-related updates
  • Mailing List: security-updates@yourcompany.com (subscribe for notifications)

πŸ“… Security Review Schedule

  • Code Review: Every pull request
  • Security Audit: Quarterly
  • Penetration Testing: Annually
  • Vulnerability Assessment: Monthly
  • Compliance Review: Bi-annually

Contact Information

For security-related questions:

  • General Security: security@cloudon-one.com
  • Vulnerability Reports: security@cloudon-one.com (PGP key available)
  • Security Questions: GitHub Discussions with "security" tag

Last Updated: September 2025
Next Review: December 2025
Version: 1.0

There aren’t any published security advisories