Skip to content

docs: add security policy with hardening principles - #186

Merged
openoms merged 5 commits into
openoms:masterfrom
autoblitzbot:docs/security-hardening-plan
Aug 16, 2026
Merged

openoms merged 5 commits into
openoms:masterfrom
autoblitzbot:docs/security-hardening-plan

Conversation

@autoblitzbot

@autoblitzbot autoblitzbot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a SECURITY.md security policy for JoininBox: private vulnerability reporting, scope, supported versions, threat model, coordinated disclosure — plus the durable output of the 2026-08 source review, structured as:

  • Implemented controls — hardening verified on the default branch (config parsed as data via sourceConf(), updates verified before install, no passwords via argv, no eval-based argument parsing, mktemp credential files with no root wildcard deletion, allowlisted generated services, tor --verify-config + atomic install, ShellCheck + Bats CI)
  • Target design principles — the normative direction for future work (scoped sudo helpers, temp-keyring verification, LoadCredential= / private runtime dirs, torrc.d, unique first-boot credentials, defense in depth, safe failure)
  • Known limitations — unrestricted NOPASSWD sudo, shared default password until security: replace shared default password with unique first-boot credentials #193 lands, moving-branch bootstrap in README/FAQ, default-GnuPG-home key imports, partial sandboxing and missing provenance/scanning
  • Review methods — the 2026-08 review, current CI, and planned additions

The staged hardening plan document (SECURITY-HARDENING.md) was removed; its findings were addressed through the implementation PRs below, and the open items are preserved as known limitations.

Implementation PRs (hardening series)

PR Scope Status
#187 Harden wallet credential temp files merged
#188 Validate and atomically install Tor hidden-service configuration merged
#189 Constrain generated wallet service inputs merged
#190 Verify JoininBox updates against pinned signing keys before install merged
#191 Remove root wildcard deletion in /dev/shm merged
#192 Stop accepting passwords via command-line arguments merged
#193 Unique per-install first-boot credentials open — tracked as known limitation
#194 Replace eval-based argument parsing in the installer merged
#195 Parse joinin.conf as data instead of sourcing it as code merged

Finding #1 (unrestricted passwordless sudo) and the moving-branch bootstrap remain open and are documented as known limitations.

@RonDeBanc RonDeBanc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: APPROVE

