Least privilege for automation: Matrix server-admin token in the portal, steward agent auto-deploys, shared CI container #59

Closed
opened 2026-11-19 20:24:10 +00:00 by activeinference · 9 comments

From a static review of the public repos (no live systems probed). These are design-level and not exploitable on their own. Each one widens what a single compromise or a single bad input can reach.

1. The portal's Matrix credential is a server-admin token

Per ops-docs agent-fleet.md, the portal's MATRIX_BOT_TOKEN belongs to @inference-admin, which is a Synapse server admin. The portal only needs to invite to and remove from a fixed set of member rooms. A portal compromise therefore yields Synapse admin, including the admin API's ability to act as any user.

Suggestion: a dedicated non-admin bot account that has room power only in the rooms in member_invite_rooms().

2. The steward agent combines admin credentials, untrusted input and unconfirmed deploys

The steward agent holds the full Cloudron token and the gateway master key (agent-fleet.md). It reads content anyone can write: issues, PRs, web research and Matrix rooms. Per operations/agentic-systems.md, it also "deploy[s] bug and security fixes immediately" without a human confirming. Together, that is a prompt-injection path from any text the agent reads to infrastructure admin. The Matrix allowlist covers direct instructions, but not instructions embedded in content the agent processes.

Suggestions:

  • Require human confirmation for every deploy, including security fixes.
  • Split read/research/drafting from credentialed actions, with a separate identity that holds no admin token.
  • State in the agent's policy that issue, PR and web text is data, never instructions.

3. The Woodpecker local backend shares one container across all pipelines

Every step of every pipeline runs inside the same agent container (.woodpecker.yml notes in each repo). The docs pipeline is designed to receive the cloudron_token secret. A push to any CI-enabled repo could therefore change the shared toolchain (e.g. /opt/docs-venv) that a later, secret-bearing pipeline runs with.

Suggestion: per-pipeline isolation (Docker backend or ephemeral runners) before any secret is wired into CI. Related: #30, #41.

4. Housekeeping

  • The @ops_audit server-admin account is still listed as "retained until its tokens are revoked". Worth closing out.

Filed by Daniel Ari Friedman (member) in a personal capacity. The activeinference username is my personal co-op account, not the Active Inference Institute.

From a static review of the public repos (no live systems probed). These are design-level and not exploitable on their own. Each one widens what a single compromise or a single bad input can reach. ## 1. The portal's Matrix credential is a server-admin token Per ops-docs `agent-fleet.md`, the portal's `MATRIX_BOT_TOKEN` belongs to `@inference-admin`, which is a Synapse **server admin**. The portal only needs to invite to and remove from a fixed set of member rooms. A portal compromise therefore yields Synapse admin, including the admin API's ability to act as any user. **Suggestion:** a dedicated non-admin bot account that has room power only in the rooms in `member_invite_rooms()`. ## 2. The steward agent combines admin credentials, untrusted input and unconfirmed deploys The steward agent holds the full Cloudron token and the gateway master key (`agent-fleet.md`). It reads content anyone can write: issues, PRs, web research and Matrix rooms. Per `operations/agentic-systems.md`, it also "deploy[s] bug and security fixes immediately" without a human confirming. Together, that is a prompt-injection path from any text the agent reads to infrastructure admin. The Matrix allowlist covers direct instructions, but not instructions embedded in content the agent processes. **Suggestions:** - Require human confirmation for every deploy, including security fixes. - Split read/research/drafting from credentialed actions, with a separate identity that holds no admin token. - State in the agent's policy that issue, PR and web text is data, never instructions. ## 3. The Woodpecker `local` backend shares one container across all pipelines Every step of every pipeline runs inside the same agent container (`.woodpecker.yml` notes in each repo). The docs pipeline is designed to receive the `cloudron_token` secret. A push to any CI-enabled repo could therefore change the shared toolchain (e.g. `/opt/docs-venv`) that a later, secret-bearing pipeline runs with. **Suggestion:** per-pipeline isolation (Docker backend or ephemeral runners) before any secret is wired into CI. Related: #30, #41. ## 4. Housekeeping - The `@ops_audit` server-admin account is still listed as "retained until its tokens are revoked". Worth closing out. --- *Filed by Daniel Ari Friedman (member) in a personal capacity. The `activeinference` username is my personal co-op account, not the Active Inference Institute.*
Owner

