fix(security): GitLeaks allowlist + Dockerfile DL4006 + npm audit в CI
Some checks failed
deploy / deploy (push) Has been cancelled
security / security (push) Has been cancelled

GitLeaks: 8 false-positives на vgrf_ru (IndexNow public key + legacy
WP plugin code) — добавлен .gitleaks.toml с allowlist:
- public/<32hex>.txt + корневой <32hex>.txt (IndexNow validation files)
- wp-content/** (legacy WordPress plugin code, не настоящие секреты)
- const KEY = '<32hex>' паттерн

Hadolint DL4006: добавлен SHELL pipefail в начале каждой stage.

npm audit: убран из Dockerfile (там кэшировался Docker layer'ом и
по факту не запускался при unchanged package-lock.json). Вынесен в
.gitea/workflows/security.yml как отдельный job — каждый push, реально.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dmitry Gusev
2026-05-24 18:54:10 +03:00
parent 4a8715766e
commit a3ac273b90
3 changed files with 52 additions and 3 deletions

35
.gitleaks.toml Normal file
View File

@@ -0,0 +1,35 @@
# GitLeaks config для сателлитных сайтов hhivp.
# Extends default rules and adds allowlist for known false-positives.
# https://github.com/gitleaks/gitleaks#configuration
[extend]
useDefault = true
[allowlist]
description = "Allowlist for IndexNow public keys + legacy WP plugin code"
# Пути, которые целиком игнорируем
paths = [
# IndexNow validation file (32-hex .txt в корне или в public/).
# Это публичный ключ, по дизайну отдаётся всем — НЕ секрет.
'''public/[a-f0-9]{32}\.txt''',
'''^[a-f0-9]{32}\.txt$''',
# Legacy WordPress plugin code (akismet, jetpack, wpforms-lite, wp-cache).
# Все "ключи" внутри — placeholder/template/internal параметры,
# не настоящие секреты. Импортировано из старого WP-сайта как static.
'''wp-content/.*''',
# Минифицированные ассеты — часто содержат hash'и/токены, не секреты.
'''.*\.min\.(js|css)$''',
'''dist/.*''',
'''build/.*''',
]
# Конкретные паттерны, которые false-positive
regexes = [
# Наш scripts/indexnow.js: const KEY = '<32-hex>' — IndexNow public key.
'''const\s+KEY\s*=\s*['"][a-f0-9]{32}['"]''',
# Аналог для других форм объявления того же ключа.
'''KEY\s*[:=]\s*['"][a-f0-9]{32}['"]''',
]