Skip to content

docs(rfc): draft RFC 0002 -- Phase-1 UID model and non-goal §8.12 - #24

Merged
gonzafg2 merged 13 commits into
mainfrom
rfc/0002-threat-model-phase1-uid-model
Jun 10, 2026
Merged

gonzafg2 merged 13 commits into
mainfrom
rfc/0002-threat-model-phase1-uid-model

Conversation

@gonzafg2

Copy link
Copy Markdown
Owner

Summary

Draft RFC proposing two coupled refinements to docs/threat-model.md so the document describes what QuantumSSH actually enforces during Phase 1 rather than what it intends to enforce once privilege separation lands in Phase 3.

  • §2.5 (Command execution authority) gains a Phase-bounded reality paragraph clarifying that the strong form of the goal — "authority on the host as the authenticated user" — is the Phase 3 target, and pointing the reader at §8.12 for the Phase 1 reality. The asset definition itself is unchanged.
  • §8 (Out of scope) gains a new §8.12 "Per-user UID isolation until Phase 3", modelled on §5.5.4's disposition pattern. The non-goal has a named closure condition (a follow-up RFC that supersedes §8.12 when the Phase 3 privsep work lands), so the entry is auditable as temporary rather than as a permanent exemption.
  • §2.7 (Audit record) gets a small reference-level addition: each command-execution boundary logs executing_uid distinct from authenticated_identity, so the gap §8.12 names is visible to anyone who greps server logs.

Why an RFC (not a documentation PR)

docs/threat-model.md's maintenance clause requires the RFC process for "additions to or removals from the asset list, threat-actor tiers, trust boundaries, in-scope attack vectors, or non-goals". Adding §8.12 is a non-goal addition; this PR opens the formal review path.

The companion documentation-PR cleanup of two factual errata in the threat model and in README.md / MANIFIESTO.es.md (the GitHub PQ algorithm naming and the §5.2.4 test-vector source) lands separately as #23. Those changes did not require an RFC; this one does.

Motivation, in one paragraph

Implementing real per-user UID isolation in Phase 1 requires running quantumsshd as root (or with CAP_SETUID + CAP_SETGID on Linux), a privilege-separation monitor, passwd/nsswitch/getpwnam resolution, the correct setgid / initgroups / setuid sequence, and a PAM integration boundary — each of which is its own attack surface, and OpenSSH's sshd-session.c is roughly 4 000 lines of careful C precisely because this is hard. Phase 1's MANIFIESTO commitment to "superficie pequeña, bordes afilados" is incompatible with that expansion. The pragmatic path is to (a) run quantumsshd as a dedicated non-root service account, (b) execute the command as that service account's UID, and (c) say so honestly in the threat model so operators are not misled by a sentence the implementation cannot back. RFC 0002 is the documentation half of that pragmatic path; the corresponding code-side ADR will document the run-as-service-account choice separately when Phase 1 implementation begins.

Test plan

  • At least 14 days of public comment period per docs/rfcs/README.md.
  • Inline review of the proposed §2.5 paragraph, §8.12 entry, and §2.7 addition — the Guide-level explanation section is structured to be paste-ready into docs/threat-model.md.
  • Verify the closure-condition wording in §8.12 holds the temporary character of the non-goal (it names a follow-up Phase 3 RFC by reference).
  • Check the boundary statement against §5.5.4 (Operator-account compromise, out of scope) — the two follow a parallel logic with different conclusions, and the RFC documents the boundary explicitly.
  • Confirm no code change is implied by this RFC: this is documentation only, the operational consequences are captured in a separate forthcoming ADR.

Proposes two coupled refinements to docs/threat-model.md so the
document describes what QuantumSSH actually enforces during Phase 1
rather than what it intends to enforce once privilege separation
lands in Phase 3.

1. §2.5 (Command execution authority) gains a Phase-bounded paragraph
   noting that the strong form of the goal -- "authority on the host
   as the authenticated user" -- is the Phase 3 target, and pointing
   the reader at §8.12 for the Phase 1 reality. The asset definition
   itself is unchanged.

2. §8 (Out of scope) gains a new §8.12 "Per-user UID isolation until
   Phase 3", modelled on §5.5.4's disposition pattern. The non-goal
   has a named closure condition (a follow-up RFC that supersedes
   §8.12 when the Phase 3 privsep work lands), so the entry is
   auditable as temporary rather than as a permanent exemption.

The RFC also proposes a small addition to §2.7 (Audit record): the
log emitted on each command-execution boundary records executing_uid
distinct from authenticated_identity, so the gap §8.12 names is
visible to anyone who greps server logs.

Motivation: implementing real per-user UID isolation in Phase 1
requires running quantumsshd as root (or with CAP_SETUID + CAP_SETGID
on Linux), a privsep monitor, passwd/nsswitch/getpwnam resolution,
the correct setgid/initgroups/setuid sequence, and a PAM integration
boundary. Each of those is its own attack surface; OpenSSH's
sshd-session.c is roughly 4000 lines of careful C precisely because
this is hard. Phase 1's MANIFIESTO commitment to a "small attack
surface, sharp edges" is incompatible with that expansion. The
pragmatic path is to (a) run quantumsshd as a dedicated non-root
service account, (b) execute the command as that service account's
UID, and (c) document this honestly in the threat model so operators
and auditors are not misled by a §2.5 sentence the implementation
cannot back. RFC 0002 is the documentation half of that pragmatic
path.

