Skip to content

hardening: ask through polkit before vending credentials - #68

Draft
sorah wants to merge 2 commits into
hardening/platform-helperfrom
hardening/authorization
Draft

sorah wants to merge 2 commits into
hardening/platform-helperfrom
hardening/authorization

Conversation

@sorah

@sorah sorah commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Implements docs/specs/007-authorization.md.

  • Cedar policy engine (cedar-policy 4.14, no default features) with the strict schema and built-in policies (builtin-human for hardened agents, builtin-unhardened otherwise); evaluation errors deny
  • gate 1 in AssumeRole: remembered approvals (lease, then terminal-session grant) before a fresh presence check; pre-fetches never prompt; identical concurrent requests share one prompt keyed by peer and request digest
  • polkit backend in the platform helper (zbus_polkit), pinned to the authority's unique name after an owner check, with cancellation on client disconnect
  • RevokeAuthorizations and mairu lock [--session] [--running]; ClientContext from exec and credential-process; doctor shows session and authorization state
  • pkg/polkit/co.0w0.mairu.policy, installed by harden and the deb
  • size ceiling raised to 40 MB: release mairu is ~29.5 MB with Cedar; the helper stays under 5 MB without cli code

Deviations recorded in the spec: polkit refuses details from non-root callers, so prompts carry no role/server variables and the terminal prints the context instead; the PolicyKit1 owner may be uid 0 or the polkitd user (never the agent's uid).

Verified in Docker (52 checks) against a real dbus-daemon and polkitd 126, including pkttyagent password prompts, grant reuse per terminal session, mairu lock, leases for running mairu exec, and an untrusted PolicyKit1 owner failing closed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM

sorah and others added 2 commits October 31, 2026 08:40
Gate 1 of AssumeRole evaluates a built-in Cedar policy with what is
remembered (nothing, the lease of a running `mairu exec`, the grant of
the caller's terminal session) and, when only a fresh human check would
permit the request, asks through the platform helper's new polkit
backend. Unhardened agents keep permitting everything.

polkit refuses details from non-root callers, so the action messages
name no variables and the client prints the context instead. polkitd
runs as its own system user, so that user is trusted as the owner of
org.freedesktop.PolicyKit1 along with root.

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 23:41
@sorah sorah changed the title hardening/authorization hardening: ask through polkit before vending credentials 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