feat(orchestrator): firewall view with signed settings changes (001 S6)

Requirement 001 S6: the hub gets a Firewall view of the Claude Code permission and sandbox settings. The operator signs each change with the passkey; a host settings writer (systemd path unit) applies only exact, signed changes to allowlisted settings files through O_NOFOLLOW directory and file descriptors, and a timer refreshes the view. Every signed text and every page sink refuses or marks hidden characters: Cc, Cf, Zl, Zp, every space but U+0020 and the Default_Ignorable set, with U+FE0E/U+FE0F allowed only after one of the 359 non-ASCII emoji bases of Unicode 16 (shared table, validated at import, the same pair rule on the page). Removal of a deny, ask or denyRead entry is exempt only as an exact single remove. The permission hook prints the hub's refusal reason, cleaned of hidden characters. Accepted MEDUSA false positives (independent review, operator pick): 38 this round, mainly the Unicode defence tables read as attack patterns, generic MM-SCAN-058 heuristics, WEB-FLASK-004 at view.py:213 (ints from the validated table via tojson), EXF26-TOOL-004 on the non-secret WebAuthn challenge, PRIV-SCAN-060 on the office-action shape check and PQC007 on a picker key.

🎯 Fix: 95 %
💥 Break: 3 %
💸 Cost: –
⏱️ Time: –
🛡️ Security: 100 %
🏆 Score: 92
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-13 18:14:17 +00:00
1 parent 3418738993
commit 9742884308
54 files changed
+3920 -168

No files matched your search

+24 -4
View File
@@ -5,9 +5,9 @@
# server for Claude Code, build pkgmgr from the newest signed tag of
# PKGMGR_REPO and enable the tree timer and the cleanup path unit,
# enable the sessions timer and the offices path unit, enable the
# resources timer; re-enable the runner and re-register
# the hook when the migration took them over; an enabled runner gets
# the fresh unit and a restart
# resources timer, the firewall path unit and timer; re-enable the
# runner and re-register the hook when the migration took them over;
# an enabled runner gets the fresh unit and a restart
# migrate move every trace of the earlier name to the kvb-orchestrator names
# once: container, image, code, state, approvals, pinned keys, MCP
# server, PermissionRequest hook, runner unit; a second run changes
@@ -42,6 +42,7 @@ CLEANUP_UNIT="${NAME}-cleanup"
OFFICES_UNIT="${NAME}-offices"
SESSIONS_UNIT="${NAME}-sessions"
RESOURCES_UNIT="${NAME}-resources"
FIREWALL_UNIT="${NAME}-firewall"
INSTALLED_SKILLS="${HOME}/.claude/skills"
HOST_SCRIPTS=(kvb-org-organize/scripts/council.py kvb-org-organize/scripts/nofollow.py kvb-org-rasci/scripts/rasci.py)
TREE_DIR="${HOME}/.local/state/pkgmgr/tree"
@@ -157,7 +158,7 @@ install_hub() {
cp -a "${REPO_ROOT}/orchestrator/." "${HUB}/"
# Python loads a cached .pyc whose header matches the source mtime and size, and cp -a keeps the mtime: one planted in the sandbox-writable tree would run on the host
find "${HUB}" -name __pycache__ -type d -prune -exec rm -rf {} +
chmod +x "${HUB}/client/permission_hook.py" "${HUB}/client/runner.py" "${HUB}/client/approval.py" "${HUB}/client/cleanup.py" "${HUB}/client/offices.py" "${HUB}/client/sessions.py" "${HUB}/client/resources.py"
chmod +x "${HUB}/client/permission_hook.py" "${HUB}/client/runner.py" "${HUB}/client/approval.py" "${HUB}/client/cleanup.py" "${HUB}/client/offices.py" "${HUB}/client/sessions.py" "${HUB}/client/resources.py" "${HUB}/client/settings_writer.py"
log "skills: the PermissionRequest hook client is ${HUB}/client/permission_hook.py"
log "skills: approvals need a pinned passkey: settings, 'Passkey registrieren', then 'make orchestrator-pin CREDENTIAL=<blob>'; until then every executor refuses"
printf 'KVB_ORCHESTRATOR_USER=%s:%s\nKVB_ORCHESTRATOR_STATE=%s\nKVB_ORCHESTRATOR_COUNCIL=%s\nKVB_ORCHESTRATOR_SKILLS=%s\nKVB_ORCHESTRATOR_PROJECTS=%s\nKVB_ORCHESTRATOR_TREE=%s\nKVB_ORCHESTRATOR_TIMERS=%s\nKVB_ORCHESTRATOR_APPROVERS=%s\nKVB_ORCHESTRATOR_KEPT=%s\n' \
@@ -257,6 +258,19 @@ resources_timer() {
log "skills: ${RESOURCES_UNIT}.timer samples the host and counts the transcripts' tokens into ${HOME}/.local/state/agents-council/resources every minute"
}
firewall_unit() {
if ! has_systemd; then
warn "skills: no systemd user session; the Firewall shows no settings and signed settings changes wait."
return 0
fi
cp -f "${HUB}/systemd/${FIREWALL_UNIT}.service" "${HUB}/systemd/${FIREWALL_UNIT}.path" "${HUB}/systemd/${FIREWALL_UNIT}.timer" "${UNITS}/"
systemctl --user daemon-reload
systemctl --user enable --now "${FIREWALL_UNIT}.path"
systemctl --user enable --now "${FIREWALL_UNIT}.timer"
systemctl --user restart "${FIREWALL_UNIT}.timer"
log "skills: ${FIREWALL_UNIT}.path writes the settings changes the operator signs in the Firewall; ${FIREWALL_UNIT}.timer refreshes the settings view every minute"
}
skills_current() {
local script
for script in "${HOST_SCRIPTS[@]}"; do
@@ -286,6 +300,7 @@ install_all() {
tree_timer
sessions_timer
resources_timer
firewall_unit
offices_unit
if ((TOOK_RUNNER)) || runner_enabled; then runner || true; fi
if ((TOOK_HOOK)); then
@@ -374,6 +389,11 @@ check() {
else
todo "${RESOURCES_UNIT}.timer off: the Resources view waits for make orchestrator-install"
fi
if [[ "$(systemctl --user is-active "${FIREWALL_UNIT}.path" 2>/dev/null || true)" == "active" ]]; then
ok "${FIREWALL_UNIT}.path active"
else
todo "${FIREWALL_UNIT}.path off: Firewall settings changes wait for make orchestrator-install"
fi
if [[ "$(systemctl --user is-active "${OFFICES_UNIT}.path" 2>/dev/null || true)" == "active" ]]; then
ok "${OFFICES_UNIT}.path active"
else