Files
felhom.eu/documentation/audits/SPIKE-cc-creds-2026-10-17/probes/q1.sh
T
adminandClaude Opus 5.5 b9c4f73bfa
gates / gates (push) Failing after 6m36s
SPIKE cc-creds: secret broker + CC transcript guards measured with canaries (R-1118..R-1122, 168 -> 173)
Mask PASS, PreToolUse refuse PASS, PostToolUse replace PARTIAL (crash and
large-output disk leaks, both with a measured fix), SOPS+age store PARTIAL
(private repo could not be created), transcript sweep PASS. Fake secrets
only; ~/.config/credentials not read; no CC settings changed. Files use
"creds": .gitignore *secret* ignores the brief's names. STATUS D10: the
store choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
2026-10-17 11:57:24 +02:00

33 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Q1 runner: each shape twice — --no-filter (red-proof) then filtered. Prints counts and rc only.
set -u
cd "$(dirname "$0")"
C=canary-Q1.txt; OUT=evidence/q1; mkdir -p $OUT/raw
PORT=18765; python3 srv303.py $PORT & SRV=$!; sleep 0.5
cat > $OUT/raw/bashx.sh <<'X'
set -x
TOKEN_USE="$C"
: "$C"
X
declare -A S
S[1-printf]='printf "%s\n" "$C"'
S[2-bash-x]="bash -x $OUT/raw/bashx.sh"
S[3-curl-redirect_url]="curl -s -o /dev/null -u \":\$C\" -w '%{redirect_url}\n' http://127.0.0.1:$PORT/"
S[4-curl-v-bearer]="curl -sv -o /dev/null -H \"Authorization: Bearer \$C\" http://127.0.0.1:$PORT/"
S[5-base64]='printf %s "$C" | base64'
S[6-byte-per-flush]="python3 -c 'import os,sys
for ch in os.environ[\"C\"]: sys.stdout.write(ch); sys.stdout.flush()
print()'"
S[7-stdin-bash]="bash -c 'read -r T; printf \"%s\n\" \"\$T\"'"
printf '%-22s %8s %8s %6s %6s\n' shape unfilt filt rc_unf rc_filt
for k in $(printf '%s\n' "${!S[@]}" | sort); do
extra=(); [[ $k == 7-* ]] && extra=(--stdin C)
python3 mask.py --secret C=$C "${extra[@]}" --no-filter -- bash -c "${S[$k]}" >$OUT/raw/$k.unf 2>&1; r1=$?
python3 mask.py --secret C=$C "${extra[@]}" -- bash -c "${S[$k]}" >$OUT/raw/$k.filt 2>&1; r2=$?
printf '%-22s %8s %8s %6s %6s\n' $k "$(python3 seen.py $C $OUT/raw/$k.unf)" "$(python3 seen.py $C $OUT/raw/$k.filt)" $r1 $r2
done
# exit-code passthrough with a non-zero code and a signal
python3 mask.py --secret C=$C -- bash -c 'exit 37'; echo "passthrough exit 37 -> $?"
python3 mask.py --secret C=$C -- bash -c 'kill -TERM $$'; echo "passthrough SIGTERM -> $? (expect 143)"
kill $SRV