Skip to main content

Secrets Management

Folder: .github/skills/tsh-managing-secrets/ Used by: DevOps Engineer

Provides patterns for secure credential storage, rotation, and CI/CD authentication across cloud and Kubernetes environments.

Secret Storage Options

SolutionUse Case
AWS Secrets ManagerApplication secrets with automatic rotation
AWS SSM Parameter StoreConfiguration values and simple secrets
Azure Key VaultSecrets, keys, and certificates for Azure workloads
GCP Secret ManagerSecrets with IAM-based access control
HashiCorp VaultMulti-cloud secrets with dynamic credentials
Kubernetes SecretsPod-level secrets (use with external secrets operator)

Security Principles

  • Never hardcode secrets in source code, configuration files, or IaC.
  • Rotate regularly — Automate rotation with provider-specific mechanisms.
  • Least privilege — Grant access only to the services that need each secret.
  • Audit access — Enable logging for all secret access events.
  • Encrypt at rest — Use KMS-managed encryption keys.

CI/CD Authentication

PlatformRecommended Approach
GitHub ActionsOIDC for cloud providers, encrypted secrets for other values
GitLab CIVault integration or CI/CD variables with masked/protected flags
BitbucketRepository or workspace-level secure variables

Connected Skills

  • tsh-implementing-ci-cd — Secrets in CI/CD pipelines.
  • tsh-implementing-kubernetes — Secrets in Kubernetes workloads.
  • tsh-implementing-terraform-modules — Secrets in Terraform configurations.