Skip to content

authz: a policy that does not compile is silent when applied and takes the node's proxy out at the next sidecar or pod restart #1447

Closed as not planned

Description

@bpalermo

Since #1436 the OPA authz sidecar reloads its policy when the ConfigMap changes (opa run --watch), and validating a policy before applying it is the operator's responsibility. What a bad policy then does, measured:

  • Running sidecar: the file is not loaded; the last good policy keeps deciding; no exit, no restart, health 200. Nothing changes that an operator would notice.
  • Any later sidecar restart with the bad file in place: OPA exits 1 and crash-loops; the proxy keeps running and every authorization check is an error, so requests follow failureMode (403 on 18 of 18 with DENY).
  • Any later proxy pod replacement (a roll, a node drain): the new pod never gets past the sidecar; the old pod serves with its own last good policy for its 155 s successor wait, then exits; after that the node has no proxy and requests fail to connect.

So the last good policy lives only in the running process, and the failure surfaces at an unrelated later event.

Detection today: only a log line at level info (Processed file watch event. with a non-null err, five lines per update). OPA's diagnostic endpoint has no reload metric and its status plugin is off; /v1/policies returns the loaded policy, which can be compared with the ConfigMap.

Options: a log-based alert on that line for the authz container; a small check (in the proxy pod's readiness, or an agent metric) that compares the loaded policy's hash with the mounted file and exports a mismatch; enabling OPA's status plugin if it reports bundle/load errors for file watches (to be checked). Not proposed: chart-side validation, which the owner decided against.

Reported by the OPA policy-watch work (PR #1436), not changed there. Measured on kind with OPA 1.21.1.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Activity

  1. added
    enhancement
    chart
    observability
    on Oct 8, 2026
  2. bpalermo commented on Oct 8, 2026

    @bpalermo
    OwnerAuthor

    Related gap found while documenting the policy watch (#1436): nothing reports per-node policy convergence either. After a policy change the fleet decides with two policies until every node's kubelet has delivered the file and its sidecar has reloaded; the delivery time is not bounded (27–64 s was one node's measurement), and the only confirmation is a manual per-pod check. Whatever detects a failed reload should also say which policy each sidecar has loaded (for example a hash of the loaded policy next to a hash of the mounted file), so both "rejected" and "not there yet" are visible per node.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

  3. added
    bug
    and removed
    enhancement
    on Oct 9, 2026
  4. bpalermo commented on Oct 10, 2026

    @bpalermo
    OwnerAuthor

    Closed on the owner's decision: the chart will not run a workload that checks policies. A policy is assumed to be tested before it is distributed (the standing rule from #1383), so what an untested policy does at a later restart is not something the chart or CI will cover.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugchartobservability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions