Skip to content

feat(secrets): deny-by-default resource policy on grafana + saml secrets#240

Draft
nogueiraanderson wants to merge 2 commits into
mainfrom
secrets/sm-resource-policy
Draft

feat(secrets): deny-by-default resource policy on grafana + saml secrets#240
nogueiraanderson wants to merge 2 commits into
mainfrom
secrets/sm-resource-policy

Conversation

@nogueiraanderson

@nogueiraanderson nogueiraanderson commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Tighten ESO(External Secrets Operator)-synced Secrets Manager secrets so only the External Secrets Operator role can read them.

What

  • aws_secretsmanager_secret_policy (deny-by-default, ESO-role-only plus an empty break-glass var) on grafana/admin and authentik/saml/private_key.

Notes

  • authentik/saml/private_key is already fenced live. Apply adopts it idempotently and newly fences grafana/admin.

- Add aws_secretsmanager_secret_policy over the out-of-band, ESO-synced
  grafana/admin and authentik/saml/private_key secrets so only the ESO
  pod-identity role (plus an empty-by-default break-glass var) can
  GetSecretValue, cutting read blast radius off every AdministratorAccess
  holder (security-review finding B2).
- Add var.fenced_secret_breakglass_arns (default []).
- Add static CI gate test_secret_resource_policies.py asserting the fence
  shape (deny-by-default, ESO-only allowlist, public cert left unfenced,
  authentik/config fence preserved).
- Move the live access audits into tests/integration/ with just recipes
  (audit-secret-access, audit-argocd-rbac); grafana/admin tracked as a
  strict-xfail until apply flips it to fenced.
- Reject a bare "*" in var.fenced_secret_breakglass_arns (would disable the
  deny by matching every principal).
- Live audit: catch ResourceNotFoundException in _resource_policy; IAM-style
  wildcard match for GetSecretValue-covering actions; assert the fenced
  allowlist is exactly the in-account ESO role (no wildcard) plus the full
  deny-by-default statement shape.
- Static gate: scope assertions to the fenced_secrets map and the policy
  resource block via regex so comment-only tokens cannot satisfy them.
@nogueiraanderson nogueiraanderson marked this pull request as draft June 15, 2026 23:13
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