Warning
While we will attempt to keep tagged versions "working", there are a lot of improvements being shipped. Update with caution :)
This repository contains a set of modules that enable the user to deploy a quick lab environment to evaluate StrongDM capabilities on Google Cloud Platform. The infrastructure is fully automated using Terraform and can be deployed in your GCP project in minutes.
- Network Infrastructure: VPC, subnets, firewall rules, Cloud NAT, and Cloud Router
- StrongDM Infrastructure: Gateway and relay with GCP Secret Manager integration
- Database Targets:
- Cloud SQL PostgreSQL with credentials in Secret Manager
- Firestore database (NoSQL document database)
- Linux Resources: SSH target using StrongDM's CA for authentication
- Kubernetes: GKE Cluster for container workloads
- Cloud Storage Access:
- Read-only access to GCS
- Full read/write access to GCS
- GCP Access: Read-only access to GCP resources via gcloud CLI
- Data Processing: Dataflow and Dataproc access for data engineering workloads
- HashiCorp Vault: Development instance for secrets management demonstration
All resources are properly labeled according to variables set in the module, ensuring consistent resource management and appropriate access roles in StrongDM.
The lab environment creates a secure network architecture with:
- Public subnet for internet-facing components (StrongDM gateway)
- Private subnet for protected resources (databases, servers, relay)
- Cloud NAT for outbound internet access from private subnet
- Firewall rules configured for least-privilege access
- Proper routing between public and private resources
-
A GCP project with billing enabled
-
The following APIs enabled:
- Compute Engine API
- Cloud SQL Admin API
- Secret Manager API
- Kubernetes Engine API (if using GKE)
- Firestore API (if using Firestore)
- Dataflow API (if using Dataflow)
- Dataproc API (if using Dataproc)
-
A service account or user with sufficient permissions to create resources
In addition to the usual access credentials for GCP, the modules require an access key to StrongDM with the following privileges:
sdm admin tokens add TerraformSecMgmt --permissions secretstore:list,secretstore:create,secretstore:update,secretstore:delete,organization:view_settings,relay:list,relay:create,policy:read,policy:write,datasource:list,datasource:create,datasource:update,datasource:delete,datasource:healthcheck,resourcelock:delete,resourcelock:list,accessrequest:requester,secretengine:create,secretengine:list,secretengine:delete,secretengine:update,managedsecret:list,managedsecret:update,managedsecret:create,managedsecret:read,managedsecret:delete --duration 648000 --type apiExport the environment variables:
export SDM_API_ACCESS_KEY=auth-aaabbbbcccccc
export SDM_API_SECRET_KEY=jksafhlksdhfsahgghdslkhaslghasdlkghlasdkhglkshgNote
If your control plane is in the UK, or the EU, make sure that the SDM_API_HOST variable is correctly set. Gateways and relays will use this variable as well to register against the right tenant
export SDM_API_HOST=api.uk.strongdm.com:443Make sure you're logged into sdm with:
sdm loginproject_id: GCP Project ID where resources will be created (required)region: GCP region where resources will be created (default: us-central1)zone: GCP zone for zonal resources (default: us-central1-a)
network: Use an existing VPC network. If null, a new network will be createdgateway_subnet: Use an existing public subnet. If null, a new subnet will be createdrelay_subnet: Use an existing private subnet. If null, a new subnet will be created
create_linux_target: Create a Linux target with SSH CA authenticationcreate_postgresql: Create a Cloud SQL PostgreSQL databasecreate_gke: Create a GKE (Kubernetes) clustercreate_firestore: Create a Firestore databasecreate_gcp_ro: Create a service account with read-only GCP accesscreate_gcs_ro: Create a service account with read-only Cloud Storage accesscreate_gcs_full: Create a service account with full Cloud Storage accesscreate_dataflow: Create a service account with Dataflow/Dataproc accesscreate_hcvault: Create a HashiCorp Vault development instancecreate_managedsecrets: Onboard domain users into StrongDM for credential management
machine_types: Object specifying machine types for different componentsgateway: Machine type for gateway (default: e2-micro)relay: Machine type for relay (default: e2-micro)linux_target: Machine type for Linux target (default: e2-micro)vault: Machine type for Vault server (default: e2-micro)
postgresql_tier: Cloud SQL PostgreSQL tier (default: db-f1-micro)gke_node_machine_type: Machine type for GKE nodes (default: e2-standard-2)
name: An arbitrary string that will be added to all resource names (required)tagset: Tags to apply to all StrongDM resources (required)labels: Labels to apply to all GCP resources
You can reference the terraform.tfvars.example file in the main module for example configurations.
-
Clone this repository
-
Navigate to the main module:
cd gcp-lab-in-a-box/main -
Copy and customize the example variables file:
cp terraform.tfvars.example terraform.tfvars
-
Edit
terraform.tfvarswith your configuration -
Initialize and apply Terraform:
terraform init terraform plan terraform apply
gcp-lab-in-a-box/
├── main/ # Main Terraform module
│ ├── terraform.tf # Provider configuration
│ ├── variables.tf # Variable definitions
│ ├── network.tf # Network configuration
│ ├── gateway.tf # StrongDM gateway
│ ├── relay.tf # StrongDM relay
│ ├── secretmanager.tf # Secret Manager configuration
│ └── *-target.tf # Various target configurations
├── network/ # VPC and networking module
├── linux-target/ # Linux SSH target module
├── postgresql/ # Cloud SQL PostgreSQL module
├── gke/ # GKE Kubernetes module
├── gcsro/ # GCS read-only access module
├── gcsfull/ # GCS full access module
├── gcpro/ # GCP read-only access module
├── dataflow/ # Dataflow/Dataproc module
├── firestore/ # Firestore database module
└── hcvault/ # HashiCorp Vault module
| Feature | AWS | Azure | GCP |
|---|---|---|---|
| Gateway & Relay | Yes | Yes | Yes |
| Linux Target (SSH CA) | Yes | Yes | Yes |
| PostgreSQL | RDS | Azure PostgreSQL | Cloud SQL |
| Kubernetes | EKS | AKS | GKE |
| Object Storage RO | S3 | Blob Storage | GCS |
| Object Storage Full | S3 | Blob Storage | GCS |
| Cloud Read-Only | AWS | Azure | GCP |
| Data Processing | Glue | Data Factory | Dataflow/Dataproc |
| Document DB | DocumentDB | Cosmos DB | Firestore |
| HashiCorp Vault | Yes | Yes | Yes |
| Windows DC | Yes | Yes | Planned |
| Windows Target | Yes | Yes | Planned |
This lab environment supports various training scenarios:
- Database Access Management: Configure secure access to PostgreSQL and Firestore databases
- Server Access Control: Manage Linux server access with SSH CA authentication
- Kubernetes Integration: Demonstrate GKE cluster access management
- Cloud Permissions: Show controlled GCP resource access through StrongDM
- Storage Access: Demonstrate read-only and full access patterns for Cloud Storage
- Data Engineering: Show access to Dataflow and Dataproc for data processing workloads
Common issues and their solutions:
- API Not Enabled: Ensure all required GCP APIs are enabled for your project
- Insufficient Permissions: Verify the service account has necessary IAM roles
- Connection Failures: Check firewall rules allow traffic on required ports
- Authentication Issues: Verify the SDM API credentials and permissions
- Quota Limits: Check if you've hit GCP quota limits for the region
To destroy all resources created by this lab:
cd main
terraform destroyWarning
This will permanently delete all resources created by Terraform, including any data stored in databases.
Feel free to submit issues or pull requests to improve the lab environment.