Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(np08): make evidence scanner portable in CI

Alfredo Lopez61cbd242a391
diff --git a/scripts/security/scan-np08-evidence.sh b/scripts/security/scan-np08-evidence.sh
index d0152516f..e07140df3 100755
--- a/scripts/security/scan-np08-evidence.sh
+++ b/scripts/security/scan-np08-evidence.sh
@@ -5,8 +5,8 @@ set -euo pipefail
# lines. API/log inputs must already be redacted; rendered manifests are a
# separate scope and may contain Secret references, but never credential values.
-command -v rg >/dev/null 2>&1 || {
- echo 'FAIL: ripgrep (rg) is required for NP-08 evidence scanning' >&2
+command -v grep >/dev/null 2>&1 || {
+ echo 'FAIL: grep is required for NP-08 evidence scanning' >&2
exit 1
}
@@ -66,13 +66,13 @@ scan_scope() {
local input
for input in "$@"; do
local hits="${tmpdir}/${scope}-${count}.hits"
- local rg_status
- if rg -n -I -i --no-messages -e "${pattern}" "${input}" >"${hits}"; then
+ local grep_status
+ if grep -E -n -I -i -- "${pattern}" "${input}" >"${hits}" 2>/dev/null; then
count=$((count + $(wc -l <"${hits}")))
else
- rg_status=$?
- if [[ "${rg_status}" -ne 1 ]]; then
- echo "FAIL: rg could not scan ${scope} evidence (exit ${rg_status})" >&2
+ grep_status=$?
+ if [[ "${grep_status}" -ne 1 ]]; then
+ echo "FAIL: grep could not scan ${scope} evidence (exit ${grep_status})" >&2
return 2
fi
fi
diff --git a/scripts/tests/test-np08-evidence-scanner.sh b/scripts/tests/test-np08-evidence-scanner.sh
index 8b5772da8..8ef4fdc42 100755
--- a/scripts/tests/test-np08-evidence-scanner.sh
+++ b/scripts/tests/test-np08-evidence-scanner.sh
@@ -9,19 +9,19 @@ BASH_BIN="$(command -v bash)"
if PATH="${tmpdir}/missing-tools" "${BASH_BIN}" "${SCANNER}" \
--stdin-kind api </dev/null >/dev/null 2>&1; then
- echo 'FAIL: scanner passed without ripgrep' >&2
+ echo 'FAIL: scanner passed without grep' >&2
exit 1
fi
if (
# Invoked indirectly by the scanner's child Bash process.
# shellcheck disable=SC2329
- rg() { return 2; }
- export -f rg
+ grep() { return 2; }
+ export -f grep
printf '%s\n' '{"Authorization":"Bearer abc.def.ghi"}' |
bash "${SCANNER}" --stdin-kind api >/dev/null 2>&1
); then
- echo 'FAIL: scanner passed when ripgrep returned an execution error' >&2
+ echo 'FAIL: scanner passed when grep returned an execution error' >&2
exit 1
fi