Task · FMO-0003

Close the TenantPolicy v1 gaps: collectorIDs bypass, negation/regex semantics, uncovered kinds

Status
To Do
Labels
tenant-policy, security, v2
Updated
2026-08-14

Description

TenantPolicy is documented as a guardrail, not an authorization boundary, and AGENTS.md plus docs/tenant-policy.md both say so. Three gaps are known, documented, and deliberately shipped:

  1. selector.collectorIDs bypasses matcher checks entirely - a subject constrained by required matchers can still name collector IDs directly. Marked TODO(v2) at api/v1alpha1/webhook_tenant_test.go:381.
  2. Required-matcher semantics do not reason about negation or regex. A required matcher of team=team-a is not satisfied-checked against a CR carrying team!=team-b or team=~team-.*, so the check is syntactic.
  3. Collector and CollectorDiscovery are not covered by enforcement at all - only Pipeline, RemoteAttributePolicy and ExternalAttributeSync webhooks consult the checker.

Enforcement is default-allow when no policy matches the requesting user, which is the right default for an opt-in guardrail and the wrong one for an authorization boundary. Closing these three does not by itself make TenantPolicy an authorization boundary; decide explicitly whether that is the goal before starting, because it changes the default-allow question.

Acceptance Criteria

Definition of Done

View the source file on GitHub