SEC-F13: automated guard for indexer log secret leakage (#433) #962
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!962
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-433-indexer-log-secrets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
GitLab #433 (SEC-F13): the indexer already avoided logging
DATABASE_URLand other secrets at startup, but nothing in CI or tests enforced that invariant. This MR adds:indexer/src/startup.rs— extracted safe startup INFO logging (run_mode, LCD URLs, factory, rate limits only)scripts/lint-indexer-log-secrets.sh+make lint-indexer-log-secrets— ripgrep guard for secret field names insidetracing::macro argumentsstartup::tests) — capture tracing output with a dummy DATABASE_URL password and assert it never appearslint-indexer-log-secretsjob in the security stage (default branch + indexer-touching MRs)operator-secrets.md,indexer-invariants.md,testing.md,AGENTS_INDEXER_API_LCD_SECURITY.mdAcceptance checklist
make lint-indexer-log-secretscd indexer && cargo test --lib startup::testsdocs/operator-secrets.md§ Logs + cross-links.gitlab-ci.ymllint-indexer-log-secretscd indexer && cargo buildThird-party verification
Confirm startup logs on a running indexer show
RUN_MODE, LCD URLs, factory, and rate limits — not a postgres connection string.Blockers
None.
Security review — MR !962
Commit reviewed:
9a9bf50de7cbb4be4ea0972013b21deba00bc397Scope: SEC-F13 automated guard for indexer log secret leakage (#433) —
indexer/src/startup.rs,scripts/lint-indexer-log-secrets.sh, CI joblint-indexer-log-secrets, unit tests, docs/Makefile wiring.Method: Diff review; traced startup logging and config fields to sinks; verified lint coverage and bypass classes (multiline
tracing::args,{:?}onConfig, non-tracing::sinks); checkedreorg_alertwebhook paths; confirmedtracing-testis dev-only; ranmake lint-indexer-log-secretsandcargo test --lib startup::tests.Outcome:
FINDINGS: 0medium+Summary: This MR is defensive hardening only.
log_startup_configlogs the same non-secret fields thatmain.rspreviously emitted at INFO (run_mode,lcd_urls,factory_address, rate limits) and does not referencedatabase_url,reorg_alert_webhook_url, or other secret-bearingConfigfields. Unit tests capture tracing output with dummy credentials and assert absence. No new attacker-controlled input paths, authz changes, injection surfaces, or runtime secret exposure were introduced. The ripgrep guard is line-scoped (multiline macro args / whole-ConfigDebug would evade it) — noted as a control limitation, not rated medium+ because exploitation requires a merged code change and does not widen external attack surface beyond pre-MR behavior.Prior threads: No prior security-review notes on this MR; nothing to re-report.
Inline findings: None.
added 5 commits
main5448d214- Merge origin/main into issue-433-indexer-log-secretsCompare with previous version
Resolved merge conflict with
main(single file:Makefile).Conflict: both branches added SEC-F13 log-secret guards to the aggregate
linttarget — this MR addslint-indexer-log-secrets(ripgrep + CI job + startup unit tests);mainalready mergedlint-log-secrets(scripts/check_indexer_log_secrets.py).Resolution: kept both targets in
make lintso the ripgrep guard, Python AST guard, and startup tracing tests all run.Sanity checks:
make lint-indexer-log-secrets,make lint-log-secrets,cargo test --lib startup::tests— all pass.Security review — MR !962
Commit reviewed:
5448d214040cdad7f0a42fc859fce309f18e28dfScope: SEC-F13 automated guard for indexer log secret leakage (#433) —
indexer/src/startup.rs,scripts/lint-indexer-log-secrets.sh, CI joblint-indexer-log-secrets, unit tests (tracing-test), docs/Makefile wiring; post-merge withmainalso retainslint-log-secrets(scripts/check_indexer_log_secrets.py).Method: Diff review on all 12 changed files; traced
Configsecret fields (database_url,reorg_alert_webhook_url) to startup logging sink; verifiedreorg_alert.rswebhook delivery does not log URL (unchanged); checked ripgrep guard vs Python AST guard bypass classes (multiline args,println!/dbg!, whole-Config{:?}); confirmedtracing-testis[dev-dependencies]only; ranmake lint-indexer-log-secrets,make lint-log-secrets, andcargo test --lib startup::tests.Outcome:
FINDINGS: 0medium+Summary: This MR is defensive hardening only.
log_startup_configemits the same non-secret INFO fields previously inlined inmain.rs(run_mode,lcd_urls,factory_address, rate limits) and does not reference secret-bearingConfigfields. Unit tests capture tracing output with dummy credentials and assert absence. No new attacker-controlled input paths, authn/authz changes, injection surfaces, SSRF/XSS/deserialization risks, or runtime secret exposure were introduced. The ripgrep CI guard is line-scoped and complements the existing Python AST checker onmain(both pass locally); gaps such as multiline macro args or non-tracing::sinks are control-limitation notes, not exploitable vulnerabilities in this diff because exploitation requires a future merged logging change and does not widen external attack surface beyond pre-MR behavior.Prior threads: Re-reviewed prior security note on
9a9bf50; findings still do not apply after merge-conflict resolution withmain(Makefile keeps both lint targets). No medium+ items to re-report.Inline findings: None.
mentioned in commit
2a06048bc6