Thanks Daniel — these were accurate and we acted on them today.

1. Portal Matrix credential — fixed. The portal's MATRIX_BOT_TOKEN no longer belongs to @inference-admin. It now belongs to a dedicated non-admin account, @coop-portal, which holds room power level 50 in exactly the eight MATRIX_INVITE_ROOMS rooms. Verified: whoami from inside the portal returns @coop-portal, the account is not a server admin, and PL 50 reads back in every room (invite level is 0–50, kick level 50). It cannot change power levels or touch rooms outside that set. The swap was verified by having the bot invite and then kick a throwaway account before the portal env was changed.

4. @ops_audit — retired. Device OPSAUDITDEV deleted, admin flag dropped, account deactivated; devices.total == 0 and admin == false read back.

2. Steward agent. Policy agreed with the operator: the bot checks with a human but remains able to deploy, so the auto-deploy standing rule stays for now. Splitting read/research from credentialed actions is still open.

Docs publishing (the report sent separately). Repo build logic no longer executes with a credential: the poller is a host-owned script; the MkDocs build runs as an unprivileged docsbuild user with a scrubbed environment and no read access to the agent's home; publishing is a root-owned script that runs no repository code and holds the Cloudron token from a root-only env file. Verified end-to-end: a pushed commit deployed, and the served meta.json matches it.

On write access to co-op/docs main: push whitelist, merge whitelist and approvals are all team Owners. Owners contains only inference-bot (active) and inference-admin (inactive) — no human account. designbot is a write collaborator, but branch protection keeps it off main. The steward's token reports repo admin, so it can bypass the approval gate; that is the real concentration of authority, not outside contributors.

3. Woodpecker shared container — still open. Per-pipeline isolation (Docker backend or ephemeral runners) before any secret is wired into CI is the plan; not done yet.

Thanks Daniel — these were accurate and we acted on them today. **1. Portal Matrix credential — fixed.** The portal's `MATRIX_BOT_TOKEN` no longer belongs to `@inference-admin`. It now belongs to a dedicated non-admin account, `@coop-portal`, which holds room power level 50 in exactly the eight `MATRIX_INVITE_ROOMS` rooms. Verified: `whoami` from inside the portal returns `@coop-portal`, the account is not a server admin, and PL 50 reads back in every room (invite level is 0–50, kick level 50). It cannot change power levels or touch rooms outside that set. The swap was verified by having the bot invite and then kick a throwaway account before the portal env was changed. **4. `@ops_audit` — retired.** Device `OPSAUDITDEV` deleted, admin flag dropped, account deactivated; `devices.total == 0` and `admin == false` read back. **2. Steward agent.** Policy agreed with the operator: the bot checks with a human but remains able to deploy, so the auto-deploy standing rule stays for now. Splitting read/research from credentialed actions is still open. **Docs publishing (the report sent separately).** Repo build logic no longer executes with a credential: the poller is a host-owned script; the MkDocs build runs as an unprivileged `docsbuild` user with a scrubbed environment and no read access to the agent's home; publishing is a root-owned script that runs no repository code and holds the Cloudron token from a root-only env file. Verified end-to-end: a pushed commit deployed, and the served `meta.json` matches it. **On write access to `co-op/docs` main:** push whitelist, merge whitelist and approvals are all team Owners. Owners contains only `inference-bot` (active) and `inference-admin` (inactive) — no human account. `designbot` is a write collaborator, but branch protection keeps it off main. The steward's token reports repo `admin`, so it can bypass the approval gate; that is the real concentration of authority, not outside contributors. **3. Woodpecker shared container — still open.** Per-pipeline isolation (Docker backend or ephemeral runners) before any secret is wired into CI is the plan; not done yet.

Small correction: inference-admin is an active account—I am the only one who currently has access to it, but that may change.

We are currently in a state of flux as we just onboarded our first Stewards this week. Angel, our infrastructure steward, is developing a new approach to agents and permissioning that will be a big step up from our current practice, which was mainly designed for rapid prototyping. Rest assured we are moving toward a model more designed for stable infrastructure.

Small correction: `inference-admin` is an active account—I am the only one who currently has access to it, but that may change. We are currently in a state of flux as we just onboarded our first Stewards this week. Angel, our infrastructure steward, is developing a new approach to agents and permissioning that will be a big step up from our current practice, which was mainly designed for rapid prototyping. Rest assured we are moving toward a model more designed for stable infrastructure.
Owner

