Skip to content

deploy: cluster-wide secrets get/list/watch for ax-server, unauthenticated Redis, and a personal dev-project bucket as the snapshot default #477

Closed

Description

@danofairanks

Version: main at 0cbfc3d (#469). All three items are visible from the committed manifests and defaults; I have not deployed them to a cluster, so effects that depend on cluster-side policy are marked as such.

1. ax-server's ClusterRole can read every secret in the cluster

deploy/ax-server.yaml:27-45 binds the ax-server service account to:

kind: ClusterRole
rules:
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["get", "list", "watch"]

The only secret access I find in the code is a single GET of a fixed-name secret plus a kubectl get secret fallback: internal/model/client.go:345 (/api/v1/namespaces/<ns>/secrets/<name>) and :372, called through TaskReconciler.SecretResolver with gemini-api-secret / GEMINI_API_KEY (internal/controller/reconciler.go:42-43,89). Nothing lists or watches secrets. list returns secret data, so as written a compromise of the ax-server process or any request-driven path that reaches the API with its token exposes every secret in every namespace.

Suggested direction (untested): verbs: ["get"] with resourceNames: ["gemini-api-secret"] (still cluster-scoped because atespaces map to namespaces, but only that name), or a per-atespace Role/RoleBinding created with the atespace. If Model secretKey names are meant to be resolved by the server later (docs/manifests.md shows anthropic-api-secret), the names would need to be listed or the design stated.

2. The Redis deployment has no authentication, TLS or network restriction

deploy/redis.yaml: redis:7-alpine with no --requirepass/ACL, a ClusterIP Service on 6379, and no NetworkPolicy anywhere in the repo (grep -ri networkpolicy is empty). deploy/ax-server.yaml passes no password: --redis-password defaults to "" (cmd/ax-server/main.go:53) and the manifest sets neither the flag nor REDIS_PASSWORD.

Redis is the task/workspace/model store and the lock backend (internal/store, internal/lock), and the reconciler acts on what the store returns. So any pod that can reach ax-redis.ax-system.svc.cluster.local:6379 can read task specs (including spec.env values) and write or alter them. If the cluster has default-deny network policies or a mesh in front, this is mitigated outside the repo; the manifests as committed don't say so.

Suggested direction: set a password from a Secret in both manifests, add a NetworkPolicy allowing only ax-server to reach Redis, or label deploy/redis.yaml as dev-only if that is the intent.

3. A developer's project bucket is the compiled-in snapshot default

  • internal/substrate/client.go:211: DefaultSnapshotsBucket = "gs://dberkov-gke-dev3/ate-env/", used in BuildActorTemplate whenever snapshotsBucket is empty and AX_SNAPSHOTS_BUCKET is unset (:274-282).
  • deploy/ax-server.yaml:83-84 sets AX_SNAPSHOTS_BUCKET to the same value.
  • demo.sh:39 defaults the task image to gcr.io/dberkov-gke-dev3/ax-task-runner@sha256:....

docs/runner.md:26 says Substrate snapshots /workspace on suspend, and the roadmap mentions checkpointed memory. So a deployment that follows the repo and doesn't override the variable points its suspend snapshots at that bucket. What happens depends on the bucket's access policy, which I can't see: either the writes fail, or they succeed into a project the deployer doesn't control. It also exposes an internal dev project name in a public repo.

Suggested direction: no compiled-in default (fail with a clear error when the bucket isn't configured), a placeholder in the manifest, and AX_IMAGE_REPO required or defaulted to the public image already named in v1alpha1.DefaultTaskImage for demo.sh.

Not checked

Actual cluster behaviour (RBAC effect, NetworkPolicies outside the repo, the bucket's IAM), whether Substrate itself constrains the snapshot location, and whether any of this already has an issue. Related but separate: the API server itself has no authentication (#TODO link if filed).

I'm glad to split this into separate issues or send small patches if you prefer.

Activity

  1. added
    devx
    on Oct 15, 2026
  2. self-assigned this
    on Oct 24, 2026
  3. added a commit that references this issue on Oct 27, 2026
    785b592
  4. added a commit that references this issue on Oct 27, 2026
    33884fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

devx

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions