mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 18:43:38 +01:00
The default command policy approves `cat`, `head`, `tail` and `grep` without a human for log reads. Those rules were prefix matches, so the whole command was approved as long as one word named a `/var/log/` (or `/log/`) path. This change checks every argument instead. - Words must be plain, single-quoted or simply double-quoted. Options must be known for each program, take checked values and come before the first operand. Every file operand must be a path under `/var/log`, with no parent segment and no glob that could expand to one. - grep options that open another file or follow every symlink need approval. So does a recursive grep whose only operands are globs. - A single `&` now counts as a command separator, and the `/etc/os-release` rule takes no extra operands. - Behaviour change: tail, head and grep on log directories outside `/var/log` now need approval. Tests cover the allowed forms, including the single-quoted path that `pulse_read` builds for tail, and the refused ones. The agent-lifecycle contract records the rule.