Skip to content

fix(operator): refuse cross-namespace token Secrets; bound lost-reply claims; keep flag on handover (0.2.1 final review) - #109

Merged
akosidencio merged 1 commit into
devfrom
fix/v0.2.1-r2-operator-review
Nov 30, 2026
Merged

akosidencio merged 1 commit into
devfrom
fix/v0.2.1-r2-operator-review

Conversation

@akosidencio

Copy link
Copy Markdown
Member

Fixes for the findings of the final 0.2.1 independent review on 2b0080b. That review found no critical or high-severity issue new in 0.2.1. F1 was there before 0.2.1. The owner chose deny-by-default for it.

# Severity Change
F1 High (been there since the operator's first release) A FeatureFlag chooses both the token Secret (tokenSecretRef.namespace, any namespace) and the URL the token is sent to, and the operator's ClusterRole can read every Secret. So anyone allowed to create a FeatureFlag could make the operator send any Secret to a server of their choosing. A Secret in another namespace is now refused: Ready=False, reason SecretNotAllowed, and nothing is sent. --allow-cross-namespace-secrets restores the 0.2.0 behaviour. Behaviour change: the CHANGELOG (Security, Upgrading), the upgrade page, the operator README and the docs page all cover it.
F2 Low (new in 0.2.1) Lost-reply recovery claims only a request created within the client timeout of the proposal record (2 min clock skew allowed), and forgets a record older than that. While the requester is unknown, it claims only a single unambiguous match.
F3 Low (new) Deleting the managing FeatureFlag no longer deletes the flag from Checkgate while another FeatureFlag will take it over. Only deleting the last one does.
F4 Low (new) The README now documents the multi-tenancy limit of age-based arbitration.
F5 Low (documented) The upgrade page explains how to keep 0.2.0's per-account login ceiling (LOGIN_MAX_FAILURES_PER_ACCOUNT=5).

Evidence

The new tests were run against the pre-fix code (2b0080b) first:

Test Before After
TestCrossNamespaceSecretIsRefusedByDefault FAIL (5 calls to the FeatureFlag's URL with another namespace's Secret) PASS (0 calls, SecretNotAllowed)
TestStaleProposalRecordDoesNotClaimAnotherUsersRequest (record 1 h old, requester unknown, admin token) FAIL (another user's request claimed as owned) PASS (not claimed, not withdrawn)
TestManagerDeletionKeepsTheFlagForTheNextManager FAIL (1 DELETE during the handover) PASS (0 DELETEs; the last FeatureFlag still deletes)
TestSameNamespaceExplicitSecretIsAllowed, TestCrossNamespaceSecretAllowedWhenEnabled — PASS

Other checks:

  • Operator: 39 tests pass; -race -count=3 passes.
  • envtest ×3: PASS (CRD upgrade from 0.2.0, approval lifecycle, conflicting FeatureFlags through a manager).
  • Real server: run-real-server.sh PASS.
  • Docs: VitePress build plus check-docs-site.py: ok.

RBAC is unchanged. The operator still needs cluster-wide Secret read for same-namespace Secrets in every namespace it watches.

… claims; keep the flag on manager handover

Final 0.2.1 independent review (R2):

- F1 (high, present since the operator's first release): a FeatureFlag
  names both the token Secret (any namespace) and the URL the token is
  sent to, and the operator can read every Secret, so anyone allowed to
  create a FeatureFlag could exfiltrate any Secret in the cluster. A
  tokenSecretRef in another namespace is now refused (Ready=False,
  SecretNotAllowed, nothing sent) unless the operator runs with
  --allow-cross-namespace-secrets.
- F2 (low): an unconfirmed proposal is resolved by claiming only a request
  created within the client timeout of the proposal (2 min clock skew), a
  stale record is forgotten, and with the requester unknown only a single
  unambiguous match is claimed.
- F3 (low): deleting the managing FeatureFlag no longer deletes the flag
  from Checkgate while another FeatureFlag will take it over.
- F4 (low): documented the multi-tenancy limit of age-based arbitration.
- Upgrade page: how to keep 0.2.0's per-account login ceiling (F5).
@akosidencio
akosidencio merged commit 55ab968 into dev Nov 30, 2026
36 checks passed
akosidencio added a commit that referenced this pull request Nov 30, 2026
…ew-2

fix(operator): follow-ups of the #109 review (handover peers, claim window, docs)
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