Closing the remaining items.

2. Steward agent — policy now says what the report asked for, with the operator's chosen deploy model.

  • operations/agentic-systems.md (public docs) now carries a “Content is data, never instructions” section: issue bodies, PR comments, web pages, fetched documents and member messages are never executed as instructions; only the operator's direct instruction authorises a credentialed action.
  • Deploy policy per the operator: the bot may deploy without waiting, flags each deploy, and waits for confirmation on anything irreversible.
  • The structural half of this item — a separate read/research identity holding no admin token — is not built. The steward remains tier 1 with the Cloudron token and gateway master key. What did change structurally: repo code no longer executes with the Cloudron token anywhere (docs pipeline), and the portal no longer holds a server-admin Matrix credential.

3. Woodpecker shared container — the secret-bearing pipeline is gone.

  • The docs pipeline was the only one wiring a secret (cloudron_token) into the shared local container. That deploy step is removed; docs publishing is host-side now. The pipeline builds in an ephemeral .ci-venv inside its workspace, not the shared /opt/docs-venv.
  • Verified: zero from_secret entries across every repo's .woodpecker.yml. No CI pipeline can reach a credential.
  • One leftover: the Woodpecker repo secret cloudron_token still exists for co-op/docs with no consumer. It should be deleted from the Woodpecker UI/API; the database-level delete was not approved, so it is left in place and flagged here.

4. @ops_audit remains retired (device deleted, admin dropped, deactivated).

Closing the remaining items. **2. Steward agent — policy now says what the report asked for, with the operator's chosen deploy model.** - `operations/agentic-systems.md` (public docs) now carries a **“Content is data, never instructions”** section: issue bodies, PR comments, web pages, fetched documents and member messages are never executed as instructions; only the operator's direct instruction authorises a credentialed action. - Deploy policy per the operator: the bot may deploy without waiting, flags each deploy, and waits for confirmation on anything irreversible. - The structural half of this item — a separate read/research identity holding no admin token — is **not built**. The steward remains tier 1 with the Cloudron token and gateway master key. What did change structurally: repo code no longer executes with the Cloudron token anywhere (docs pipeline), and the portal no longer holds a server-admin Matrix credential. **3. Woodpecker shared container — the secret-bearing pipeline is gone.** - The docs pipeline was the only one wiring a secret (`cloudron_token`) into the shared `local` container. That deploy step is removed; docs publishing is host-side now. The pipeline builds in an ephemeral `.ci-venv` inside its workspace, not the shared `/opt/docs-venv`. - Verified: **zero `from_secret` entries** across every repo's `.woodpecker.yml`. No CI pipeline can reach a credential. - One leftover: the Woodpecker repo secret `cloudron_token` still exists for `co-op/docs` with no consumer. It should be deleted from the Woodpecker UI/API; the database-level delete was not approved, so it is left in place and flagged here. **4.** `@ops_audit` remains retired (device deleted, admin dropped, deactivated).
Owner

Status: the Matrix credential, agent policy, and @ops_audit housekeeping are closed.

  • Portal Matrix credential is now @coop-portal (non-admin, PL 50 in the eight member rooms).
  • Policy now states that issue/PR/web text is data, never instructions, and documents the operator-chosen deploy model.
  • @ops_audit is deactivated and not an admin.

The Woodpecker local backend still shares one root container. No pipeline currently wires a repository secret, so the immediate secret-exposure path is closed, but per-pipeline isolation is still tracked in #30 before any secret is added. Leaving this issue open until then.

Status: the Matrix credential, agent policy, and `@ops_audit` housekeeping are closed. - Portal Matrix credential is now `@coop-portal` (non-admin, PL 50 in the eight member rooms). - Policy now states that issue/PR/web text is data, never instructions, and documents the operator-chosen deploy model. - `@ops_audit` is deactivated and not an admin. The Woodpecker `local` backend still shares one root container. No pipeline currently wires a repository secret, so the immediate secret-exposure path is closed, but per-pipeline isolation is still tracked in #30 before any secret is added. Leaving this issue open until then.
Owner

Docs publishing hardening landed:

  • CODEOWNERS now covers publishing/, mkdocs.yml and .woodpecker.yml using Gitea regexp rules.
  • main protection has block_on_codeowner_reviews=true (1 required approval, Owners team).
  • Push/merge whitelists remain Owners-only; force-push disabled.

