feat(TASK-048): install polish, hooks-dir mixin scan, script and probe hardening
- one shared exec-bit predicate (Language-recognized extensions => 0755) used by
every hook/agent installer; non-script files in hooks dirs stay non-executable
- mixin discovery scans the global hooks dir and each agent's hooks dir;
.builtin-manifest is never scanned
- NTFS 8.3 short-name aliases rejected as builtin-manifest entries
- hook-script install announcements restricted to real hook locations
- COYOTE_HOOKS_DIR override warning compares canonicalized paths
- embedded assets decode via checked from_utf8 instead of from_utf8_unchecked
- log-events.sh defaults under ${XDG_STATE_HOME:-$HOME/.local/state}/coyote/hooks.log
keeping 0600/symlink-refusal/secret-filter hardening; notify.sh tty fallback strips
control bytes; both use UTC ISO-8601 timestamps
- payload files orphaned by a write failure are unlinked; stale coyote-hook-*.json
payloads swept best-effort at startup
- sweep_removed_agent_hooks never follows symlinked agent dirs
- usage-probe-hooks.sh replaces bare sleeps with a bounded poll, re-verifies 0755 on
restored scripts, and covers roles/agent hook locations
- TestConfigDirGuard hoisted into crate::testing
- .gitattributes pins LF line endings for bundled scripts
hooks is now a reserved bundle name.
This commit is contained in:
16 files changed
+627
-353
No files matched your search
@@ -4,7 +4,8 @@
|
||||
# each one carries.
|
||||
#
|
||||
# Env vars read:
|
||||
# COYOTE_HOOK_LOG log file to append to (default: /tmp/coyote-hooks.log)
|
||||
# COYOTE_HOOK_LOG log file to append to
|
||||
# (default: ${XDG_STATE_HOME:-$HOME/.local/state}/coyote/hooks.log)
|
||||
# COYOTE_* everything coyote sets for the event is dumped verbatim
|
||||
#
|
||||
# Secrets (COYOTE_SECRET_*) are excluded from the snapshot; widening the grep
|
||||
@@ -26,15 +27,15 @@
|
||||
|
||||
set -u
|
||||
|
||||
log_file="${COYOTE_HOOK_LOG:-/tmp/coyote-hooks.log}"
|
||||
log_file="${COYOTE_HOOK_LOG:-${XDG_STATE_HOME:-$HOME/.local/state}/coyote/hooks.log}"
|
||||
|
||||
# The default lives in shared /tmp: refuse to append through a symlink someone
|
||||
# else planted there. Point COYOTE_HOOK_LOG at a private path to avoid the
|
||||
# shared directory entirely.
|
||||
# COYOTE_HOOK_LOG may point into a shared directory: refuse to append through
|
||||
# a symlink someone else planted there.
|
||||
[ -L "$log_file" ] && exit 0
|
||||
umask 077
|
||||
mkdir -p "$(dirname "$log_file")" 2> /dev/null || true
|
||||
{
|
||||
echo "=== $(date '+%Y-%m-%dT%H:%M:%S%z') ${COYOTE_EVENT:-unknown}"
|
||||
echo "=== $(date -u '+%Y-%m-%dT%H:%M:%SZ') ${COYOTE_EVENT:-unknown}"
|
||||
env | grep '^COYOTE_' | grep -v '^COYOTE_SECRET_' | sort
|
||||
echo
|
||||
} >> "$log_file" 2> /dev/null || true
|
||||
Reference in new issue
Block a user