Skip to content

hardening: classify setgid marker gid at startup - #64

Draft
sorah wants to merge 2 commits into
hardening/build-layoutfrom
hardening/marker-gid
Draft

sorah wants to merge 2 commits into
hardening/build-layoutfrom
hardening/marker-gid

Conversation

@sorah

@sorah sorah commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Implements docs/specs/003-marker-gid.md.

  • crate::hardening (core): Hardening::detect() classifies the process as Unhardened / Hardened / Misconfigured from its ids, AT_SECURE, the mairu group and fs.suid_dumpable, first thing in main. A hardened process keeps the marker gid only in the saved slot
  • with_privileged_gid raises the marker around client connect() and agent bind()+listen(); drop_privileged_gid_permanently before the executor execs the user's command; command() drops it in every spawned child
  • PR_SET_DUMPABLE(0) after every gid change

Verified in Docker with a root:mairu 2755 build: the agent holds the marker only as saved gid, mairu exec children carry none, and hardened/unhardened clients and agents still interoperate. Misconfigured setups (member of mairu, primary group mairu, setgid to another group) warn and hold no marker.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM

sorah and others added 2 commits October 31, 2026 06:33
A hardened process keeps the marker only in its saved gid, raises it
around connect() and bind()+listen(), and drops it before exec'ing
anything, so `mairu exec` commands never carry it.

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 21:33
@sorah sorah changed the title hardening/marker gid hardening: classify setgid marker gid at startup Oct 30, 2026

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