fix: remove hardcoded GCP metadata and clean up secret handling#125
Draft
fix: remove hardcoded GCP metadata and clean up secret handling#125
Conversation
- Remove legacy (non-HOS) workflow files: dev.yml, prod.yml, prod-2.yml, staging.yml - Move all GCP project IDs, project numbers, service account emails, Artifact Registry paths, and VM names from hardcoded env blocks to GitHub Actions environment variables (vars.*) - Clean up fetch_secrets.sh: - Remove echo statements that logged DB host, username, partial passwords - Replace hardcoded Secret Manager names with env var references - Add simple OK/MISSING status check - Redact RUNBOOK.md: replace project-specific SSH commands with placeholders Remaining workflows (hos-dev, hos-prd, hos-stg) reference GitHub Actions environments where these variables must be configured: GCP_PROJECT_NUMBER, GCP_PROJECT_ID, GCP_SA_EMAIL, GCP_REGION, GCP_DOCKER_IMAGE, GCP_VM_NAME Security: prevents infrastructure metadata from being publicly visible in the open-source repository.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security hardening for open-source repository
Problem
fetch_secrets.shexposed exact GCP Secret Manager names and logged partial secret values to stdoutRUNBOOK.mdcontained SSH commands with real project namesChanges
dev.yml,prod.yml,prod-2.yml,staging.ymlhos-dev.yml,hos-prd.yml,hos-stg.yml): Replace hardcodedenv:blocks withvars.*referencesfetch_secrets.sh:echostatements that logged DB host, username, and partial passwordsSM_DATABASE_HOST, etc.)RUNBOOK.md: Replace project-specific SSH commands with generic placeholdersRequired Setup
1. GitHub Environments (Settings → Environments)
hos-developmentGCP_PROJECT_NUMBER,GCP_PROJECT_ID,GCP_SA_EMAIL,GCP_REGION,GCP_DOCKER_IMAGE,GCP_VM_NAMEhos-productionhos-staging2. Container Environment (Terraform/Docker)
SM_DATABASE_HOSTDATABASE_HOSTSM_DATABASE_USERDATABASE_USERSM_DATABASE_PASSWORDDATABASE_PASSWORDSM_API_AUTH_TOKENFASTNEAR_API_KEYSM_DD_API_KEYDD_API_KEY