Observability: auditd rule to catch external docker stop / docker rm calls on claude-hooks-* containers #149
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#149
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As the operator, I want an
auditdrule that logs the calling PID + command line + cwd every timedocker stopordocker rmis invoked against aclaude-hooks-*container, so that the next timedev-defaultsilently vanishes (#132) we have the caller identity instead of another round of guessing.Context
#132's investigation (see comment #132 (comment)) ruled out every obvious candidate — no OOM, no restart-policy exhaustion, no service-side
reconcileOnecall, no shell history, no cron. Yet dockerd logsstopping restart-manager6× today fordev-defaultexclusively. Something external is callingdocker stop/rmand we can't see who.auditdwith a rule on thedockerbinary'sexecve(+ a filter that fires only when the argv containsstoporrmand aclaude-hooks-name) would capture the caller's PID, executable path, cwd, and command line for every invocation. That's the one piece of information that would turn this from "mystery" into "we know which process is doing it and can fix or kill it."Acceptance criteria
Rule file
ops/audit/claude-hooks-docker.rulesin the repo — auditd format, one rule per line.execveof/usr/bin/docker(or whereverwhich dockerpoints on the deployment host — detect at install time) when argv containsstoporrmAND argv[n] matchesclaude-hooks-*. Use a-k claude-hooks-dockeraudit key so the operator can grep results cleanly.Install path
just audit-installrecipe that:/etc/audit/rules.d/(requires sudo — recipe runssudo install, prompts).sudo augenrules --loadto apply.ausearch -k claude-hooks-docker -ts todaycommand the operator would run to read the logs.just audit-tailrecipe: tailsausearch -k claude-hooks-docker --line-bufferedin follow mode, filtered to human-readable lines (useaureport -kor parse ausearch output to the fields operators actually need: timestamp, PID, exe, argv, cwd).Docs
just audit-install/just audit-tail.Validation
docker stop claude-hooks-<test-instance>manually; confirm the entry appears viaausearch -k claude-hooks-dockerwith operator's shell PID.bash -c 'docker stop claude-hooks-…'); confirm the subprocess + its parent are both logged.Out of scope
ausearchis fine.stop/rm(no interest in auditingdocker runorexec).References
src/container-watchdog.ts(from #134).charles-desktop, Arch Linux, systemd-based,auditdshould install viapacman -S audit.Dependencies
main.