Skip to content

feat(common): fail-closed guard for required IRSA role-arn#70

Merged
OleksandrUA merged 2 commits into
mainfrom
KEEP-840-fail-closed-irsa-role-arn
Jun 22, 2026
Merged

feat(common): fail-closed guard for required IRSA role-arn#70
OleksandrUA merged 2 commits into
mainfrom
KEEP-840-fail-closed-irsa-role-arn

Conversation

@OleksandrUA

Copy link
Copy Markdown
Contributor

Context

On 2026-06-18 a prod cutover wrote an empty eks.amazonaws.com/role-arn annotation onto the shared keeperhub-prod ServiceAccount. The EKS pod-identity webhook injects AWS credentials only when a non-empty role-arn is present, so the schedule/block dispatchers and executor came up with no AWS access and could not reach SQS. helm upgrade reported success and pods passed their local /health probes, so the bad state was invisible to both Helm and Kubernetes (~54 min outage, 1268 failed executions).

This adds the mechanical guard the post-mortem asks for.

Changes

common chart:

  • ServiceAccount template fails closed when serviceAccount.requireRoleArn: true and the role-arn annotation is empty or not a well-formed IAM role ARN, so helm upgrade aborts at render time.
  • New opt-in helm-test (serviceAccount.irsaCheck.enabled) running aws sts get-caller-identity under the service account to validate IRSA end-to-end.
  • helm-unittest suite covering the guard (empty / absent / malformed / valid / default-off), plus plugin install + run wiring in the release workflow.
  • Both new values default to false, non-breaking for other consumers.

Versions:

  • common 0.3.0 -> 0.4.0
  • keeperhub-stack 0.1.0 -> 0.2.0 (dependency bumped to common 0.4.0; Chart.lock and vendored package regenerated)

Verification

  • helm unittest charts/common -> 6/6 pass.
  • helm template with an empty/malformed role-arn aborts with serviceAccount eks.amazonaws.com/role-arn is missing or malformed; valid arn renders the SA; default-off renders unchanged.
  • Both charts lint and template clean.

Ordering

The keeperhub deploy consumes the published keeperhub-stack chart, so this must merge and be released before the companion keeperhub PR (which bumps the deploy pin to 0.2.0 and enables requireRoleArn / irsaCheck).

Add an opt-in assertion to the common chart's ServiceAccount template so
that, when serviceAccount.requireRoleArn is true, the render fails if the
eks.amazonaws.com/role-arn annotation is empty or not a well-formed IAM
role ARN. helm upgrade then aborts before applying instead of shipping a
credential-less workload that passes its local health probe.

Also add an opt-in helm-test (serviceAccount.irsaCheck.enabled) that runs
aws sts get-caller-identity under the service account to validate IRSA
end-to-end, a helm-unittest suite covering the guard, and the plugin
wiring in the release workflow.

Both new values default to false, so existing consumers are unaffected.
Bump common 0.3.0 -> 0.4.0 and the keeperhub-stack umbrella 0.1.0 -> 0.2.0
(dependency, lock and vendored package regenerated).
azure/setup-helm without a version falls back to helm 3.9.0 when it
cannot reach the GitHub release API, and 3.9.0 rejects the helm-unittest
plugin manifest (unknown field platformHooks, supported from helm 3.15).
Pin a modern helm so the plugin installs and the unittest suite runs.
@github-actions

Copy link
Copy Markdown

🎉 Helm Chart Tests Passed!

All modified charts have been successfully validated:

Chart Version Check Template Validation Dry-run Installation Overall Status
common ✅ Incremented ✅ Passed ✅ Passed ✅ Passed
keeperhub-stack ✅ Incremented ✅ Passed ✅ Passed ✅ Passed

Summary:

  • ✅ Charts tested: common, keeperhub-stack
  • ✅ All template validations passed
  • ✅ All dry-run installations passed

📋 Detailed Information:

The PR is ready for review! 🚀

Note: Charts will be automatically released when this PR is merged to main.

@OleksandrUA OleksandrUA merged commit 1d6ef1e into main Jun 22, 2026
4 checks passed
@OleksandrUA OleksandrUA deleted the KEEP-840-fail-closed-irsa-role-arn branch June 22, 2026 12:02
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