0.9.29 — rootless: RCTL umbrella auto-apply at create_jail#187
Merged
Conversation
Thirtieth 0.9.x release. The set_loginclass_rctl primitive
from 0.9.28 now fires automatically after a successful
create_jail privops invocation, sourced from a new
rctl_umbrella: block in crated.conf. Operators no longer
need a startup-script step to seed loginclass quotas.
Config schema:
Crated::Config gains rctlUmbrella (vector<pair<key,val>>).
YAML form:
rctl_umbrella:
memoryuse: 4G
pcpu: 200
maxproc: 256
Validated via RetunePure at load time.
Process-global rules:
Crated::setUmbrellaConfig(rules) registered once at
daemon startup. main.cpp calls before opening privops
listener.
Auto-apply in dispatcher:
maybeApplyUmbrella(verb, uid, status) runs after every
libnv-transport dispatch. Fires when:
- verb == CreateJail
- uid > 0 (libnv path; HTTP always uid=0 → no-op)
- 200 <= status < 300
- g_umbrellaRules non-empty
Runs rctl -a loginclass:crate-<uid>:KEY:deny=VALUE per rule
via Util::execCommand. Best-effort: failures log to stderr,
don't fail the create_jail response.
HTTP path skips auto-apply (no peer uid available — 0.9.14
cpp-httplib limitation). Operators wanting umbrella on HTTP
clients call set_loginclass_rctl manually.
Suite stays at 1303 (auto-apply needs real rctl(8)).
Remaining: default flip (0.9.30), setuid removed (1.0.0).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Thirtieth 0.9.x release. The
set_loginclass_rctlprimitive from 0.9.28 now fires automatically after a successfulcreate_jailprivops invocation, sourced from a newrctl_umbrella:block incrated.conf. Operators no longer need a startup-script step to seed loginclass quotas.What lands
Config schema
Crated::Config::rctlUmbrella(vector of pairs). YAML parser validates each key/value viaRetunePure::validateRctlKey/validateRctlValueat load time — bad entries throw at daemon startup, not at first jail-create.Auto-apply
maybeApplyUmbrella(verb, uid, status)post-hook runs after every libnv-transport dispatch. Fires only when:verb == CreateJailuid > 0(peer creds known — libnv socket only; HTTP path always has uid=0 → no-op)200 <= status < 300g_umbrellaRulesnon-emptyFor each rule:
rctl -a loginclass:crate-<uid>:KEY:deny=VALUEviaUtil::execCommand. Best-effort — rctl failures log to stderr but don't fail the create_jail response (jail is up; losing an umbrella rule is a quota gap, not a correctness break).Behaviour
HTTP path: no auto-apply
The HTTP transport never has a peer uid (cpp-httplib limitation; 0.9.14 architecture decision). Auto-apply skips on HTTP requests. Operators wanting umbrella on HTTP clients call
set_loginclass_rctlmanually.Test plan
daemon/privops_handlers.o,daemon/config.ocompile cleanNo new tests — auto-apply path is daemon-side runtime behaviour requiring real
rctl(8). Indirect coverage:rctl_umbrellaconfig parsing tested implicitly via daemon startup on FreeBSD CI (bad config = startup throw)maybeApplyUmbrellamirrorsmaybeWritePerUserAuditshape (proven from 0.9.13)set_loginclass_rctlvalidators (0.9.28) cover the key/value pathSeries state
CLI call-sites wired (12+). Per-user namespacing fully wired:
Remaining:
rootless_per_user: truebecomes default incrated.conf.sample)Makefile installGenerated by Claude Code