Skip to content

fix(k8s): narrow the in-namespace egress of the object store #6707

Description

@dan-petty

Problem

Checked on the live cluster on 2026-11-21 (k3s v1.37.2+k3s1 on 5 nodes, devops-cli main 11fee3f), after the merge of #6689.

  • Build test step 4 of k8s/README.md (section Object Store) fails: kubectl -n object-store exec seaweedfs-filer-0 -- nc -z -w 3 seaweedfs-admin 33646 exits 0, also to the pod IP. Only the worker may reach the admin gRPC port, which has no authentication and no release with a fix (GHSA-3qr2-qw48-cj6q). The filer also reaches TCP 9327 of the admin pod and of the volume pods on other nodes, which only namespace monitoring may reach.

  • The text of object-store-perimeter is correct: ingress on TCP 33646 only from the worker pods (k8s/object-store/networkpolicy.yaml). Its egress rule to: [podSelector: {}] has no ports, so each pod of the namespace may send to each port of each other pod.

  • The network policy controller of this cluster does not apply the ingress rules of the destination pod when an egress rule of the source pod allows the traffic. A controlled probe with temporary namespaces (busybox httpd server, an allowed and a denied client, ingress on TCP 8080 only from allowed; all namespaces deleted after the test) gave:

    Policy shape Nodes allowed denied
    Ingress only same node 0 1 (refused)
    Ingress only two nodes 0 1 (refused)
    Ingress and Egress in one policy, egress to: [podSelector: {}] same node 0 0 (passes)
    Same, across nodes two nodes 0 0 (passes)

    Values are the exit codes of nc -z -w 3 <server pod IP> 8080.

  • Retest of 2026-11-22: with two separate policies (an ingress-only policy on the server and an egress-only policy on the clients) the denied client is refused, on one node and across nodes, on two nodes and twice. The first two-policy result was a timing effect. The bypass needs one policy with both types, and single-type policies work.

  • So the advisory answer of ADR 0034 does not hold now: each pod of object-store (filer, volume, S3 gateway) reaches the admin gRPC port. No namespace has the label backup-client: "true" yet, so no pod outside the namespace reaches the S3 gateway.

Proposed remedy

Make the egress of each source pod as narrow as the ingress of its destination: then no egress rule of object-store-perimeter covers TCP 33646, and the controller refuses the filer at both ends. The split of each policy with both types into single-type policies is in #6708, with its check row:

  • In object-store-perimeter, give the in-namespace egress rule the ports of the in-namespace ingress rule (9333, 19333, 8444, 18444, 8888, 18888, 8333, 18333, 23646), not all ports.
  • Add a policy that selects only the worker pods (app.kubernetes.io/name: seaweedfs, app.kubernetes.io/component: worker) with egress to the admin pod on TCP 33646.
  • Keep the ingress rules as they are.
  • Extend the check of the admin port (admin_port_problems in tests/gate/k8s_checks/object_store.py) to the egress rules: it fails when a policy gives a pod that is not the worker an egress rule that covers TCP 33646, including a rule with no ports. Write the fixture checks first.
  • Write the controller behavior and the egress rule in the Security section of the object store in k8s/README.md, and correct the advisory line of ADR 0034 with a dated Status History line if its text is no longer true.

Acceptance criteria

  • uv run devops ci --check --only k8s passes, and the new fixture check fails on a policy whose in-namespace egress has no ports.
  • After the sync: kubectl -n object-store exec seaweedfs-filer-0 -- nc -z -w 3 seaweedfs-admin 33646 exits 1, the same command from deploy/seaweedfs-worker -c worker exits 0, and kubectl -n object-store exec seaweedfs-filer-0 -- nc -z -w 3 <volume pod IP> 9327 exits 1.
  • After the sync, kubectl -n object-store get seaweed seaweedfs -o jsonpath='{.status.conditions[0].message}' prints Seaweed cluster is ready, and the 13 pods are Ready.

Dependencies

None. The other namespaces with the same egress shape are in the related item #6708.

Activity

  1. added
    type/bug
    scope/k8s
    source/agent
    on Nov 21, 2026
  2. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P1-High. A live unauthenticated admin port is reachable by all pods in the namespace, and a GHSA advisory is cited. The advisory GHSA-3qr2-qw48-cj6q does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.
    • Related: feat(k8s): run a three-node SeaweedFS object store #4750, which asks for a different change. #4750 created the object-store namespace and its NetworkPolicy; this candidate fixes a security defect in that delivered policy.
  3. added
    status/new
    effort/medium
    value/high
    priority/p1-high
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 21, 2026
  4. added a commit that references this issue on Nov 22, 2026
  5. added
    status/in-review
    and removed
    status/in-progress
    on Nov 22, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 22, 2026
  7. dan-petty commented on Nov 22, 2026

    @dan-petty
    OwnerAuthor

    Live probes after the merge of #6712 and the Argo CD sync (object-store at f14cb8b, 2026-11-22 01:19 UTC), exit codes of nc -z -w 3:

    • filer to seaweedfs-admin TCP 33646: 1 (refused), as required.
    • worker to seaweedfs-admin TCP 33646: 0.
    • filer to a volume pod on another node, TCP 9327: 1 (refused).
    • filer to seaweedfs-master TCP 9333 (an allowed path): 0.
    • Seaweed cluster is ready, 13 pods Ready. Policies: object-store-operator, object-store-perimeter, object-store-worker.

    So only the worker reaches the admin gRPC port again (GHSA-3qr2-qw48-cj6q). The split of the policies with both types follows in #6708.

  8. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-22 01:30 UTC

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

    effort/mediumpriority/p1-highscope/k8ssource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions