Nicolas Cantu 880fe3857e
Some checks failed
CI - 4NK_wallet / Unit Tests (push) Successful in 20s
CI - 4NK_wallet / Docker Build & Test (push) Successful in 5s
CI - 4NK_wallet / Security Audit (push) Successful in 4s
CI - 4NK_wallet / Release Guard (push) Has been skipped
CI - 4NK_wallet / Code Quality (push) Failing after 22s
CI - 4NK_wallet / Integration Tests (push) Failing after 9s
CI - 4NK_wallet / Security Tests (push) Failing after 4s
CI - 4NK_wallet / Documentation Tests (push) Failing after 3s
CI - 4NK_wallet / Performance Tests (push) Failing after 4s
CI - 4NK_wallet / Notify (push) Failing after 2s
chore(release): latest 0.1.0 + sécurité/CI/docs
2025-08-27 13:50:32 +02:00

36 lines
1.1 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
echo "[security-audit] démarrage"
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd)"
cd "$ROOT_DIR"
rc=0
# 1) Audit npm (si package.json présent)
if [ -f package.json ]; then
echo "[security-audit] npm audit --audit-level=moderate"
if ! npm audit --audit-level=moderate; then rc=1; fi || true
else
echo "[security-audit] pas de package.json (ok)"
fi
# 2) Audit Rust (si Cargo.toml présent)
if command -v cargo >/dev/null 2>&1 && [ -f Cargo.toml ] || find . -maxdepth 2 -name Cargo.toml | grep -q . ; then
echo "[security-audit] cargo audit"
if ! cargo audit --deny warnings; then rc=1; fi || true
else
echo "[security-audit] pas de projet Rust (ok)"
fi
# 3) Recherche de secrets grossiers
echo "[security-audit] scan secrets"
if grep -RIE "(?i)(api[_-]?key|secret|password|private[_-]?key)" --exclude-dir .git --exclude-dir node_modules --exclude-dir target --exclude "*.md" . >/dev/null 2>&1; then
echo "[security-audit] secrets potentiels détectés"; rc=1
else
echo "[security-audit] aucun secret évident"
fi
echo "[security-audit] terminé rc=$rc"
exit $rc