Skip to content

Authentication, RBAC, Multi-Tenancy, and Immutable Audit Export

Faber ships optional native authentication and authorization middleware (internal/ui/auth.go), strict namespace-scoped multi-tenant RBAC and watch isolation (--watch-namespace and rbac.namespaced=true), and an immutable structured JSONL audit log (internal/observability/audit.go).

Select the HTTP API authentication mode with --auth-mode (or FABER_AUTH_MODE, or Helm auth.mode):

Mode Behavior Recommended Use
none (default) Built-in auth middleware disabled. Clusters behind trusted upstream proxy authentication (such as Pomerium, Authelia, or Tailscale).
oidc Validates Authorization: Bearer <jwt> (RS256 and ES256) against OIDC Discovery / cached JWKS, verifying iss, aud, exp, and nbf. Multi-user clusters using Dex, Keycloak, Authentik, Okta, or cloud OIDC providers.
k8s Validates Authorization: Bearer <token> via Kubernetes authentication.k8s.io/v1 TokenReview and authorizes mutations via authorization.k8s.io/v1 SubjectAccessReview. Clusters authenticating operators and automation directly with Kubernetes ServiceAccount or OIDC cluster tokens.

When --auth-mode is oidc or k8s:

  • Health probes (/healthz, /readyz, /api/v1/health), Prometheus /metrics, and the static SPA shell assets (/, /index.html, /favicon.svg, /theme.js, /assets/*) remain accessible so browsers and kubelet probes work cleanly.
  • /webhooks/* remains governed by per-policy webhook HMAC or Bearer secrets.
  • All /api/* (except /api/v1/health), /v1/*, /mcp, and /openapi.json routes require a valid Authorization: Bearer token and respond with HTTP 401 and WWW-Authenticate: Bearer realm="faber" on failure.

Required flags (or environment variables):

  • --oidc-issuer-url (FABER_OIDC_ISSUER_URL): Exact iss claim and discovery base URL (/.well-known/openid-configuration).
  • --oidc-audience (FABER_OIDC_AUDIENCE): Required aud claim value.
  • --oidc-jwks-url (FABER_OIDC_JWKS_URL, optional): Explicit JWKS endpoint overriding discovery.
  • --oidc-username-claim (FABER_OIDC_USERNAME_CLAIM, default email): Claim used for the verified principal subject (falls back to sub).

JWKS keys are cached in memory for 15 minutes and refreshed automatically (rate-limited to prevent JWKS storms) on unknown kid rotation.

  1. Authentication: Every bearer token is verified through Kubernetes TokenReview (authentication.k8s.io/v1).
  2. Mutation Authorization: Mutating endpoints (trigger, cancel, approve, reject, /v1/invoke/{policy}, and /mcp) perform a namespace-scoped Kubernetes SubjectAccessReview (authorization.k8s.io/v1) checking whether the authenticated user and groups hold the required verb on faberops.dev/v1alpha1 remediationruns in the target policy or run namespace. Unauthorized callers receive HTTP 403.
  3. RBAC Prerequisite: Ensure the faber-controller ClusterRole includes create on authentication.k8s.io tokenreviews and authorization.k8s.io subjectaccessreviews (configured automatically by the Helm chart when auth.mode=k8s and rbac.namespaced=false).

Caller Identity (GET /api/v1/whoami) and Verified Approvals

Section titled “Caller Identity (GET /api/v1/whoami) and Verified Approvals”

GET /api/v1/whoami returns the active auth mode and verified principal:

{
"authMode": "oidc",
"authenticated": true,
"subject": "[email protected]",
"groups": ["platform-admins"]
}
  • When authenticated is true, the embedded Web GUI quietly displays the authenticated subject badge in the top bar. When authMode is none, the top bar stays unchanged.
  • On POST /api/v1/runs/{id}/approve and /reject, the server records the verified principal subject as decidedBy, ignoring any self-reported actor field in the request body.
  • For trusted reverse-proxy identity headers (auth.trustedProxy.*), per-policy OwnerACLConfig, multi-approval quorums (minApprovals), requireDistinctApprover, and opt-in ValidatingAdmissionPolicy protection for kubectl annotate, see Ownership ACLs, Multi-Approval Quorums, and Verified Identity.

Multi-Tenant Namespaced Mode (--watch-namespace and rbac.namespaced=true)

Section titled “Multi-Tenant Namespaced Mode (--watch-namespace and rbac.namespaced=true)”

Faber supports dedicated per-team or per-tenant installations that require zero cluster-scoped RBAC.

Single-Namespace Install (Zero ClusterRole)

Section titled “Single-Namespace Install (Zero ClusterRole)”

Set rbac.namespaced=true in Helm to render a single namespace-scoped Role and RoleBinding in the release namespace with zero ClusterRole and zero ClusterRoleBinding resources. The chart automatically passes --watch-namespace=<release namespace> unless controller.watchNamespaces is specified explicitly:

Terminal window
helm upgrade --install faber oci://ghcr.io/faberops/charts/faber \
--version 2.0.0 \
--namespace team-a \
--create-namespace \
--set rbac.namespaced=true

When you need extra read-only permissions inside the release namespace (for example cert-manager.io certificates or external-secrets.io externalsecrets), add them under rbac.extraNamespaceRules instead of rbac.extraClusterRules:

rbac:
namespaced: true
extraNamespaceRules:
- apiGroups:
- cert-manager.io
resources:
- certificates
verbs:
- get
- list

Multi-Namespace Watch Scope (controller.watchNamespaces)

Section titled “Multi-Namespace Watch Scope (controller.watchNamespaces)”

A shared platform controller can watch a fixed subset of namespaces without watching the whole cluster by passing --watch-namespace=team-a,team-b (environment variable FABER_WATCH_NAMESPACE, or Helm controller.watchNamespaces):

Terminal window
helm upgrade --install faber oci://ghcr.io/faberops/charts/faber \
--version 2.0.0 \
--namespace faber \
--set 'controller.watchNamespaces={team-a,team-b}'

When --watch-namespace is non-empty:

  1. Controller Cache: controller-runtime restricts informer caches strictly to the configured namespaces.
  2. Kubernetes Watch Triggers: K8sWatchManager opens namespace-scoped dynamic informers instead of cluster-wide watches and rejects triggers targeting unwatched namespaces.
  3. RBAC Pre-Flight (SelfSubjectAccessReview): Policy reconciliation checks SelfSubjectAccessReview scoped to each watched namespace rather than cluster-wide, so namespaced Role grants pass pre-flight cleanly.
  4. HTTP API, Webhooks, /v1/invoke, and /mcp: List, get, trigger, cancel, approve, reject, and webhook endpoints filter and enforce the allowed namespace set, returning 403 or 404 for requests targeting namespaces outside --watch-namespace.
  5. Auth Mode Compatibility Guard: Combining rbac.namespaced=true with auth.mode=k8s fails Helm template rendering because Kubernetes TokenReview and SubjectAccessReview APIs require cluster-scoped RBAC. Use auth.mode=oidc or auth.mode=none (behind an authenticating proxy) with rbac.namespaced=true.

Cross-Namespace Isolation and Per-Namespace Quotas

Section titled “Cross-Namespace Isolation and Per-Namespace Quotas”
  • Same-Namespace Isolation: repositoryRef, secretRef, and sandbox.templateRef cannot cross namespaces by default. Set --allow-cross-namespace-refs=true (controller.allowCrossNamespaceRefs=true) only if you explicitly share a central SandboxTemplate across namespaces.
  • Per-Namespace Cost Quota: Set --namespace-max-cost-usd-24h (controller.namespaceMaxCostUsd24h) alongside --global-max-cost-usd-24h (controller.globalMaxCostUsd24h) to bound rolling 24-hour LLM spend per tenant namespace.
  • Zero-Cert CRD CEL Validation: GitOpsRepository, PolicyTemplate, and MaintenancePolicy ship x-kubernetes-validations rules enforced directly by kube-apiserver without admission webhook certificates:
    • GitOpsRepository requires spec.github or spec.forge.
    • MaintenancePolicy rejects any Kubernetes trigger watching core v1 Secret resources.
    • MaintenancePolicy and PolicyTemplate bound diffPolicy.maxChangedFiles <= 1000 and diffPolicy.maxChangedLines <= 50000.
    • MaintenancePolicy rejects setting both spec.preset and spec.templateRef simultaneously.

Configure --audit-log-path (FABER_AUDIT_LOG_PATH or Helm controller.auditLogPath):

  • "" (default): in-memory ring buffer (4096 events) queryable over the API.
  • stdout: writes JSONL audit lines to stdout plus the in-memory ring buffer.
  • /data/audit.jsonl: appends to a 0600 append-only JSONL file (read back directly on query).

Recorded event types: trigger.accepted, trigger.dropped, diff_gate.evaluated, verifier.completed, approval.requested, approval.decided, circuit_breaker.tripped, pr.synced, pr.closed, system.paused, system.resumed, learning.proposed, authz.denied, fleet.command.queued, and fleet.command.executed.

Query or export audit events via HTTP or faberctl:

Terminal window
# HTTP JSONL stream (or pass Accept: application/x-ndjson)
curl -H "Authorization: Bearer $FABER_TOKEN" \
"https://faber.example.com/api/v1/audit?namespace=faber&since=24h&format=jsonl"
# Operator CLI export (table, jsonl, or --json)
faberctl audit export --since 24h --format jsonl > faber-audit.jsonl
faberctl audit export --policy flux-failure-fixer --type approval.decided --limit 50