Repository navigation
docs(adr): draft ADR-0016 -- Phase 1 service-account UID model - #27
Merged
Merged
Conversation
Records the operational counterpart to RFC-0002. The RFC documents the threat-model side (§2.5 Phase-bounded reality + §8.12 non-goal); this ADR documents the operational decision RFC-0002 §"Why not bundle this with a 'single-command execution' ADR" explicitly defers to a separate artefact: which OS identity executes the SSH-supplied command in Phase 1. The decision is to run quantumsshd as a dedicated non-root service account from PID 1 — no privileged window, no setuid machinery, no PAM, no passwd resolution. Three other options were on the table (root forever, root + post-spawn drop, CAP_SETUID); each is recorded in Alternatives considered with why it was rejected. Status: Proposed. Advances to Accepted when Phase 1 implementation begins. Depends on the merge of PR #24 (RFC-0002).
Contributor
There was a problem hiding this comment.
Pull request overview
Adds ADR-0016 documenting the Phase 1 operational UID model for command execution (run quantumsshd as a dedicated non-root service account) and records the new ADR in the changelog to keep the documentation set auditable and consistent with the Phase 1 threat-model posture described in RFC-0002.
Changes:
- Add draft ADR-0016 describing the Phase 1 “run as service account” execution posture and its consequences/alternatives.
- Update
CHANGELOG.mdwith a new “Added” bullet for ADR-0016.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/adr/0016-phase-1-service-account-uid-model.md | New ADR documenting the Phase 1 service-account UID execution model and related operational constraints. |
| CHANGELOG.md | Adds an “Unreleased / Added” entry referencing the new ADR and summarizing the decision. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+6
| - **Status:** Proposed | ||
| - **Date:** TBD (advances to Accepted when Phase 1 implementation begins) | ||
| - **Deciders:** Project lead | ||
| - **Related:** Operational counterpart to [RFC-0002](../rfcs/0002-threat-model-phase1-uid-model-and-non-goal.md); this ADR depends on the merge of [PR #24](https://github.com/gonzafg2/quantumssh/pull/24) and should land after it. |
Comment on lines
+17
to
+18
| 2. Run `quantumsshd` as `root` and drop to a service account after PID-1 initialisation. | ||
| 3. Run `quantumsshd` as a dedicated non-root service account from PID 1. |
Comment on lines
+64
to
+66
| ### Alternative 3: Run `quantumsshd` as a non-root service account from PID 1 | ||
|
|
||
| **Chosen.** No privileged window, no `setuid` machinery, no PAM, no `passwd` resolution. The implementation surface is the smallest of the three options. The cost — Phase 1 cannot enforce per-user UID isolation — is exactly the non-goal that RFC-0002 §8.12 documents and accepts. |
Comment on lines
+12
to
+23
| - `docs/adr/0016-phase-1-service-account-uid-model.md` (Proposed) | ||
| records the operational counterpart to RFC-0002: `quantumsshd` will | ||
| run in Phase 1 as a dedicated non-root service account | ||
| (`quantumssh:quantumssh`), never holding `root`, never calling | ||
| `setuid`/`setgid`/`initgroups`/`chroot`, and never integrating with | ||
| PAM. Commands inherit the service account's UID/GID and a sanitised | ||
| environment. The `executing_uid` audit field (RFC-0002 §2.7) is | ||
| populated by `nix::unistd::Uid::current()`; in Phase 1 the value is | ||
| a per-process constant, and the schema is forward-compatible with | ||
| the Phase 3 per-user value. The ADR depends on the merge of | ||
| RFC-0002 and advances from Proposed to Accepted when Phase 1 | ||
| implementation begins. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Operational counterpart to RFC-0002. The RFC documents the threat-model side: §2.5 "Phase-bounded reality" + §8.12 "Per-user UID isolation until Phase 3". This ADR documents the operational side: which OS identity actually executes the SSH-supplied command on a Phase 1 host.
The decision: run
quantumsshdas a dedicated non-root service account (quantumssh:quantumssh) from PID 1. No privileged window, nosetuid/setgid/initgroups/chrootmachinery, no PAM, nopasswdresolution. The audit fieldexecuting_uid(added by RFC-0002 §2.7) is populated bynix::unistd::Uid::current(); in Phase 1 the value is a per-process constant and the schema is forward-compatible with Phase 3's per-user value.Why a separate artefact
RFC-0002 §"Why not bundle this with a 'single-command execution' ADR" explicitly defers the operational decision to a separate ADR. The RFC's job is the threat-model consequences (what the model promises, what it does not); the ADR's job is the concrete OS-level posture that makes those consequences honest. One-decision-per-file per the convention codified in PR #25.
Why Draft
This PR is opened as a Draft because it depends on the merge of PR #24 (RFC-0002). Mark it ready-for-review once PR #24 lands and the citations in this ADR resolve.
Status path
Alternatives considered
Five options are recorded in Alternatives considered:
CAP_SETUID+CAP_SETGIDon Linux — same Phase 1 reasoning as (4); may resurface inside the Phase 3 RFC.Test plan
docs/adr/0016-phase-1-service-account-uid-model.md(new, 96 lines) andCHANGELOG.md(one new bullet under Added).docs/adr/0000-template.md.