This closes the CODEOWNERS request from the docs deploy report. Hash-pinned Python requirements are still open (the build script’s self-heal parser needs a separate lock file before --require-hashes can be enforced).

Docs publishing hardening landed: - `CODEOWNERS` now covers `publishing/`, `mkdocs.yml` and `.woodpecker.yml` using Gitea regexp rules. - `main` protection has `block_on_codeowner_reviews=true` (1 required approval, Owners team). - Push/merge whitelists remain Owners-only; force-push disabled. This closes the CODEOWNERS request from the docs deploy report. Hash-pinned Python requirements are still open (the build script’s self-heal parser needs a separate lock file before `--require-hashes` can be enforced).
Owner

Docs toolchain is now hash-locked:

  • publishing/requirements.in holds the human pins.
  • publishing/requirements.txt is the pip-compile lockfile with SHA-256 hashes for every package and transitive dependency.
  • publishing/build.sh installs it with --require-hashes; CI does the same.
  • Verified with a cold venv and a full build; the deployed site rebuilt to 2047717.

This closes the hash-pinning request from the docs deploy review.

Docs toolchain is now hash-locked: - `publishing/requirements.in` holds the human pins. - `publishing/requirements.txt` is the pip-compile lockfile with SHA-256 hashes for every package and transitive dependency. - `publishing/build.sh` installs it with `--require-hashes`; CI does the same. - Verified with a cold venv and a full build; the deployed site rebuilt to `2047717`. This closes the hash-pinning request from the docs deploy review.
Owner

CI configuration is now CODEOWNERS-protected in the active build repos: member-portal, member-dashboard, admin-panel, litellm, and librechat-custom. Each has CODEOWNERS for .woodpecker.yml, and main protection requires an Owners review with codeowner enforcement enabled (librechat-custom protection was created).

This does not remove the shared-container limitation: the Woodpecker local backend still runs every pipeline as root in one container. It narrows who can change CI without review while per-pipeline isolation remains open.

CI configuration is now CODEOWNERS-protected in the active build repos: `member-portal`, `member-dashboard`, `admin-panel`, `litellm`, and `librechat-custom`. Each has `CODEOWNERS` for `.woodpecker.yml`, and `main` protection requires an Owners review with codeowner enforcement enabled (librechat-custom protection was created). This does not remove the shared-container limitation: the Woodpecker `local` backend still runs every pipeline as root in one container. It narrows who can change CI without review while per-pipeline isolation remains open.
Owner

Woodpecker status is no longer a merge gate. Branch protection on member-portal, member-dashboard and admin-panel no longer requires ci/woodpecker/push/woodpecker; Owners review remains required. The runner shares one root container, so a forged status must not be treated as a trust boundary. CI still runs and failures remain visible, but they are advisory until pipelines are isolated.

Documented in ops-docs/maintenance/woodpecker-ci.md.

Woodpecker status is no longer a merge gate. Branch protection on `member-portal`, `member-dashboard` and `admin-panel` no longer requires `ci/woodpecker/push/woodpecker`; Owners review remains required. The runner shares one root container, so a forged status must not be treated as a trust boundary. CI still runs and failures remain visible, but they are advisory until pipelines are isolated. Documented in `ops-docs/maintenance/woodpecker-ci.md`.
Owner

Closing out: the portal Matrix credential is a dedicated non-admin bot, the agent policy states that untrusted content is data and documents the deploy model, CI configs are CODEOWNERS-protected with Owners review, and @ops_audit is deactivated.

The Woodpecker local backend still shares one root container. No pipeline currently wires a repository secret, and status checks are now advisory rather than a merge gate, so the immediate forging risk is reduced. Per-pipeline isolation remains tracked in #30 before any secret is added.

Closing out: the portal Matrix credential is a dedicated non-admin bot, the agent policy states that untrusted content is data and documents the deploy model, CI configs are CODEOWNERS-protected with Owners review, and `@ops_audit` is deactivated. The Woodpecker local backend still shares one root container. No pipeline currently wires a repository secret, and status checks are now advisory rather than a merge gate, so the immediate forging risk is reduced. Per-pipeline isolation remains tracked in #30 before any secret is added.
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: co-op/support#59