Prompt

How do I manage secrets across local dev, GitHub Actions, and Kubernetes?

Technology / Cybersecurity1 observationLast seen Oct 25, 2026

Latest observation

Oct 25, 2026OpenAI APIWeb search: off

A good way to manage secrets across local dev, GitHub Actions, and Kubernetes is to use the same core principles everywhere:

  1. Keep secrets out of Git
  2. Use environment-specific secret stores
  3. Inject secrets at runtime, not build time
  4. Rotate and audit access
  5. Prefer short-lived credentials when possible

Recommended pattern

1) Local development

Use one of these:

  • .env files for local-only development
  • A secret manager CLI like:
    • 1Password CLI
    • Doppler
    • Vault
    • AWS SSM / Secrets Manager
  • Keep .env in .gitignore
  • Commit a .env.example with placeholders only

Example:

DATABASE_URL=postgres://user:pass@localhost:5432/app
JWT_SECRET=change-me

For consistency, load them with your app or tooling:

  • Node: dotenv
  • Python: python-dotenv
  • Docker Compose: env_file

2) GitHub Actions

Use GitHub Secrets for CI/CD-only secrets:

  • Repository secrets for one app
  • Environment secrets for dev, staging, prod
  • Organization secrets if shared across repos

Best practices:

  • Use GitHub OIDC to get cloud credentials instead of storing long-lived cloud keys
  • Keep secrets scoped to the smallest environment possible
  • Never echo secrets in logs
  • Avoid passing secrets as plain build args if they end up in image layers

Example:

jobs:
  test:
    runs-on: ubuntu-latest
    env:
      DATABASE_URL: ${{ secrets.DATABASE_URL }}
    steps:
      - uses: actions/checkout@v4
      - run: npm test

For cloud auth, prefer OIDC:

  • GitHub Actions assumes a cloud role temporarily
  • No static AWS/GCP/Azure keys stored in GitHub

3) Kubernetes

Do not hardcode secrets in manifests or images.

Options:

  • Native Kubernetes Secrets: simple, but base64-encoded only, not encrypted by default unless you enable encryption at rest
  • External Secrets Operator: sync secrets from AWS Secrets Manager, Azure Key Vault, GCP Secret Manager, Vault, etc.
  • Secrets Store CSI Driver: mount secrets directly from external secret stores
  • Vault Agent / Vault Injector: for HashiCorp Vault users

Recommended for most teams:

  • Store secrets in a real secret manager
  • Sync or mount them into Kubernetes at runtime

Example Kubernetes Secret:

apiVersion: v1
kind: Secret
metadata:
  name: app-secrets
type: Opaque
stringData:
  DATABASE_URL: postgres://user:pass@db:5432/app

Then reference it:

env:
  - name: DATABASE_URL
    valueFrom:
      secretKeyRef:
        name: app-secrets
        key: DATABASE_URL

Best overall architecture

A common, clean setup is:

  • Local dev: .env or 1Password/Doppler
  • GitHub Actions: GitHub Secrets + OIDC for cloud access
  • Kubernetes: external secret manager + External Secrets Operator

This gives you:

  • one source of truth per environment
  • no secrets in source control
  • less duplication
  • easier rotation

Important tips

Avoid these mistakes

  • Committing .env files
  • Baking secrets into Docker images
  • Using the same secret across dev/staging/prod
  • Storing long-lived cloud keys in GitHub if OIDC is available
  • Relying on plain Kubernetes Secrets without encryption/auditing for sensitive prod use

Rotate secrets

Have a rotation process for:

  • DB passwords
  • API keys
  • signing keys
  • cloud credentials

Use different secrets per environment

Example:

  • dev uses a dev database and API keys
  • staging uses staging credentials
  • prod uses production credentials

Control access tightly

  • Least privilege
  • Separate IAM roles/service accounts per environment
  • Restrict who can read secrets in GitHub/Kubernetes/cloud consoles

Simple practical setup

If you want a pragmatic stack that works well:

  • Local: .env + .env.example
  • CI: GitHub Secrets + OIDC to cloud
  • Kubernetes: External Secrets Operator + AWS Secrets Manager / GCP Secret Manager / Azure Key Vault
  • Optional: SOPS or Sealed Secrets if you want GitOps-managed encrypted secret manifests

If you want, I can also give you:

  1. a concrete example setup for AWS/GCP/Azure, or
  2. a sample repo layout + YAML files for all three environments.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.