Harden internet-facing indexer production checklist and CORS bind guard (#326) #499
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega!499
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-326-public-bind-cors-guard"
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
Implements GitLab #326 (parent #325 audit F-04): hardens internet-facing indexer deploy guidance and adds a startup guard when
LISTEN_ADDRis non-loopback withoutINDEXER_PRODUCTION.indexer/README.md(internet-facing section) with cross-links fromdocs/operations/deployment-guide.mdanddocs/indexer/design.md.warn_public_bind_without_productionlogs a high-visibilitytracing::warn!naming permissive CORS risk and pointing to the checklist (INV-INDEXER-326-PUBLIC-BIND-CORS)..env.example— prominent note that publicLISTEN_ADDRrequires production mode +CORS_ALLOWED_ORIGINS.public_bind_guard_testsinindexer/src/config.rs.Local Anvil stacks unchanged: default
127.0.0.1:3100withoutINDEXER_PRODUCTIONkeeps permissive CORS; existingINV-INDEXER-142/INV-INDEXER-156behavior preserved.Acceptance checklist
grep -n 'internet-facing-indexer-gitlab-326' indexer/README.md docs/operations/deployment-guide.mdLISTEN_ADDR=0.0.0.0:3100 INGESTION_ENABLED=0 … timeout 5 cargo run→ log containsLISTEN_ADDR is not loopbackLISTEN_ADDR=127.0.0.1:3100; unit testswarn_skipped_on_loopback_without_productionINDEXER_PRODUCTION=1+:password@URL → config exit;cargo test cors_config production_database_urlcd indexer && cargo test public_bind_guardcd indexer && cargo clippy --all-targets -- -D warnings && cargo testcd indexer && cargo test --test integration_stage2bash scripts/check-doc-anchors.shbash scripts/verify-cloud-postgres.shThird-party verification
issue-326-public-bind-cors-guard.cd indexer && cargo clippy --all-targets -- -D warnings && cargo test.:5433, run: Expect one WARN line referencing F-04 / production checklist.INDEXER_PRODUCTION=1+DATABASE_URLcontaining:password@still fails at config load (INV-INDEXER-142).indexer/README.md#internet-facing-indexer-gitlab-326anddocs/testing/invariants-and-business-logic.md#indexer-public-bind-cors-guard-gitlab-326.Related: #326 · parent #325
Security review — MR !499
Commit reviewed:
3081af1175af635703b8cbd5cbc4a85a098a9690Scope: Documentation and operator-checklist hardening for internet-facing indexer deploys (GitLab #326 / audit F-04); startup
warn_public_bind_without_productionguard inindexer/src/config.rs+main.rs;.env.example/ README / deployment-guide cross-links; unit tests inpublic_bind_guard_tests.Method: Diff review of all 7 changed files; traced
LISTEN_ADDRparsing →warn_public_bind_without_production→cors_config::cors_layer_for_runtime(); verified no new attacker-controlled sinks (SQL, shell, SSRF, deserialization); confirmed CORS/runtime behavior unchanged for loopback local stacks and existingINDEXER_PRODUCTIONfail-closed paths (INV-INDEXER-142,INV-INDEXER-156, production CORS allowlist).Outcome:
FINDINGS: 0medium+Security review: no medium+ findings on this diff.
The MR adds observability and operator guidance only. Permissive CORS when
INDEXER_PRODUCTIONis unset on a non-loopback bind is pre-existing runtime behavior (not introduced here); the new guard correctly warns viaaddr.ip().is_loopback()without weakening existing production gates. No injection, authz bypass, secret leakage, or EVM/contract surface in this change set.Inline threads: none (no medium+ findings).
mentioned in commit
2d0251d297