Skip to content

fix(shield): fail fast when Rapid Response is enabled without a password#2691

Merged
airadier merged 5 commits into
mainfrom
fix/shield-rapid-response-password-required
Jul 22, 2026
Merged

fix(shield): fail fast when Rapid Response is enabled without a password#2691
airadier merged 5 commits into
mainfrom
fix/shield-rapid-response-password-required

Conversation

@airadier

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

When features.respond.rapid_response.enabled: true but no password is supplied (neither features.respond.rapid_response.password nor password_existing_secret), the chart renders a Host Shield Secret with an empty password. At runtime the rapid-response subprocess crash-loops:

Flag "password" cannot be empty

That unhealthy subprocess makes the agent report UNhealthy on /healthz, so the Host Shield pod never becomes Ready (stuck 0/1) — even though the agent authenticates and sends metrics fine. The failure is silent at helm install time and only surfaces as a confusing not-Ready pod later.

This adds a fail-fast guard in templates/host/secrets.yaml, in the same block that generates the self-managed Secret, so:

  • rendering fails immediately with an actionable message pointing at the two ways to supply the credential;
  • deployments that reference a pre-created Secret via password_existing_secret are unaffected (the guard is inside the not existing_secret branch);
  • helm template / helm install now surface the misconfiguration up front instead of at runtime.

Error message emitted:

features.respond.rapid_response is enabled but no password is set. Rapid Response requires a password: set features.respond.rapid_response.password, or reference a pre-created Secret with features.respond.rapid_response.password_existing_secret (and optionally .password_existing_secret_key). Without it the Host Shield rapid-response subprocess crash-loops (Flag "password" cannot be empty) and the pod never becomes Ready.

Checklist

  • Title of the PR starts with type and scope
  • Chart Version bumped for the respective charts (shield 1.46.4 → 1.46.5)
  • Variables are documented in the README.md (no new values introduced — password / password_existing_secret already exist)
  • Check GithubAction checks (like lint) to avoid merge-check stoppers
  • All test files are added in the tests folder of their respective chart and have a "_test" suffix (tests/host/secrets_test.yaml: missing-password and empty-password cases)

When features.respond.rapid_response.enabled is true but no password is
provided (neither features.respond.rapid_response.password nor
password_existing_secret), the chart previously rendered a Host Shield
Secret with an empty password. At runtime the rapid-response subprocess
crash-loops ("Flag \"password\" cannot be empty"), which makes the agent
report UNhealthy on /healthz so the Host Shield pod never becomes Ready
(stuck 0/1) -- even though the agent authenticates and sends metrics fine.

Fail the render instead, with an actionable message pointing at the two
ways to supply the credential. The guard lives in the same block that
generates the self-managed Secret, so it does not affect deployments that
reference a pre-created Secret via password_existing_secret.

Add unit tests covering both the missing-password and empty-password
cases, and bump the chart version.
@airadier
airadier requested a review from a team as a code owner July 20, 2026 16:26
mateobur
mateobur previously approved these changes Jul 20, 2026

@aroberts87 aroberts87 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @airadier! Just a request to make the error string a bit more concise. LGTM once that change is made and the linting error gets cleared up.

Comment thread charts/shield/templates/host/secrets.yaml Outdated
Comment thread charts/shield/tests/host/secrets_test.yaml Outdated
Comment thread charts/shield/tests/host/secrets_test.yaml Outdated
mateobur
mateobur previously approved these changes Jul 21, 2026
main advanced to 1.46.5; bump to satisfy ct lint version-bump check.
@airadier
airadier enabled auto-merge (squash) July 21, 2026 15:27
@airadier
airadier merged commit eb232ae into main Jul 22, 2026
5 checks passed
@airadier
airadier deleted the fix/shield-rapid-response-password-required branch July 22, 2026 13:23
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.

3 participants