Skill detail
env-secrets-manager
DevSecOps engineering.
Inspect before use
Automated review checks relevance, not safety or endorsement. Read the source instructions before using this skill.
SKILL.md
The saved excerpt is a snapshot from review. The external source remains the complete and most current version.
--- name: "env-secrets-manager" description: "Manage environment-variable hygiene and secrets safety across local development and production. Practical auditing, drift awareness, rotation readiness. Use when auditing .env files for committed secrets, planning a credential rotation, debugging missing-env-var production incidents, or hardening a new project against secrets leakage." --- # Env & Secrets Manager **Tier:** POWERFUL **Category:** Engineering **Domain:** Security / DevOps / Configuration Management --- ## Overview Manage environment-variable hygiene and secrets safety across local development and production workflows. This skill focuses on practical auditing, drift awareness, and rotation readiness. ## Core Capabilities - `.env` and `.env.example` lifecycle guidance - Secret leak detection for repository working trees - Severity-based findings for likely credentials - Operational pointers for rotation and containment - Integration-ready outputs for CI checks --- ## When to Use - Before pushing commits that touched env/config files - During security audits and incident triage - When onboarding contributors who need safe env conventions - When validating that no obvious secrets are hardcoded --- ## Quick Start ```bash # Scan a repository for likely secret leaks python3 scripts/env_auditor.py /path/to/repo # JSON output for CI pipelines python3 scripts/env_auditor.py /path/to/repo --json ``` --- ## Recommended Workflow 1. Run `scripts/env_auditor.py` on the repository root. 2. Prioritize `critical` and `high` findings first. 3. Rotate real credentials and remove exposed values. 4. Update `.env.example` and `.gitignore` as needed. 5. Add or tighten pre-commit/CI secret scanning gates. --- ## Reference Docs - `references/validation-detection-rotation.md` - `references/secret-patterns.md` --- ## Common Pitfalls - Committing real values in `.env.example` - Rotating one system but missing downstream consumers - Logging secrets during debugging or incident response - Treating suspected leaks as low urgency without validation ## Best Practices 1. Use a secret manager as the production source of truth. 2. Keep dev env files local and gitignored. 3. Enforce detection in CI before merge. 4. Re-test application paths immediately after credential rotation. --- ## Cloud Secret Store Integration Production applications should never read secrets from `.env` files or environment variables baked into container images. Use a dedicated secret store instead. ### Provider Comparison | Provider | Best For | Key Feature | |----------|----------|-------------| | **HashiCorp Vault** | Multi-cloud / hybrid | Dynamic secrets, policy engine, pluggable backends | | **AWS Secrets Manager** | AWS-native workloads | Native Lambda/ECS/EKS integration, automatic RDS rotation | | **Azure Key Vault** | Azure-native workloads | Managed HSM, Azure AD RBAC, certificate management | | **GCP Secret Manager** | GCP-native workloads | IAM-based access, automatic replication, versioning | ### Selection Guidance - **Single cloud provider** — use the cloud-native secret manager. It integrates tightly with IAM, reduces operational overhead, and costs less than self-hosting. - **Multi-cloud or hybrid** — use HashiCorp Vault. It provides a uniform API across environments and supports dynamic secret generation (database credentials, cloud IAM keys) that expire automatically. - **Kubernetes-heavy** — combine External Secrets Operator with any backend above to sync secrets into K8s `Secret` objects without hardcoding. ### Application Access Patterns 1. **SDK/API pull** — application fetches secret at startup or on-demand via provider SDK. 2. **Sidecar injection** — a sidecar container (e.g., Vault Agent) writes secrets to a shared volume or injects them as environment variables. 3. **Init container** — a Kubernetes init container fetches secrets before the main container starts. 4. **CSI driver** — secrets mount as a filesystem volume viRead the full source on GitHub (opens external page)