Skip to content

fix: remove hardcoded GCP metadata and clean up secret handling#125

Draft
atomauro wants to merge 1 commit intomainfrom
fix/secure-ci-workflows
Draft

fix: remove hardcoded GCP metadata and clean up secret handling#125
atomauro wants to merge 1 commit intomainfrom
fix/secure-ci-workflows

Conversation

@atomauro
Copy link
Contributor

Security hardening for open-source repository

Problem

  1. All CI/CD workflow files hardcoded GCP infrastructure metadata (project IDs, project numbers, service account emails, Artifact Registry paths, VM names)
  2. fetch_secrets.sh exposed exact GCP Secret Manager names and logged partial secret values to stdout
  3. RUNBOOK.md contained SSH commands with real project names
  4. Legacy (non-HOS) workflow files no longer needed

Changes

  • Delete legacy workflows: dev.yml, prod.yml, prod-2.yml, staging.yml
  • Secure remaining HOS workflows (hos-dev.yml, hos-prd.yml, hos-stg.yml): Replace hardcoded env: blocks with vars.* references
  • fetch_secrets.sh:
    • Remove all echo statements that logged DB host, username, and partial passwords
    • Replace hardcoded Secret Manager names with env var references (SM_DATABASE_HOST, etc.)
    • Add simple OK/MISSING status check instead
  • RUNBOOK.md: Replace project-specific SSH commands with generic placeholders

Required Setup

1. GitHub Environments (Settings → Environments)

Environment Variables
hos-development GCP_PROJECT_NUMBER, GCP_PROJECT_ID, GCP_SA_EMAIL, GCP_REGION, GCP_DOCKER_IMAGE, GCP_VM_NAME
hos-production same
hos-staging same

2. Container Environment (Terraform/Docker)

Variable Old hardcoded value
SM_DATABASE_HOST DATABASE_HOST
SM_DATABASE_USER DATABASE_USER
SM_DATABASE_PASSWORD DATABASE_PASSWORD
SM_API_AUTH_TOKEN FASTNEAR_API_KEY
SM_DD_API_KEY DD_API_KEY

- 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.
@atomauro atomauro marked this pull request as draft February 20, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant