Skip to content

fix(security): Loki admits only the OpenTelemetry collector from otel, and persona exemplars always come from the review target's project #1100

Closed

Description

@dan-petty

Problem

The Copilot review of release PR #1089 left two threads. The release can't merge with unresolved threads.

  1. Loki admits every pod in otel (k8s/logging/networkpolicy.yaml:24, thread PRRT_kwDOThbRVc6oq3os). The ingress rule for port 3100 uses a namespace-only peer, so any workload in otel, not only the otel-collector release, can push logs to Loki or query it. auth_enabled is false. Copilot suggests combining the namespace selector with the collector's pod label, as the Traefik policies do. Elsewhere in k8s/, a combined namespace-and-pod peer with ports is noted as refused by this cluster's kube-router (k8s/cloudflared/networkpolicy.yaml:44-48), so the fix must be shown to work live.
  2. Persona exemplars can come from the wrong project (src/devops_cli/ai/review/classification.py:50, thread PRRT_kwDOThbRVc6oq3oy). _persona_system_prompt's target is optional, and the fallback path at runner.py:1188 calls it without one. When a review's target differs from the working directory, render_negative_exemplars(Path.cwd()) loads the judged claims of the working directory's project. A claim disproved in another repository can then enter the prompt and suppress a valid finding (fix(review): the review learns only from a person's verdicts, and every reader of the feedback dataset is honest #950).

Acceptance criteria

  • Loki's ingress from otel admits only the collector's pods on 3100. The rule shape is proven on homelab-k3s in a throwaway namespace pair (allowed pod connects, other pod in the same namespace refused), and the throwaway objects are deleted. If kube-router refuses the combined peer, the item records the evidence and uses the narrowest shape that works.
  • A policy test pins the peer. The applied policy matches the file (kubectl diff empty after apply).
  • _persona_system_prompt and render_negative_exemplars take the review target as a required argument, and every caller, the fallback at runner.py:1188 included, passes the review's target. A test with a target outside the working directory shows exemplars come from the target's project only, and fails on the old code.
  • uv run devops ci passes, with a changelog fragment and the task file.
  • Both threads on feat(release): v0.2.25 #1089 are answered in-thread and resolved, and devops pr wait 1089 exits 0.

Key questions

  • Fix now or after the release? Proposed: now. Both are in code this release ships, and the release gate needs 0 unresolved threads.

Strategic alignment

Activity

  1. added this to the v0.2.25 milestone on Oct 3, 2026
  2. added
    type/security
    scope/security
    priority/p0-critical
    on Oct 3, 2026
  3. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Closed by #1101, merged into release/v0.2.25.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

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

    priority/p0-criticalscope/securitytype/security

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions