Skip to content

harden: install a hardened copy with mairu harden - #66

Draft
sorah wants to merge 3 commits into
hardening/peer-verificationfrom
hardening/install
Draft

sorah wants to merge 3 commits into
hardening/peer-verificationfrom
hardening/install

Conversation

@sorah

@sorah sorah commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Implements docs/specs/005-install.md.

  • sudo mairu harden: creates the mairu group (refusing members, primary-group users, group passwords), copies the binary as root:mairu 2755 into <harden_home>/libexec/mairu/ with cap_ipc_lock, copies shipped helpers, creates /var/lib/mairu{,/users}, and records a root-owned manifest and the /var/lib/mairu/installs inventory. --uninstall [--purge] trusts only that manifest
  • harden home: --home, MAIRU_HARDEN_HOME, harden_home in config.json; defaults to /usr/local (Linux)
  • upgrades: sudo <hardened copy> harden --from FILE verifies the sigstore attestation (signer sorah/mairu release.yml at a v* tag), refuses downgrades; --unattested, --allow-downgrade
  • unhardened binaries re-exec a validated hardened copy, with a version-skew warning and a one-time hardening suggestion
  • doctor lists hardened copies and warns about root-reachable users (passwordless sudo, docker/lxd/incus-admin/disk)
  • debian postinst, pkg/sysusers.d and pkg/tmpfiles.d snippets; a linux-hardened CI job

Attestation uses sigstore-verify / sigstore-trust-root (sigstore-rust) rather than the sigstore crate; they pull reqwest 0.13 with platform-verifier roots on Linux only, growing the release binary by about 2.7 MB. Other deviations are recorded in the spec's Current Status.

Note: a binary with cap_ipc_lock=+ep fails to exec where CAP_IPC_LOCK is outside the bounding set (e.g. default Docker). That already applied to the deb; re-exec warns and continues unhardened there.

Verified in Docker (120 checks), including a real .deb installed with dpkg -i.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM

sorah and others added 2 commits October 31, 2026 07:38
Adds `mairu harden` (install, --from with sigstore attestation
verification, --uninstall/--purge, harden home), re-exec of the
hardened copy from unhardened installations with a version-skew
warning, a periodic harden suggestion, hardened copies and
root-reachability warnings in doctor, the Debian postinst and
sysusers/tmpfiles snippets, and a linux-hardened CI job.

Attestations are verified with sigstore-verify/sigstore-trust-root,
which verify bundles only and fetch the trust root through TUF from
an embedded root, with system TLS roots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM
@sorah
sorah added this pull request to stack #63 October 30, 2026 22:38
@sorah sorah changed the title hardening/install harden: install a hardened copy with mairu harden Oct 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM

This branch has not been deployed

No deployments
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.

1 participant