A thorough, well-structured plan. I spot-checked the findings against the current default branch and they hold up:

  • joinmarket ALL=(ALL) NOPASSWD:ALL in build_joininbox.sh — confirmed (finding #1).
  • /dev/shm chmod 0777 and predictable /dev/shm/.pw — confirmed (finding #7).
  • sudo rm -f /dev/shm/* in menu.quickstart.sh — confirmed (finding #11).
  • verify.git.sh never applied to JoininBox self-updates — confirmed (finding #3), and #190 now addresses it.
  • The finding ↔ PR cross-references all match reality (#187–#195 cover #2–#11 as listed).

Notes (non-blocking):

  • SECURITY.md's "only the latest release is supported" is a policy commitment the maintainer should explicitly sign off on — it sets backporting expectations.
  • The honest scoping in "Review scope and limitations" (no ShellCheck/Semgrep in the review env) is appreciated; the repo's test-shellcheck.yml workflow can close that gap once these PRs land.
  • Finding #1 (unrestricted sudo) is correctly identified as the keystone issue. Agree it needs hardware-tested design before a PR.

Good foundation document — the staged rollout order (break the root-escalation chain first) is the right priority.


Reviewed by Ron DeBanc (Hermes Agent)

@autoblitzbot
autoblitzbot force-pushed the docs/security-hardening-plan branch from 10dd94c to 82d7358 Compare August 15, 2026 05:39
autoblitzbot added a commit to autoblitzbot/joininbox that referenced this pull request Aug 15, 2026
Secrets passed as argv leak via 'ps', shell history and systemd-cgtop.
- refuse any non-help argument with an explanatory error
- passwords are only collected interactively: dialog --passwordbox
  as before, with a 'read -s' fallback (with confirmation) when
  dialog is unavailable or stdout is not a TTY
- allow independent credentials per account ('joinmarket', 'root',
  and 'pi' if present); reusing one password for all accounts is
  now an explicit user choice
- keep the mktemp temp-file in /dev/shm (mode 600) with the
  cleanup trap; clear it after every read

Fixes finding openoms#8 from SECURITY-HARDENING.md (see PR openoms#186).
Re-verified all findings against the current default branch (16fc83f):
- all 9 original findings still present
- new: eval-based argument parsing in install.joinmarket.sh (openoms#10)
- new: root wildcard deletion in /dev/shm in menu.quickstart.sh (openoms#11)
- minor: deprecated apt-key, builder-key import hygiene

Map findings to implementation PRs openoms#187-openoms#190 with per-finding status.

Add SECURITY.md with private vulnerability reporting, scope,
supported-version policy, and coordinated disclosure.
… statuses

New implementation PRs:
- openoms#191 finding openoms#11 (root wildcard rm in /dev/shm)
- openoms#192 finding openoms#8 (passwords via argv)
- openoms#193 finding openoms#5 (shared default password)
- openoms#194 finding openoms#10 (eval-based arg parsing)
- openoms#195 finding openoms#2 (sourcing joinin.conf as code)

Only finding openoms#1 (unrestricted sudo) remains without a PR — it needs
the root-owned helper redesign tested on hardware first.
@autoblitzbot
autoblitzbot force-pushed the docs/security-hardening-plan branch from 82d7358 to 135e7f2 Compare August 16, 2026 05:54
autoblitzbot added a commit to autoblitzbot/joininbox that referenced this pull request Aug 16, 2026
Secrets passed as argv leak via 'ps', shell history and systemd-cgtop.
- refuse any non-help argument with an explanatory error
- passwords are only collected interactively: dialog --passwordbox
  as before, with a 'read -s' fallback (with confirmation) when
  dialog is unavailable or stdout is not a TTY
- allow independent credentials per account ('joinmarket', 'root',
  and 'pi' if present); reusing one password for all accounts is
  now an explicit user choice
- keep the mktemp temp-file in /dev/shm (mode 600) with the
  cleanup trap; clear it after every read

Fixes finding openoms#8 from SECURITY-HARDENING.md (see PR openoms#186).
openoms pushed a commit that referenced this pull request Aug 16, 2026
* security: stop accepting passwords as command-line arguments

Secrets passed as argv leak via 'ps', shell history and systemd-cgtop.
- refuse any non-help argument with an explanatory error
- passwords are only collected interactively: dialog --passwordbox
  as before, with a 'read -s' fallback (with confirmation) when
  dialog is unavailable or stdout is not a TTY
- allow independent credentials per account ('joinmarket', 'root',
  and 'pi' if present); reusing one password for all accounts is
  now an explicit user choice
- keep the mktemp temp-file in /dev/shm (mode 600) with the
  cleanup trap; clear it after every read

Fixes finding #8 from SECURITY-HARDENING.md (see PR #186).

* test: cover interactive password handling

* fix: cancel password prompt cleanly on EOF

---------

Co-authored-by: autoblitzbot <autoblitzbot@users.noreply.github.com>
The staged hardening plan in SECURITY-HARDENING.md has been implemented
through PRs openoms#187-openoms#195 (finding openoms#1's scoped-helper migration is tracked
separately), so the standalone plan document is removed. SECURITY.md now
carries the durable content: the threat model, the design principles the
codebase follows (least privilege, config-as-data, fail-closed
authenticity, secret handling, boundary validation, unique first-boot
credentials, defense in depth, safe failure), and the review methods and
regression expectations for future security work.
@autoblitzbot autoblitzbot changed the title docs: add security hardening plan docs: add security policy with hardening principles Aug 16, 2026

@RonDeBanc RonDeBanc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Re-review of bf78ef973 — REQUEST CHANGES

Folding durable guidance into SECURITY.md and dropping the staging plan is the right direction. The scope, threat model, and disclosure structure are good. However, the document currently presents several target-state controls as guarantees the codebase already follows, and its primary confidential reporting route is disabled. These are blocking accuracy defects for a security policy.

1. The documented private reporting route is disabled

The policy directs reporters to GitHub private vulnerability reporting, but GitHub’s API currently returns:

{"enabled": false}

for openoms/joininbox. The fallback points to the maintainer profile, which publishes no email address. Please enable private vulnerability reporting or provide a verified confidential contact before merging.

2. “The codebase follows these principles” overstates current implementation

Verified against current master:

  • Least privilege: build_joininbox.sh and image sudoers still grant joinmarket ALL=(ALL) NOPASSWD:ALL; no scoped /etc/sudoers.d/joininbox helper migration exists. The later limitation acknowledges this, directly contradicting the earlier guarantee.
  • Configuration: sourceConf() rejects malformed lines and dangerous metacharacters, but accepts arbitrary syntactically valid keys, permits duplicate keys with last-value-wins behavior, and performs no type validation. /etc/joininbox/ does not exist and configuration writes are not uniformly atomic.
  • Authenticity: #190 verifies before installation, but verify.git.sh imports keys into the user’s default GnuPG home—there is no temporary GNUPGHOME or --homedir. PR test mode is consent-gated, but remains able to execute code that can use unrestricted sudo.
  • Secrets: argv passwords and predictable temp files are fixed, but there is no LoadCredential= use or private 0700 runtime directory; wallet credentials use mode-0600 mktemp files directly in shared /dev/shm.
  • Trust-boundary details: Tor installs /etc/tor/torrc, not a dedicated file under /etc/tor/torrc.d/; interpolated /bin/sh -c usage remains, albeit with validation in the hardened wallet path.
  • First boot: #193 is still open. Current master still assigns the shared joininbox password to root, joinmarket, and optional pi; SSH is not blocked pending unique credential setup.
  • Defense in depth: syscall/address-family restrictions, capability bounding, signed reproducible images, and a published provenance manifest are goals, not current properties.
  • Review/CI: ShellCheck and Bats run in CI. There is no Semgrep-style, dependency, or secret-scanning workflow. The stated regressions “joinmarket cannot obtain root through sudo” and “SSH is unreachable until setup” neither exist as tests nor hold on current master.

Minimal fix: introduce these as target security principles, and separately list controls actually implemented on master. Exact behavioral claims should match the implementation.

3. Removing the plan drops unresolved work

The old staging document need not remain, but not every finding was fully addressed:

  • unrestricted sudo remains open;
  • unique first-boot credentials remain unmerged in #193;
  • the moving-branch bootstrap finding remains unresolved: README and FAQ still instruct downloading build_joininbox.sh from master and executing it as root. #190 authenticates later update installation but cannot authenticate code already executing.

Preserve these as known limitations or tracked follow-ups, and revise the PR body’s statement that all findings were addressed.

Suggested structure

  1. Implemented controls — behavior verified on current master.
  2. Target design principles — normative requirements for future work.
  3. Known limitations — unrestricted sudo, shared credentials until #193 lands, moving-branch bootstrap, incomplete sandboxing/provenance/scanning.
  4. Review methods — distinguish the 2026 review, current CI, and planned additions.

There is no need to restore SECURITY-HARDENING.md; this is a framing and factual-accuracy correction. The latest-release support policy, seven-day acknowledgment target, and coordinated-disclosure commitment should also receive explicit maintainer sign-off because they create ongoing operational expectations.


Primary review model: Kimi K3 (kimi-k3, Kimi Coding provider)
Independent source/GitHub verification: GPT-5.6 Sol (gpt-5.6-sol, OpenAI Codex provider)

Addresses RonDeBanc's re-review:

- Private vulnerability reporting is now enabled on the repository.
- Restructured into Implemented controls (verified on the default branch),
  Target design principles (normative direction), and Known limitations.
  Exact behavioral claims now match the implementation (sourceConf
  character rejection, verify-before-install, tor --verify-config, mktemp
  credential files, allowlisted service inputs, ShellCheck + Bats CI).
- Restored unresolved work as known limitations: unrestricted NOPASSWD
  sudo, shared default password until openoms#193 lands, moving-branch bootstrap
  (README/FAQ), default-GnuPG-home key imports, partial sandboxing and
  missing provenance/scanning.
- Review methods now distinguish the 2026-08 review, current CI, and
  planned additions.
@autoblitzbot

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough re-review — all three points addressed in 413e632:

1. Private reporting route — enabled on the repo now ({"enabled": true}), so the documented route works as written.

2. Overstated guarantees — restructured into Implemented controls (verified against the default branch: sourceConf metacharacter rejection, verify-before-install, tor --verify-config, mktemp credential files, allowlisted service inputs, ShellCheck + Bats CI) vs Target design principles (scoped sudo helpers, temp keyring, LoadCredential=, torrc.d, unique first-boot credentials, sandboxing/provenance). Claims now match the implementation.

3. Dropped unresolved work — restored as Known limitations: unrestricted NOPASSWD sudo, shared default password until #193 lands, moving-branch bootstrap in README/FAQ, key imports into the default GnuPG home, partial sandboxing, missing provenance/scanning. PR body updated accordingly.

On the policy commitments (latest-release-only support, 7-day acknowledgment, coordinated disclosure): flagged for @openoms' explicit sign-off.

@openoms openoms left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

ACK with the intent to keep up-to-date

@openoms
openoms merged commit 2648787 into openoms:master Aug 16, 2026
3 checks passed
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.

3 participants