Repository navigation
docs(osapi): a root broker for declared work - #756
Conversation
|
Code review: approved (head 75c1caa). The three commands match the group in osapi main: |
|
Standards review at 75c1caa. Changes requested: three lines still give the privileges to The change itself fits the rules:
There is no em dash. The title has 44 characters. The commit has 48 characters and its trailer. Lint passes. Open. With this change,
Line 63 (" The label stays |
|
Fixed in 9b3519a, for the standards review at 75c1caa:
The same commit adds three things that the build of osapi#1907 found. Each is a change to the design, so it needs a new review:
|
|
Standards review at 59d0a99, of the broker design. This is a full review, and replaces my review of the sudo design. Changes requested. What meets the rules:
Open:
Minor:
The label stays |
|
Code review: changes requested (head 59d0a99). I read the new Required
The five points you asked about
Notes, not blocking
|
The build of osapi#1907 showed that a --section flag of behavior get cannot print a file: a command of osapi has one output type. Three commands of the behavior group render the privileges, the sudoers file and the drop-in, as method get and openapi get do. The page also names Relaxes, which declares a sandbox setting that a drop-in turns off, and says that the agent's unit carries the base bounding set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three lines still gave the privileges to behavior get. They now name behavior privileges get, and the generated page of each behavior. What the build of osapi#1907 found: - A declared call names the files that its program writes, and the capabilities that it needs, with .Writes and .Needs. The sandbox of the unit holds root too, so useradd failed without them. - Relaxes(ProtectSystem), for package, on a root-equivalent behavior only. - The files of a behavior hold those of each behavior that it uses. A step of the same name replaces the step of the used behavior. Refs osapi-io/osapi#1907 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner chose a root broker in place of sudo. The agent has no sudo rule, no capability and NoNewPrivileges=yes. It sends one request on a socket to osapi agent privileged serve, which systemd starts as root for each connection. The broker checks the peer, takes the declaration from its own binary, matches the arguments exactly, and runs each call or step in a transient unit with only what it declares. Also: the enabled list of each host, read steps that return no secret, no AnyArgs, the guard and its walk for each file step, the refusals of each step, a fixed unit for the agent, the preflight for a path to root around the broker, the pki lab check, and osapi start as a test only. The lab page installs and checks the broker in place of sudoers files. Refs osapi-io/osapi#1907 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59d0a99 to
29e6427
Compare
|
Standards re-review at 29e6427. Changes requested. I checked the page against the component PR, osapi-io/osapi#1943 at 44a078b3. Fixed:
Still open, from my last review:
New:
No em dash. The PR title has 44 characters, and the squash uses it. One commit subject has 52 characters, but it is not the squash subject. Each commit has its trailer. The label stays |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standards re-review at c5c5d73. Changes requested on two items. I checked the page against osapi#1943 at ed0946bc. Fixed:
Open:
No em dash. The PR title has 44 characters, and the squash uses it. Each commit has its trailer. The label stays |
|
Code review of the page at c5c5d73 (based on current main). I re-read the page against my 7 items of the review of 59d0a99 and against osapi#1943 at 44a078b35c. Where the page is ahead of the code, I say so: those code fixes are in the next push of #1943. My 7 items
Required
Notes, not blocking
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standards re-review at 06a3eb1. One item is open. Fixed:
Open:
The label stays |
|
Code review of 06a3eb1 against osapi#1943 at a634a9d4df. I checked the page against the code and found no mismatch in these claims: the 5 minute default runtime and the 10 second wait, the enabled list naming the requester itself, One point depends on the code review: the page says a call has Clean for the page: I remove |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standards re-review at c982990. Approved.
The label is now |
|
Code review: clean at c982990 for the pages this pull request changes. The page matches osapi#1943 at 0c65464597 on the 30 minute runtimes, Two lines that this pull request does not change are stale and say |
|
Standards review: changes requested (head 50c9a19). There is 1 finding.
Checked, with no finding:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standards review: approved (head a9ba67d). Checked: the finding from 50c9a19 is fixed. The unit table in |
|
Code review at a9ba67d (the head is not 50c9a19), against osapi#1943 at ad9f33733e: the page matches the code on the ping unit running as root with |
The ping of connectivity is an ICMP datagram socket in the agent, not a root call. Only a RootEquivalent call may relax NoNewPrivileges. The unit of a call that is not RootEquivalent hides the secrets of the host, except where SELinux refuses the mount; the openSUSE gap stays open. The RestrictAddressFamilies row now matches systemd.go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standards review: approved (head b77b545). Checked: b77b545 is a fast-forward of a9ba67d with its trailer. Note, not blocking: "This gap stays open." about |
|
Code review: clean at b77b545 against osapi#1943 at 562fc3c368. The page matches the code on the ping in the agent ( |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standards review: approved (head 7bb6586). Checked: one commit on b77b545, a fast-forward with its trailer. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ubuntu keeps the kernel default of net.ipv4.ping_group_range, which holds no group. osapi agent service install widens the range to hold the gid of osapi, and uninstall puts it back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standards review: approved (head 43126b1). Checked: one commit on 53d95b2, fast-forward with its trailer. The ping paragraph of |
|
Code review: clean at 43126b1. The ping_group_range text in least-privilege.md and built-in-behaviors.md matches osapi#1943 at 508ef96e7e: the install file, the smallest range, "# Before:", sysctl -p, never smaller, and the uninstall steps (remove file, sysctl -w, sysctl --system). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standards review: approved (head 303b9df). Checked: one commit on 43126b1, fast-forward with its trailer. The uninstall paragraph of |
|
Code review: clean at 303b9df. The uninstall text (sysctl -w only, no sysctl --system, units still removed on failure, error returned at the end) matches osapi#1943 at 975d87d43c. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Code review: clean at 7402335. The SIGKILL fallback and ended-unit sentence in least-privilege.md matches StopUnit in osapi#1943 at 764f368ba3 (stop exit 5 and a kill that says "not loaded" count as stopped). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Standards review: approved (head 79080af). Checked: one commit on 7402335, a fast-forward with its trailer. The |
|
Code review: clean at 79080af. The paragraph on .As(user) matches osapi#1943 at 69724bd747 (User=, no capability, validate refuses As("root") and As on a macOS call, chronyc as _chrony with Writes("/run/chrony/*")). |
The owner chose a root broker in place of sudo for osapi#1907. This PR changes the least-privilege page and the lab page to the broker design.
osapi agent privileged serve. systemd starts it as root for each connection onosapi-privileged.socket(mode 0660, grouposapi). It checksSO_PEERCRED, reads one capped JSON request, takes the declaration from its own binary, and matches the arguments exactly, with no glob and no join on a space. Then it runs each call or step in a transient unit (systemd-run --wait --pipe) that has only theWrites,NeedsandRelaxesof that call or step. It writes one journal entry for each request. It refuses a request whose declaration hash differs from its own. On macOS, launchd starts it withinetdCompatibility./etc/osapi-privileged/enabled, which root owns.osapi agent privileged enable|disable|listandservice install --privilegedchange it. The broker refuses each behavior that is not in the list.NoNewPrivileges=yes, an empty bounding set andRestrictSUIDSGID=yes, and no sudo rule.Groups(...)refuses a group that gives root.AnyArgsis gone. validate refuses a call without a shape, with no exception.Sudois renamed toRoot.writeandremovesteps. The guard walks each path withopenatandO_NOFOLLOW, sets the owner and mode through the descriptor, and refuses the setuid, setgid and sticky bits and a file with more than one link. Each step has its refusals (sysctl, user, group, sshkey, process).warningsfield.sudoers getandsystemd get.privileges getremains.osapi startis for a test only. The lab checks that/var/lib/osapi/pkikeepsosapi:osapi-admin2750 after a restart.The commits before 59d0a99 hold the sudo design that this PR replaces. Earlier reviews of this PR were of that design.
Refs osapi-io/osapi#1907. The component pull request links back here when it opens.
Component: osapi-io/osapi#1943
Component: osapi-io/osapi-lab#117 (the lab page, components/osapi-lab/README.md)
🤖 Generated with Claude Code