Isolate the worker credential in state.json from task code
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with client/src/orcaster_worker/runner.py, the worker image and container flags in client/Dockerfile and Makefile, then review the enrollment probe at setup-scripts/debian13-worker/run-fleet.sh. Compare the separate UID and per-task sandbox options, including volume ownership, capabilities, rootless Podman requirements, and compatibility tests. Done means the chosen opt-in isolation blocks task reads of state.json, preserves task writes and existing enrollment, and updates the tests, documentation, and Unreleased changelog.
Written by the indexing model from the issue text.
Description
Problem
A task process runs with the same uid as the worker inside the worker container. Task code can read whatever that uid can read, including the worker credential file state.json (worker id and API key), and use it against the server. SECURITY.md:63, SECURITY.md:65 and README.md:463-464 document this as a known limitation.
The worker image runs as one user, uid 1000 (client/Dockerfile:78-79, client/Dockerfile:95). The state dir is owned by that user (client/Dockerfile:92-93) and mounted from the worker data volume (Makefile:993). Task processes are started with asyncio.create_subprocess_exec and only a new session (client/src/orcaster_worker/runner.py:42-51). Nothing changes the uid.
Proposed change
Run task code so that it cannot read state.json. Two options; the choice is part of this issue (see Open questions):
- A. Separate task uid. Add a second user to the image for task processes. The worker keeps
state.jsonand other private files at mode0600under its own uid, and starts each task under the task uid. Shared dirs that tasks must write (cache, task workdir, artifacts) get permissions for the task uid. - B. Per-task sandbox. Start each task in a sandbox (for example a user namespace or a nested container) that does not mount the state dir.
In both options, the change starts behind an opt-in worker setting (for example ORCH_TASK_ISOLATION=uid), off by default.
Compatibility
- With the setting off (the default), workers behave as today. Existing deployments need no change.
- Option A changes ownership inside the worker data volume. Turning it on requires a re-own step for the existing volume, which the worker or
make up clientmust do on first start. The host-side enrollment probe that readsstate.jsonthroughpodman unshare(setup-scripts/debian13-worker/run-fleet.sh:56-63) must keep working. On a rootless host,state.jsonis0600and owned by the host subuid that maps to the container uid 1000. A re-own to another uid must stay readable for that probe. - Option A needs more than a re-own. The worker runs with
--cap-drop=ALLand--security-opt=no-new-privileges(Makefile:981-982), so it cannot start a process under another uid. Option A needsCAP_SETUIDandCAP_SETGIDadded bymake up clientonly when the opt-in is on, or a separate privileged launcher. With the setting off, the container flags stay as today. - Option A may need a wider subordinate uid range on rootless Podman hosts. Option B changes the runtime requirements of every worker host. Either must be documented before the default changes.
- The default flips only in a later release, announced in the CHANGELOG with the upgrade steps.
Acceptance criteria
- With the setting on, a task that tries to read
state.jsongets a permission error (test that measures it). - With the setting on, tasks can still write their cache, workdir and artifacts (tests).
- With the setting off, behavior and file ownership are unchanged (test).
- With the setting off, the
podman runflags of the worker container are unchanged, including--cap-drop=ALLand--security-opt=no-new-privileges(test). - Existing deployments keep working without config changes. The setting is off by default.
- Enabling the setting on an existing worker keeps its identity:
state.jsonis re-owned, not recreated, and the worker does not need a new enrollment. -
run-fleet.shstill detects an enrolled worker after the setting is turned on (bats test). - With the setting on,
SECURITY.mdandREADME.mddescribe the new boundary. The limitation stays listed for workers that keep it off. - CHANGELOG entry under Unreleased with the opt-in and the upgrade step.
Open questions
- Option A (separate uid) or option B (per-task sandbox)? Option A needs a volume re-own and, when the opt-in is on, extra capabilities for the worker container (
CAP_SETUID,CAP_SETGID) or a separate privileged launcher. Which one is acceptable? Option B changes the host requirements of every worker. Both stay behind the opt-in, so existing deployments do not change. - When should the default flip from off to on?
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AInvirion/orcaster
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement good first issue P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug P2 server
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
All issues in AInvirion/orcaster
Similar issues
-
[Resource]: SpaicelyOpenresource-submission validation-passed
Difficulty 1/5 Under an hour Newbie friendliness 68/100
hesreallyhim/awesome-claude-code#3875 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
bvis/aegis-hass#725 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xPossibly taken @NimaVaziri claimed this today. OpenPytorch
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainers usually reply within 1 day