Process: substantive change (non-goal addition) so it goes through
the RFC process per docs/threat-model.md's maintenance clause, and
will be open for >=14 days for comments per docs/rfcs/README.md.
Copilot AI review requested due to automatic review settings May 13, 2026 19:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Drafts RFC 0002 to align docs/threat-model.md with the Phase 1 reality: commands execute under the QuantumSSH service account UID rather than the authenticated user's UID, with per-user UID isolation deferred to Phase 3. Adds a proposed Phase-bounded paragraph to §2.5, a new §8.12 non-goal with a named closure condition, and an executing_uid audit field in §2.7.

Changes:

  • New draft RFC document docs/rfcs/0002-threat-model-phase1-uid-model-and-non-goal.md.
  • CHANGELOG entry under ### Added describing the new draft RFC.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/rfcs/0002-threat-model-phase1-uid-model-and-non-goal.md New draft RFC proposing §2.5 phase-bounded note, new §8.12 non-goal, and §2.7 executing_uid audit field.
CHANGELOG.md Adds an ### Added entry describing the new draft RFC.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Renames the Tracking issue: field to Roadmap issue: and points at the
Phase 1 tracking issue (#9), matching the convention codified in the
companion PR (#25). No content change to the RFC body itself.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

gonzafg2 and others added 2 commits May 24, 2026 20:27
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread CHANGELOG.md Resolved
Co-authored-by: Copilot Autofix powered by AI <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
gonzafg2 added a commit that referenced this pull request May 27, 2026
#25)

* docs: drop roadmap estimates; codify one-decision-per-file conventions

Two coupled process changes that fell out of the Phase-0/Phase-1
boundary review.

1. README.md §"Roadmap" no longer commits to per-Phase calendar
estimates. The previous wording ("Phase 1 takes weeks. Phase 2,
months. Phase 3, a year or more.") was an implicit schedule promise
that invited scope/quality compromises whenever a phase's real work
outgrew the estimate. Phase 1's greenfield-vs-russh tension is the
concrete example that surfaced this: the honest engineering answer
(greenfield, several months) collided with the "weeks" promise, and
the document was being asked to do two incompatible things at once.
The replacement makes the project's actual posture explicit: phases
ship when they are ready, the schedule is a function of correctness
and scrutiny, not the reverse. The high-level ambitions in
MANIFIESTO.es.md §"Cómo medimos el éxito" (year one / year two /
year five outcomes) are deliberately kept; they are ambitions, not
scope estimates.

2. docs/rfcs/README.md and docs/adr/README.md codify two conventions
that were tacit until now:

   a. One decision per file. Each RFC addresses one shape-determining
      decision; subsidiary decisions split into separate ADRs that
      cite the RFC, never packaged inside it. Each ADR records one
      decision. The reason is reviewability: an RFC reader must be
      able to state the decision in one sentence and the alternatives
      as a list, and a substantive objection to one half of a packaged
      RFC should not block the other half.

   b. Tracking via Phase-level issues, not per-RFC issues. The
      project's roadmap plus the Phase-level GitHub issues (e.g.
      #9 for Phase 1) are the tracking surface. RFCs cite the Phase
      issue in their Roadmap issue field; discussion of a specific
      RFC happens on its PR. Creating a separate issue per RFC would
      duplicate the roadmap and fragment the discussion across two
      surfaces.

   The template (docs/rfcs/0000-template.md) is updated to rename the
   Tracking issue: field to Roadmap issue: accordingly. RFC-0001
   predates this convention; its existing tracking-issue field is
   left as historical record rather than retroactively rewritten.
   RFC-0002 (PR #24) applies the new field name in the same PR.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot Autofix reverted the field name from `Roadmap issue:` back to
`Tracking issue:` in commit 342c67f. Restore the field name so RFC-0002
is consistent with the convention codified in PR #25 (now merged at
f9bb0cc), which renames `Tracking issue:` to `Roadmap issue:` in the
RFC template and documents the rule in docs/rfcs/README.md.

Only this field-name regression is restored; the other Autofix-era
edits (closure-condition rewording, Summary restructure) are kept.
gonzafg2 added 2 commits May 27, 2026 11:04
- Motivation: README §"Phase 1" lists six deliverables, not five;
  add the omitted "structured logging via tracing" entry.
- Unresolved Q1: drop the fabricated "Phase 3 will take a year or
  more" roadmap quote (the README carries no per-phase estimates);
  cite the README's actual estimate-free stance instead.
- §8.12: note the numbering deconflicts with RFC 0001's reserved
  §8.11, with renumber guidance if RFC 0001 does not land first.
- §2.7: make the audit-record amendment paste-ready, matching the
  §2.5 and §8.12 blockquote style.
@gonzafg2
gonzafg2 merged commit b70bc9f into main Jun 10, 2026
6 checks passed
@gonzafg2
gonzafg2 deleted the rfc/0002-threat-model-phase1-uid-model branch June 10, 2026 06:20
gonzafg2 added a commit that referenced this pull request Jun 10, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants