diff --git a/docs/4-implementation/swarm/credentials-reference.md b/docs/4-implementation/swarm/credentials-reference.md index 960044614..72cf59fb3 100644 --- a/docs/4-implementation/swarm/credentials-reference.md +++ b/docs/4-implementation/swarm/credentials-reference.md @@ -133,12 +133,12 @@ pieces fit, and the reasoning behind them, is in [`credentials.md`](../../2-hand | the swarm collector's copy of its OIDC secret | `swarm-bao-otel-oidc.service` reads it out of the swarm secret store, **on every host that runs the collector and holds a store identity** | `/run/swarm-otel-oidc/.secret` on the host's tmpfs, bind-mounted read-only into the `swarm-otel` container — never on persistent disk, so a reboot fetches it again | same unit, same path — one route, co-located or not. A collector with no store identity has `clientSecretFile == null`, its already-supported unauthenticated-push degrade — see [swarm-level secrets](../../2-handbook/swarm/credentials.md#swarm-level-secrets) | | the log store's listener credential | `swarm-bao-store-auth.service` creates it in the swarm secret store at `swarm/services/victorialogs/store-auth` when the store holds none, then copies it out, **on the host that runs the log store**. The grant is create and read, without update | `/var/lib/swarm-store-auth/victorialogs.conf` (root and the nginx group, `0640`, in a directory of `0750`): the `Authorization` header the vhost's store locations send, and `/var/lib/swarm-store-auth/victorialogs.password` (root only, `0600`), from which the unit publishes the Secret `swarm-victorialogs-credentials`, key `store-auth`, which the store's pod mounts | nothing to copy: the vhost and the store are on one host. If the nginx file and the Secret hold different values, every request through the gateway answers 401 until the unit runs again; it writes the nginx file first and the Secret after | | the metrics store's listener credential | `swarm-bao-store-auth.service` creates it in the swarm secret store at `swarm/services/victoriametrics/store-auth` when the store holds none, then copies it out, **on the host that runs the metrics store**. The grant is create and read, without update | `/var/lib/swarm-store-auth/victoriametrics.conf` (root and the nginx group, `0640`, in a directory of `0750`): the `Authorization` header the vhost's store locations send, and `/var/lib/swarm-store-auth/victoriametrics.password` (root only, `0600`), from which the unit publishes the Secret `swarm-victoriametrics-credentials`, key `store-auth`, which the store's pod mounts | nothing to copy: the vhost and the store are on one host. If the nginx file and the Secret hold different values, every request through the gateway answers 401 until the unit runs again; it writes the nginx file first and the Secret after | -| Grafana's listener credential | `swarm-bao-store-auth.service` creates it in the swarm secret store at `swarm/services/grafana/store-auth` when the store holds none, then copies it out, **on the host that runs Grafana**. The grant is create and read, without update | `/var/lib/swarm-store-auth/grafana.conf` (root and the nginx group, `0640`, in a directory of `0750`): the `Authorization` header the vhost's `/metrics` location sends, and `/var/lib/swarm-store-auth/grafana.password` (root only, `0600`), from which the unit publishes the Secret `swarm-grafana-credentials`, key `store-auth`, which Grafana's pod mounts | nothing to copy: the vhost and Grafana are on one host. If the nginx file and the Secret hold different values, `/metrics` through the gateway answers 401 until the unit runs again; it writes the nginx file first and the Secret after | +| Grafana's listener credential | `swarm-bao-store-auth.service` creates it in the swarm secret store at `swarm/services/grafana/store-auth` when the store holds none, then copies it out, **on the host that runs Grafana**. The grant is create and read, without update | `/var/lib/swarm-store-auth/grafana.conf` (root and the nginx group, `0640`, in a directory of `0750`): the `Authorization` header the vhost's `/metrics` location sends, and `/var/lib/swarm-store-auth/grafana.password` (root only, `0600`), from which the unit publishes the Secret `swarm-grafana-credentials`, key `store-auth`, which Grafana's pod mounts | nothing to copy: the vhost and Grafana are on one host. If the nginx file and the Secret hold different values, `/metrics` through the gateway answers 401 until the unit runs again; it writes the nginx file first and the Secret after | | the queue exporter's listener credential | `swarm-bao-store-auth.service` creates it in the swarm secret store at `swarm/services/nats/exporter-auth` when the store holds none, then copies it out, **on the host that runs the queue**. The grant is create and read, without update | `/var/lib/swarm-store-auth/nats.conf` (root and the nginx group, `0640`, in a directory of `0750`): the `Authorization` header the gateway's `/metrics` location for the queue sends; `/var/lib/swarm-store-auth/nats.password` (the password, root only) and `/var/lib/swarm-store-auth/nats.hash` (its bcrypt hash, from which the unit publishes the Secret `swarm-nats-exporter-auth`, key `hash`, which the exporter container reads as `EXPORTER_HASH`). The password reaches nothing but the host: the Secret and the pod's command line hold the hash | nothing to copy: the vhost and the pod are on one host. An nginx file that doesn't match the hash makes the gateway's scrape answer 401 until the unit runs again; the exporter reads the hash as it starts, so a rotated password also needs a restart of the queue's pod | -| Grafana's copy of its OIDC secret | the init container `fetch-secrets` of Grafana's pod reads it out of the swarm secret store with the pod's ServiceAccount token | `/run/grafana-secrets/.secret` in the pod's in-memory `runtime` volume, mode 0400, never on a disk; Grafana reads it with `$__file{}` | the same container, the same path, on every start. Nothing for an operator to place. A replaced secret takes effect when the pod restarts: `kubectl -n hyperhive rollout restart deployment/swarm-grafana` | -| Grafana's admin password | the init container creates it in the swarm secret store at `swarm/services//admin/password` when the store holds none, then writes it out. The pod's role may create that leaf but not update it, so the store keeps the first value, and the secret publisher can't write it. To rotate, run `bao kv metadata delete secret/swarm/services//admin/password` with a token that may, such as the root token (the pod's, the publisher's and the controller's can't), then restart the pod; a plain `bao kv delete` isn't enough, see [the callout xkey's section](credentials.md#the-queues-callout-xkey) | `/run/grafana-secrets/admin-password` in the pod's in-memory `runtime` volume: `security.admin_password` for a new database, and `grafana cli admin reset-admin-password` before `grafana server` for an existing one, on every start | the same container, the same path. Grafana doesn't start until the file exists, so it stays down rather than falling back to the upstream default `admin` | -| Grafana's metrics bearer | the init container creates it in the swarm secret store at `swarm/services//metrics/bearer` when the store holds none, then writes it out. Same grant as the admin password, create without update. To rotate, run `bao kv metadata delete secret/swarm/services//metrics/bearer` with a token that may, then restart the pod | `/run/grafana-secrets/metrics-bearer` in the pod's in-memory `runtime` volume, holding `Bearer `: the metrics datasource's `Authorization` header. The logs datasource sends the same header. `swarm-metrics-auth` and `swarm-logs-grafana-auth`, in the stores' responders' pods, read the stored value themselves, each under its own ServiceAccount | the same container, the same path, on every start | -| Grafana's datasource encryption key | the init container stores it in the swarm secret store at `swarm/services//secret-key` when the store holds none, then writes it out. The value it stores is the file the earlier container generated at `/var/lib/nixos-containers/swarm-grafana/var/lib/grafana-secret/secret_key` (read-only, through a claim on a static local volume) when there is one, else a new key; with no file, an empty leaf and a `grafana.db` that holds rows in `data_keys` it exits non-zero, names the leaf and stores nothing. Same grant as the admin password, create without update. A store that's down or doesn't grant the leaf fails the container, and Grafana doesn't start | `/run/grafana-secrets/secret-key` in the pod's in-memory `runtime` volume: `security.secret_key` | the same container, the same path. Changing the key leaves Grafana unable to read the data keys it wrapped, so never delete the store path to rotate it | +| Grafana's copy of its OIDC secret | the init container `fetch-secrets` of Grafana's pod reads it out of the swarm secret store with the pod's ServiceAccount token | `/run/grafana-secrets/.secret` in the pod's in-memory `runtime` volume, mode 0400, never on a disk; Grafana reads it with `$__file{}` | the same container, the same path, on every start. Nothing for an operator to place. A replaced secret takes effect when the pod restarts: `kubectl -n hyperhive rollout restart deployment/swarm-grafana` | +| Grafana's admin password | the init container creates it in the swarm secret store at `swarm/services//admin/password` when the store holds none, then writes it out. The pod's role may create that leaf but not update it, so the store keeps the first value, and the secret publisher can't write it. To rotate, run `bao kv metadata delete secret/swarm/services//admin/password` with a token that may, such as the root token (the pod's, the publisher's and the controller's can't), then restart the pod; a plain `bao kv delete` isn't enough, see [the callout xkey's section](credentials.md#the-queues-callout-xkey) | `/run/grafana-secrets/admin-password` in the pod's in-memory `runtime` volume: `security.admin_password` for a new database, and `grafana cli admin reset-admin-password` before `grafana server` for an existing one, on every start | the same container, the same path. Grafana doesn't start until the file exists, so it stays down rather than falling back to the upstream default `admin` | +| Grafana's metrics bearer | the init container creates it in the swarm secret store at `swarm/services//metrics/bearer` when the store holds none, then writes it out. Same grant as the admin password, create without update. To rotate, run `bao kv metadata delete secret/swarm/services//metrics/bearer` with a token that may, then restart the pod | `/run/grafana-secrets/metrics-bearer` in the pod's in-memory `runtime` volume, holding `Bearer `: the metrics datasource's `Authorization` header. The logs datasource sends the same header. `swarm-metrics-auth` and `swarm-logs-grafana-auth`, in the stores' responders' pods, read the stored value themselves, each under its own ServiceAccount | the same container, the same path, on every start | +| Grafana's datasource encryption key | the init container stores it in the swarm secret store at `swarm/services//secret-key` when the store holds none, then writes it out. The value it stores is the file the earlier container generated at `/var/lib/nixos-containers/swarm-grafana/var/lib/grafana-secret/secret_key` (read-only, through a claim on a static local volume) when there is one, else a new key; with no file, an empty leaf and a `grafana.db` that holds rows in `data_keys` it exits non-zero, names the leaf and stores nothing. Same grant as the admin password, create without update. A store that's down or doesn't grant the leaf fails the container, and Grafana doesn't start | `/run/grafana-secrets/secret-key` in the pod's in-memory `runtime` volume: `security.secret_key` | the same container, the same path. Changing the key leaves Grafana unable to read the data keys it wrapped, so never delete the store path to rotate it | | the swarm controller's webhook secret | `swarm-controller` stores it in the swarm secret store at `swarm/controller/swarm-controller/forge/webhook-secret` when the store holds none: the value of `webhook-secret` in its state directory, or a new one when there is no such file. The state directory file stays on disk and is the fallback while the store is unreachable or its policy doesn't grant the path yet | the swarm secret store; the controller holds it in memory and registers the same value with the forge's hooks | nothing to place: the controller's store leaf already exists. A store that stays unreachable on a start with no state directory file leaves the webhook endpoint answering 503 until the store answers: the controller re-reads it in the background, at most five minutes apart, and registers the forge hooks once it has the secret | | the secret store's unseal or recovery keys and root token, as `bao operator init -format=json` printed them | `bao operator init`, run once by `swarmctl bao init` (or `swarmctl setup`) on the host where the operator runs it | `bao-init.json` in swarmctl's state directory (`$XDG_STATE_HOME/swarmctl`, else `~/.local/state/swarmctl`, so `/root/.local/state/swarmctl` for root): file mode 0600 in a 0700 directory, written before swarmctl parses the output, so a parse failure leaves the keys on disk. Nothing reads it. The operator records the keys off the host, then runs `shred -u` on it; while it exists `swarmctl bao init` refuses to run | nothing: the file is on the host that ran `swarmctl bao init`, and no other host needs it | | the metrics store responder's own store leaf (cert + key) | `signLeaf` in `glue-bao-tls.nix` (`swarm-bao-pki.service`), on the host that runs the secret store, once, subject `deploy.bao.metricsAuthCommonName`. `swarm-bao-metrics-auth-policy.service` writes the `swarm-metrics-auth` role and its read grants on every agent's queue and observability leaves and on the bearer leaf, nothing else | `/var/lib/swarm-bao-pki/metrics-auth.pem` and `metrics-auth-key.pem` on the store's host, handed to `swarm-metrics-auth` through `LoadCredential` (paths in argv, never values) and read by path by `swarm-victoriametrics-forwarder-oidc` | **the operator** places a leaf with that subject on the metrics store's host and names it in `deploy.victoriametrics.authBaoClientCertFile` / `authBaoClientKeyFile`; evaluation fails naming both until then. If the store is on another host, deploy that host first: the role must exist before the responder's login succeeds, and until it does the gateway refuses every Grafana query (fail closed) | @@ -148,13 +148,13 @@ pieces fit, and the reasoning behind them, is in [`credentials.md`](../../2-hand | a hive's copy of its own OIDC secret | hive-c0re reads it out of the swarm secret store when it first connects to the queue, under the hive's own leaf | the daemon's memory only; never on disk | same read, co-located or not. Nothing for an operator to place beyond the hive's store leaf (`deploy.bao.clientCertFile`) | | the hive collector's copy of its hive's OIDC secret | `swarm-bao-hive-otel-oidc.service` reads it out of the swarm secret store under the hive's own leaf, **on every hive that runs the collector and holds that leaf**; the leaf is the source | `/run/hive-otel-oidc/hive-.secret` on the hive's host tmpfs, 0400 root, loaded by `LoadCredential` — never on persistent disk, so a reboot fetches it again | same unit, same path, co-located or not. Nothing for an operator to place beyond the hive's store leaf (`deploy.bao.clientCertFile`). Naming a secret file with `otel.clientSecretFile` instead is legacy for a host without a leaf: the build warns, and the fix is to place the leaf from `/var/lib/swarm-bao-pki/hives//` and drop the setting | | the swarm controller's forge token | the forge's `forgejo-swarm-controller-account`, in-container, once. An attempt that fails or runs past 30 seconds retries after 5 seconds, then at growing intervals up to 5 minutes | the swarm secret store at `swarm/controller/swarm-controller/forge/token`, written by the mint under the forge publisher's leaf, which the forge container loads as a credential; the controller holds it in memory only. `/var/lib/forgejo/swarm-controller-token-name` in the forge container holds its name, the minter's record that it has minted | nothing to place beyond the controller's store leaf. A forge host without the store needs the publisher's leaf placed (`deploy.bao.forgePublisherClientCertFile`) | -| the swarm controller's Grafana token | the `controller-token` sidecar of Grafana's pod, as Grafana's built-in admin on the pod's loopback: it creates the `swarm-controller` service account as a Viewer (and sets it back to Viewer on every pass), mints a token for it and writes it to the swarm secret store at `swarm/controller/swarm-controller/grafana/token` under the pod's login. It waits for Grafana's health route before its first call. It runs every five minutes: it keeps a stored token Grafana accepts, and replaces one Grafana refuses with 401 (or a missing one), deleting every other token of that account first | the swarm secret store only; the controller reads it for `GET /api/alerts` and holds it in memory, re-reading the store once when Grafana answers 401 | nothing to place. Until the sidecar has run, `/api/alerts` answers 503 naming the empty path | +| the swarm controller's Grafana token | the `controller-token` sidecar of Grafana's pod, as Grafana's built-in admin on the pod's loopback: it creates the `swarm-controller` service account as a Viewer (and sets it back to Viewer on every pass), mints a token for it and writes it to the swarm secret store at `swarm/controller/swarm-controller/grafana/token` under the pod's login. It waits for Grafana's health route before its first call. It runs every five minutes: it keeps a stored token Grafana accepts, and replaces one Grafana refuses with 401 (or a missing one), deleting every other token of that account first | the swarm secret store only; the controller reads it for `GET /api/alerts` and holds it in memory, re-reading the store once when Grafana answers 401 | nothing to place. Until the sidecar has run, `/api/alerts` answers 503 naming the empty path | | an agent's API-key environment (`ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL`, an ACP provider key) | `hive-agent-backend-env.service`, in the agent's container, on every agent with a store, whatever its runtime or its login kind. When the store holds nothing at `swarm/agents//backend-env` and `backendEnvironmentFile` is a non-empty file, it creates the leaf with the file's exact bytes and `-cas=0`, under the agent's own leaf, which may create that path and not update it. It never rotates a value and never rewrites or deletes the file. To set or replace a key, use **set the API-key environment** in the swarm UI (`PUT /api/hives/{hive}/agents/{agent}/backend-env`): `swarm-controller` overwrites the leaf with its own grant, and the store's value then wins over the file. Its **remove** (`DELETE` on the same path) deletes the leaf, and an agent whose file has content then creates it from that file again | the swarm secret store at that path; the unit writes it to `/run/hive-agent-backend-env/env` (tmpfs, `0600`, root), and `hive-agent` and `hive-subagent-daemon` load that after `backendEnvironmentFile` as `EnvironmentFile=` | the same unit, same path. A variable in the store wins over the same one in the file. With the store down at a start, the file alone carries the agent, as it did before the store held a copy; with an older hive build the agent ignores the leaf and keeps reading the file | | an agent's proxy settings (`HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY`, the credential in the proxy URL) | `hive-agent-proxy-credential.service`, in the agent's container, as the agent user, at start and every 10 minutes: it reads `swarm/agents//proxy-credential` under the agent's own leaf and builds the file from it. It writes nothing while the path holds nothing or the hive's facts name no squid | `/run/hive-agent-proxy-credential/proxy.env` (tmpfs, `0600`, the agent user); the harness, its bash tool, the subagents, the MCP servers and the pollers load it as `EnvironmentFile=-` and read it when they start | With no credential, or on a hive that writes no `HIVE_SQUID_PROXY` and `HIVE_EGRESS_NO_PROXY` fact, nothing writes the file and a unit has no proxy variable and reaches the internet without the proxy; the host still redirects the web traffic of a `restricted` or `log` agent into squid (see [the network reference](../networking/network.md#intercepted-web-traffic)). A failed read keeps the file already in place. A unit started before the file appeared goes direct until its next start. The credential is also in the environment of every process those units start, so `env` in the agent's shell prints it | | an agent's claude login (`.credentials.json`) | `swarm-claude-login.service`, in its container, when an operator completes `claude auth login` from the agent's card in the swarm UI; it stores the file as a new version at `swarm/agents//claude-credentials` under its own leaf, which may create and update that path and read nothing under an agent | the swarm secret store at that path; the agent's `hive-agent` reads it under the agent's own leaf every 30 seconds while it waits for a login and writes it to `~/.claude/.credentials.json` | the same read, co-located or not; nothing for an operator to place beyond the agent's store leaf. When the store's copy and the agent's differ the KV version decides: the agent installs only a version newer than the last it installed (`claude-credentials-version` under the harness dir), because claude rotates the refresh token in its own copy and the stored one goes stale. The agent ignores a stale or equal version, and a relogin writes a newer one — [claude-login.md](../../2-handbook/swarm/claude-login.md) | | the queue responder's copy of its OIDC secret | the responder reads it out of the swarm secret store itself as it starts, under its own leaf, and again when authelia refuses it | the daemon's memory only; never on disk | same read, wherever authelia runs. Nothing for an operator to place beyond the responder's store leaf (`deploy.nats.authBaoClientCertFile`) | | the queue container's journal forwarder's copy of the queue's OIDC secret | `swarm-journal-forwarder-oidc.service` inside the `swarm-nats` container reads it out of the swarm secret store under the responder's store leaf, and again every 10 minutes | `/run/swarm-journal-forwarder-oidc/client-secret` on the container's tmpfs, root `0400`, never on persistent disk; `LoadCredential` hands it to the collector | same unit, same path. After a reboot the fetch fails fast while the store is down and retries with a delay that grows to 5 minutes; the attempt that succeeds starts the collector, which isn't part of the container's boot, and it resumes from its saved journal cursor. Nothing for an operator to place beyond the responder's store leaf (`deploy.nats.authBaoClientCertFile`) | -| the CI runner, cache, forge and homeserver containers' journal forwarders' OIDC secrets | `swarm-journal-forwarder-oidc.service` inside each container reads its forwarder client's secret (`swarm..otel.clientId`) out of the swarm secret store under the store leaf the host already holds for that service, handed in as a system credential (bound in read-only, for the homeserver's), and again every 10 minutes | `/run/swarm-journal-forwarder-oidc/client-secret` on the container's tmpfs, root `0400`, never on persistent disk; `LoadCredential` hands it to the collector | same unit, same path. Nothing for an operator to place beyond those leaves (`deploy.bao.ciRunnerClientCertFile`, `deploy.bao.forgePublisherClientCertFile`, `deploy.bao.atticClientCertFile`, `deploy.matrix.ctlBaoClientCertFile`) | +| the CI runner, cache, forge and homeserver containers' journal forwarders' OIDC secrets | `swarm-journal-forwarder-oidc.service` inside each container reads its forwarder client's secret (`swarm..otel.clientId`) out of the swarm secret store under the store leaf the host already holds for that service, handed in as a system credential (bound in read-only, for the homeserver's), and again every 10 minutes | `/run/swarm-journal-forwarder-oidc/client-secret` on the container's tmpfs, root `0400`, never on persistent disk; `LoadCredential` hands it to the collector | same unit, same path. Nothing for an operator to place beyond those leaves (`deploy.bao.ciRunnerClientCertFile`, `deploy.bao.forgePublisherClientCertFile`, `deploy.bao.atticClientCertFile`, `deploy.matrix.ctlBaoClientCertFile`) | | the CI run poller's forge token | `swarm-controller`, with the forge's admin API, for its `ci-metrics` account, at start and in a five-minute pass | the swarm secret store at `swarm/services/ci-metrics/forge/token`; `swarm-ci-metrics` reads it once per pass under its own leaf and holds it in memory for that pass. When the store's token no longer matches the forge's, the controller's next pass mints a new one; until then the poller's forge calls answer 401, the unit fails and no cursor moves | nothing to place beyond the poller's leaf (`deploy.bao.ciMetricsClientCertFile`), on a host without the store | | the CI run poller's copy of its OIDC secret | authelia's mint, which creates it in the swarm secret store | `swarm-ci-metrics` reads `swarm/services//oidc/client` once per pass under its own leaf, and again when authelia refuses it; memory only. While it differs from authelia's, the token request fails, nothing gets pushed and no cursor moves | same leaf, nothing else | | authelia's container's journal forwarder's OIDC secret | authelia's mint, in its container, like every client's secret (`swarm.authelia.otel.clientId`). It creates it at `swarm/services//oidc/client`, and `swarm-journal-forwarder-oidc.service` in the same container reads it back under the secret publisher's leaf, at start and every 10 minutes | `/run/swarm-journal-forwarder-oidc/client-secret` on the container's tmpfs, root `0400`; `LoadCredential` hands it to the collector. | none: the forwarder runs only in authelia's container, and is off there without the publisher's leaf | @@ -191,22 +191,22 @@ a role and a policy of its own, and reaches one path, except the review classifier's, the CI runner's, the builder's, the cache's, the CI run poller's, the claude login minter's, the forge host's and Grafana's, which reach more than one: -| unit | option pair under `deploy.bao.` | reads, or writes | -| Grafana's pod: the init container and the sidecar, through the jwt role `swarm-grafana-oidc` | `grafanaOidcClientCertFile` / `grafanaOidcClientKeyFile` | reads `swarm/services//oidc/client`; creates and reads `swarm/services//admin/password`, `swarm/services//metrics/bearer` and `swarm/services//secret-key`; reads and writes `swarm/controller/swarm-controller/grafana/token` | +| unit | option pair under `deploy.bao.` | reads, or writes | +| Grafana's pod: the init container and the sidecar, through the jwt role `swarm-grafana-oidc` | `grafanaOidcClientCertFile` / `grafanaOidcClientKeyFile` | reads `swarm/services//oidc/client`; creates and reads `swarm/services//admin/password`, `swarm/services//metrics/bearer` and `swarm/services//secret-key`; reads and writes `swarm/controller/swarm-controller/grafana/token` | | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `swarm-bao-otel-oidc` | `otelOidcClientCertFile` / `otelOidcClientKeyFile` | `swarm/services//oidc/client` | -| `swarm-bao-forwarder-oidc` | `forwarderOidcClientCertFile` / `forwarderOidcClientKeyFile` | `swarm/services//oidc/client` | -| `swarm-bao-ci-runner`, and the runner's journal forwarder in its container | `ciRunnerClientCertFile` / `ciRunnerClientKeyFile` | `swarm/services/ci-runner/registration-token` and `swarm/services//oidc/client` | -| `swarm-review-classifier`, in its container | `reviewClassifierClientCertFile` / `reviewClassifierClientKeyFile` | `swarm/services/review-classifier/anthropic-api-key`, `swarm/services/review-classifier/acp-provider` and `swarm/services//oidc/client` | -| `swarm-claude-login`, in its container | `claudeLoginClientCertFile` / `claudeLoginClientKeyFile` | creates and updates `swarm/agents/+/claude-credentials`, reads and deletes its metadata; reads `swarm/services//oidc/client` | -| `swarm-notify-router`, in its container | `notifyRouterClientCertFile` / `notifyRouterClientKeyFile` | `swarm/services//oidc/client` | -| `swarm-stt`, in its container | `sttClientCertFile` / `sttClientKeyFile` | `swarm/services//oidc/client` | -| `swarm-builder`, in its container | `builderClientCertFile` / `builderClientKeyFile` | `swarm/services/builder/forge/token`, `swarm/services/attic/push-token` and `swarm/services//oidc/client` | -| `swarm-bao-attic-secret` and `swarm-bao-attic-tokens` | `atticClientCertFile` / `atticClientKeyFile` | creates and reads `swarm/services/attic/jwt-secret`, `swarm/services/attic/push-token` and `swarm/services/attic/pull-token` | -| `swarm-archive-users`, `swarm-archive-prune`, `swarm-archive-check` and, with an S3 bucket, `swarm-archive` | `archiveClientCertFile` / `archiveClientKeyFile` | reads `swarm/services/archive/users/*`, `swarm/services/archive/restic/*` and `swarm/services/archive/s3/*`, lists `swarm/services/archive/users/` | -| `swarm-ci-metrics` | `ciMetricsClientCertFile` / `ciMetricsClientKeyFile` | `swarm/services/ci-metrics/forge/token` and `swarm/services//oidc/client` | -| `swarm-bao-forge-oidc` and the forge's controller-token mint and its journal forwarder in its container | `forgePublisherClientCertFile` / `forgePublisherClientKeyFile` | writes `swarm/controller/swarm-controller/forge/token`; reads `swarm/services//oidc/client` and `swarm/services//oidc/client` | -| `swarm-bao-store-auth` | `storeAuthClientCertFile` / `storeAuthClientKeyFile` | creates and reads `swarm/services/victorialogs/store-auth`, `swarm/services/victoriametrics/store-auth`, `swarm/services/grafana/store-auth` and `swarm/services/nats/exporter-auth` | +| `swarm-bao-otel-oidc` | `otelOidcClientCertFile` / `otelOidcClientKeyFile` | `swarm/services//oidc/client` | +| `swarm-bao-forwarder-oidc` | `forwarderOidcClientCertFile` / `forwarderOidcClientKeyFile` | `swarm/services//oidc/client` | +| `swarm-bao-ci-runner`, and the runner's journal forwarder in its container | `ciRunnerClientCertFile` / `ciRunnerClientKeyFile` | `swarm/services/ci-runner/registration-token` and `swarm/services//oidc/client` | +| `swarm-review-classifier`, in its container | `reviewClassifierClientCertFile` / `reviewClassifierClientKeyFile` | `swarm/services/review-classifier/anthropic-api-key`, `swarm/services/review-classifier/acp-provider` and `swarm/services//oidc/client` | +| `swarm-claude-login`, in its container | `claudeLoginClientCertFile` / `claudeLoginClientKeyFile` | creates and updates `swarm/agents/+/claude-credentials`, reads and deletes its metadata; reads `swarm/services//oidc/client` | +| `swarm-notify-router`, in its container | `notifyRouterClientCertFile` / `notifyRouterClientKeyFile` | `swarm/services//oidc/client` | +| `swarm-stt`, in its container | `sttClientCertFile` / `sttClientKeyFile` | `swarm/services//oidc/client` | +| `swarm-builder`, in its container | `builderClientCertFile` / `builderClientKeyFile` | `swarm/services/builder/forge/token`, `swarm/services/attic/push-token` and `swarm/services//oidc/client` | +| `swarm-bao-attic-secret` and `swarm-bao-attic-tokens` | `atticClientCertFile` / `atticClientKeyFile` | creates and reads `swarm/services/attic/jwt-secret`, `swarm/services/attic/push-token` and `swarm/services/attic/pull-token` | +| `swarm-archive-users`, `swarm-archive-prune`, `swarm-archive-check` and, with an S3 bucket, `swarm-archive` | `archiveClientCertFile` / `archiveClientKeyFile` | reads `swarm/services/archive/users/*`, `swarm/services/archive/restic/*` and `swarm/services/archive/s3/*`, lists `swarm/services/archive/users/` | +| `swarm-ci-metrics` | `ciMetricsClientCertFile` / `ciMetricsClientKeyFile` | `swarm/services/ci-metrics/forge/token` and `swarm/services//oidc/client` | +| `swarm-bao-forge-oidc` and the forge's controller-token mint and its journal forwarder in its container | `forgePublisherClientCertFile` / `forgePublisherClientKeyFile` | writes `swarm/controller/swarm-controller/forge/token`; reads `swarm/services//oidc/client` and `swarm/services//oidc/client` | +| `swarm-bao-store-auth` | `storeAuthClientCertFile` / `storeAuthClientKeyFile` | creates and reads `swarm/services/victorialogs/store-auth`, `swarm/services/victoriametrics/store-auth`, `swarm/services/grafana/store-auth` and `swarm/services/nats/exporter-auth` | The option names are `deploy.bao.`; the common names, what a missing leaf costs and how to place a leaf by hand are in diff --git a/nix/vm-tests/k8s-services.nix b/nix/vm-tests/k8s-services.nix index fb6d7ff5d..04773ddc4 100644 --- a/nix/vm-tests/k8s-services.nix +++ b/nix/vm-tests/k8s-services.nix @@ -1948,6 +1948,10 @@ pkgs.testers.runNixOSTest { for other in ("victoriametrics", "victorialogs"): assert stored != as_root(f"bao kv get -mount=secret -field=value swarm/services/{other}/store-auth").strip() assert machine.succeed(f"cat {GRAFANA_PASSWORD}").strip() == stored + # The gateway's user reads the include file and not the password, as for the stores'. + assert machine.succeed(f"stat -c '%a %U %G' {GRAFANA_PASSWORD} {GRAFANA_CONF}").split("\n")[:2] == ["600 root root", "640 root nginx"] + machine.succeed(f"runuser -u nginx -- cat {GRAFANA_CONF}") + machine.fail(f"runuser -u nginx -- cat {GRAFANA_PASSWORD}") secret = machine.succeed(f"kubectl -n {NS} get secret swarm-grafana-credentials -o jsonpath='{{.data.store-auth}}' | base64 -d").strip() assert secret == stored assert stored not in machine.succeed(f"cat {MANIFESTS}/{GRAFANA}.yaml"), "the manifest holds no credential"