Secret rotation in 2026: (1) Enumerate all secrets (DB passwords, API keys, JWT, OAuth client secrets), (2) Central store — AWS Secrets Manager ($0.40/secret/mo), HashiCorp Vault (self-host), Doppler ($5/user), (3) Automatic rotation via Lambda/GitHub Actions, (4) Zero-downtime: dual-read period with old + new keys. After incident — rotate ALL related secrets within an hour.
Below: step-by-step, working examples, common pitfalls, FAQ.
| Scenario | Config |
|---|---|
| AWS Secrets Manager (Node) | const { SecretsManager } = require('@aws-sdk/client-secrets-manager');
const sm = new SecretsManager();
const res = await sm.getSecretValue({ SecretId: 'prod/db/password' });
const { password } = JSON.parse(res.SecretString); |
| Vault Agent sidecar (K8s) | # Pod annotation
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: "my-app"
vault.hashicorp.com/agent-inject-secret-db: "database/creds/my-app" |
| Auto-rotate schedule | # AWS SM resource
resource "aws_secretsmanager_secret" "db" {
name = "prod/db"
rotation_rules { automatically_after_days = 30 }
rotation_lambda_arn = aws_lambda_function.rotator.arn
} |
| trufflehog scan | # Scan git history for secrets
$ docker run -v $(pwd):/repo trufflesecurity/trufflehog:latest \
git file:///repo --only-verified |
| Dual-read pattern | const current = await loadSecret('api-key-current');
const previous = await loadSecret('api-key-previous');
function verify(token) {
return verifyWith(token, current) || verifyWith(token, previous);
} |
The tool checks HTTP security headers, SSL/TLS configuration, server info leaks, and protection against common attacks (XSS, clickjacking, MIME sniffing). A grade fromA to F shows overall security level.
Checking Content-Security-Policy, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, and more.
TLS version, certificate expiry, chain of trust, HSTS support.
Finding exposed server versions, debug modes, open configs, and directories.
Detailed report explaining each issue with specific steps to fix it.
HTTP header audit
config verification
CSP & HSTS setup
compliance checks
Strict-Transport-Security.Server: Apache/2.4.52 helps attackers find exploits. Hide the version.DENY or SAMEORIGIN.nosniff, browsers may misinterpret file types (MIME sniffing).Content-Security-Policy-Report-Only, monitor violations, then enforce.Server, X-Powered-By, X-AspNet-Version from responses.Security check history and HTTP security header monitoring.
Sign up freeHigh-privilege API keys — 24-72h (JIT). Service credentials — 30-90d. Human passwords — 90d + MFA. After incident — immediately.
Vault: self-host, universal (not only AWS), $0 if self-hosted. AWS SM: managed, tight AWS IAM integration, $0.40/secret/mo. Cloud-native → SM, multi-cloud → Vault.
Best practice 2026 — AWS STS AssumeRole (1h), GitHub OIDC federation (no static AWS keys), Workload Identity (K8s). Reduces rotation overhead.
GitHub secret scanning enabled, trufflehog in CI, Shodan alerts for your IPs. <a href="/en/security">Enterno Security Scanner</a> for sensitive file disclosure.