Security: no automated grep or test fixture confirms indexer logs avoid secrets [SEC-F13] #433
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#433
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
indexer/src/main.rsemits fourtracing::info!calls at startup (lines 108-115):run_mode,lcd_urls,factory_address, and rate limit values. Thedatabase_url(apostgres://user:password@host/dbconnection string) is consumed only bysqlx::PgPoolOptions::connectat line 119 and is not logged. Grep across allindexer/src/files finds notracing::info!call emittingdatabase_url,password,mnemonic,bearer,private_key, orsecret. However, no Makefile target, CI step, or test fixture enforces this automatically. No ongoing check prevents a future change from accidentally introducing a secret log line.What Was Checked
indexer/src/main.rslines 108-115: four startup log calls. Values logged:config.run_mode,config.lcd_urls,config.factory_address,config.rate_limit_rps,config.rate_limit_lcd_heavy_rps. None of these are secrets.indexer/src/main.rsline 119:connect(&config.database_url)-- DATABASE_URL used for connection but not logged.indexer/src/fordatabase_url,password,mnemonic,bearer,private_key,secretinside anytracing::call: zero matches. Confirmed by grep with no output.lint-log-secretstarget or equivalent CI step found. Grep for "DATABASE_URL" in Makefile returned no output.Expected (per checklist)
A grep/static review must be documented (in Makefile, CI config, or runbook) confirming no secret patterns appear in log call arguments. Where feasible, a test fixture initializes the indexer with a test DATABASE_URL and captures log output, asserting the password component is absent.
Actual
The current source does not log secrets. This was confirmed by manual grep during this audit session. There is no automated check or test fixture to enforce this going forward. If a future change adds a
tracing::info!("{}", config.database_url)line, no CI job will catch it.Evidence
indexer/src/main.rslines 108-115: logged fields arerun_mode,lcd_urls,factory_address,rate_limit_rps,rate_limit_lcd_heavy_rps-- no secretsindexer/src/main.rsline 119:config.database_urlused inconnect()only, not loggedindexer/src/for secret-pattern log calls: zero matcheslint-log-secretsor secret-scanning target foundSuggested Fix
Add a
make lint-log-secretsMakefile target that grepsindexer/src/for patterns such asdatabase_url,password,mnemonic,bearer,private_keyinsidetracing::macro arguments, and exits nonzero if any match is found. Optionally add a test inindexer/tests/security.rsthat initializes a config with a DATABASE_URL containing a dummy password string and asserts the tracing output does not contain that password.Verification Checklist
Labels
security,pre-launchCc: @PlasticDigits
mentioned in issue #381
mentioned in merge request !961
Took this one — current state is clean, and I added the automated guard the checklist asks for (MR !961).
Verified current state two ways:
The guard (MR !961):
Covers the checklist's first item (a make/CI target that greps indexer source for secret-pattern log calls and exits nonzero on match). Good to close from my side once !961 merges. @PlasticDigits
mentioned in merge request !962
mentioned in merge request !964
mentioned in commit
6fda72dc41mentioned in commit
5448d21404mentioned in commit
131058d111mentioned in commit
2a06048bc6Verification — #433 (SEC-F13)
Verified on
main@2a06048b(MR !961 merged). All checklist items PASS. Issue closed.Checklist
make lint-log-secrets→OK: no secret-bearing values…;make lint-indexer-log-secrets→OK: no secret-pattern fields…. Both wired intomake lint. CI joblint-indexer-log-secretsin.gitlab-ci.ymlrunsscripts/lint-indexer-log-secrets.shon default branch and MRs touchingindexer/**.cargo test --lib startup::tests— 2/2 passed (startup_logs_do_not_contain_database_password,startup_logs_do_not_contain_reorg_webhook_url).docs/operator-secrets.md§ Logs documentsmake lint-indexer-log-secrets, unit tests instartup.rs, and CI job. Cross-linked fromdocs/indexer-invariants.mdandskills/AGENTS_INDEXER_API_LCD_SECURITY.md.Additional checks
indexer/src/startup.rslogs onlyrun_mode,lcd_urls,factory_address, rate limits;database_urlused atconnect()only (main.rs). Manualrgacrossindexer/src/for secret patterns insidetracing::macros: zero matches.tracing::info!("{}", config.database_url)→make lint-log-secretsequivalent exits 1 with file:line finding.Commands run
mentioned in issue #337
mentioned in issue #594