Skip to content

Make least-privilege the chart's default RBAC mode - #554

Merged
abahmed merged 2 commits into
mainfrom
rbac-least-privilege-default
Oct 18, 2026
Merged

abahmed merged 2 commits into
mainfrom
rbac-least-privilege-default

Conversation

@abahmed

@abahmed abahmed commented Oct 18, 2026

Copy link
Copy Markdown
Owner

What

  • deploy/chart/values.yaml: rbac.mode now defaults to least-privilege (the schema default and the template fallback match). --set rbac.mode=full opts back into list/watch on every resource.
  • The values.yaml comment now says get/update on kwatch-license-instance, not get/create/update. The Role has no create. This was meant to be its own small fix; it's in this PR because it touches the same file.
  • The chart README, README.md, docs/upgrading-to-1.0.md, docs/configuration.md, docs/production-operations.md and docs/contributing-source.md describe the new default and how to opt back into full.
  • deploy/chart/test_helm.sh now checks that the default has no wildcard and that full still renders one.

Please review before merging

  • Custom resources are not watched by default any more. Pro custom-resource detection needs rbac.mode=full.
  • Secrets are still watched cluster-wide by default. least-privilege still lists Secrets; only watch.secrets=false removes that access.
  • The raw deploy/deploy.yaml stays full (the manifest parity check requires it). If the installer applies its own ClusterRole, it is unchanged too. Raw/installer installs and chart installs now get different access.

Checks

  • helm lint, test_helm.sh, manifest parity, release consistency, docs-verify, line-check, diff-check, hygiene and test-layout all passed locally.
  • Full make verify could not finish locally: the disk ran out. No Go code changed. CI must run the full gate and e2e (the e2e label is set).

@abahmed abahmed added the e2e Run the real-cluster E2E suite on this pull request label Oct 18, 2026
The chart now defaults to rbac.mode=least-privilege, so a default install
no longer gets list/watch on every resource kind. rbac.mode=full stays
available for custom resources and kinds added later. Also fix the
values.yaml comment: the license instance Secret grant is get/update,
not get/create/update.
TestHelmFullRBACIsReadOnly rendered the chart defaults, which are now
least-privilege; it now sets rbac.mode=full, and a new test checks that
the default is least-privilege.

TestThreadSaverFlushTimeoutDoesNotWriteAfterClose could hang: with a 1ms
flush timeout, Save saw the expired context before calling the snapshot,
so the test waited forever for it. A first save now holds the lock inside
the snapshot, so the Flush always times out whatever the scheduling.
@abahmed
abahmed force-pushed the rbac-least-privilege-default branch from 289e4cd to 3d9d574 Compare October 18, 2026 10:32
@abahmed
abahmed merged commit 9d37f27 into main Oct 18, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run the real-cluster E2E suite on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant