Cloud Agent: Postgres bootstrap for indexer integration tests (#335) #818
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!818
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cursor/gitlab-issue-workflow-e267"
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
Closes infrastructure gap from MR !809 / #324: Cloud Agent VMs can provision Postgres +
indexer/.envand run indexer integration tests withoutbuild-optimizedordeploy-dex-local.Issue: https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/work_items/335
Changes
make setup-indexer-postgres/scripts/setup-cloud-agent-indexer-postgres.shscripts/lib/postgres-psql.sh— compose exec fallback when host psql missingmake test-indexer-integration,make verify-issue-324,--postgres-onlyon cloud localterra scriptAcceptance checklist
make setup-indexer-postgrescd indexer && cargo test --test api_route_solve -- --test-threads=1make test-indexer-integrationindexer_ingestion_hardening(same on origin/main)make test-setup-postgresmake verify-issue-324Verification
changed the description
changed the description
changed the description
changed the description
mentioned in issue #335
Stale Security Review comment
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit
ebb64ecb25. Configure here.Makefile PATH not applied
Medium Severity
The
test-indexer-integrationrecipe putsexport PATH=…on its own line beforecargo test. GNU Make runs each recipe line in a separate shell, so the Cargo path prefix never applies to the test command. Cloud Agent flows that rely on/usr/local/cargo/bincan hit the wrong or missingcargowhen using this target.Reviewed by Cursor Bugbot for commit
ebb64ecb25. Configure here.Security review
Commit reviewed:
ebb64ecb25e8a8f54339dfb9de9a62079b1125acScope: Full MR diff vs
main(227 files) — Postgres bootstrap (#335), indexer hybrid route solver / DB mirror, trading blacklist (#308), factory/pair/router contract changes, frontend trading UX, Cloud Agent setup scripts, CI artifact publishing.Outcome:
FINDINGS: 0medium+Security review: no medium+ findings on this diff.
Summary
Reviewed attacker-controlled inputs through sinks (SQL, LCD proxy, on-chain guards, frontend blacklist gating, dev bootstrap scripts). No exploitable injection, authz bypass, secret leakage, SSRF/XSS, or permission-boundary mistakes were identified in added or modified code.
Notable security-positive changes (no action required)
verify_factory_provenanceblocks indexing unregistered pair contracts; prod rejects emptyFACTORY_ADDRESS.PeerIpKeyExtractorignores spoofableX-Forwarded-For.simulate_swap_operations.lcd_gateway_err; newcompliance::blacklist_checkuses genericinternal_err(no upstream echo).QueryBuilder(push_bind); no string-concatenated user input in queries.127.0.0.1:5432); role bootstrap escapes passwords; compose-exec fallback is dev-tooling only.execute_blacklist_*; pair/router guards enforce at execution. Intentional fail-open when legacy factory lacksBlacklistCheckis a documented migration path, not a new bypass once factory 1.5.0 is live.blocked === true(fail-open on query error); on-chain enforcement remains authoritative for signed txs.Inline threads
None — no medium+ findings to anchor.
Automated security review (Cursor Cloud Agent).
changed this line in version 2 of the diff
added 1 commit
eb651373- Fix test-indexer-integration PATH export in single shellCompare with previous version
changed the description
changed the description
resolved all threads
Security review
Commit reviewed:
eb6513736c309fa759566f25a354605ed4028b81Scope: MR !818 diff vs
main(14 files) — Postgres-only Cloud Agent bootstrap (#335):setup-indexer-postgres,postgres-psql.shcompose-exec fallback, Makefile test targets, docs, andapi_route_solvetier-cache test fix.Outcome:
FINDINGS: 0medium+Security review: no medium+ findings on this diff.
Summary
Reviewed attacker-controlled inputs through sinks (SQL via
postgres_psql/ bootstrap helpers, shelldocker composeinvocation,indexer/.envwrites, Makefile targets). No exploitable injection, authz bypass, secret leakage, SSRF/XSS, or permission-boundary mistakes were identified in added or modified code.Notes (informational, no action required)
127.0.0.1:5432; scripts provision local compose Postgres and write devindexer/.envcredentials — not production runtime.scripts/lib/postgres-dev.env/ repo.env(developer-controlled); password escaping forCREATE ROLEis unchanged from pre-MR bootstrap logic.cloud_agent_docker_compose/postgres_docker_composepass args viaprintf '%q 'insidesg docker -c, reducing injection risk.route_solve_get_with_trader_returns_higher_estimateseeds tier 5 to avoid cache-key collision (#283); test-only, no production impact.Inline threads
None — no medium+ findings to anchor.
Automated security review (Cursor Cloud Agent).
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issues.
Reviewed by Cursor Bugbot for commit
eb6513736c. Configure here.Init failure skips env sync
Low Severity
postgres_psql_initruns underset -ewith no fallback. If hostpsqlis missing and the composepostgresservice is not ready yet (common right aftermake start), the script exits beforesync_indexer_database_env, unlike bootstrap failures which still syncindexer/.env.Reviewed by Cursor Bugbot for commit
eb6513736c. Configure here.Postgres-only path ignores fresh
Low Severity
When
--postgres-onlyis set, the scriptexecs intosetup-cloud-agent-indexer-postgres.shbefore any--freshhandling. A combined--postgres-only --freshstill parses--freshbut never runs volume reset, so stale Postgres data can remain despite the flag.Reviewed by Cursor Bugbot for commit
eb6513736c. Configure here.changed this line in version 3 of the diff
added 1 commit
b4b854c0- fix: honor --fresh on postgres-only path and sync env on psql init failureCompare with previous version
changed the description
resolved all threads
resolved all threads
Security review
Commit reviewed:
b4b854c063fc1d44f2b6a5ac90f432357a15a3e0Scope: MR !818 diff vs
main(14 files) — Postgres-only Cloud Agent bootstrap (#335), latest delta:--postgres-only --freshvolume reset + env sync onpostgres_psql_initfailure.Outcome:
FINDINGS: 0medium+Security review: no medium+ findings on this diff.
Summary
Re-reviewed attacker-controlled inputs through sinks (SQL via
postgres_psql/ bootstrap helpers, shelldocker composeinvocation,indexer/.envwrites, Makefile targets). No exploitable injection, authz bypass, secret leakage, SSRF/XSS, or permission-boundary mistakes were identified in added or modified code.Latest commit (
b4b854c) — no new attack surface--freshon postgres-only path: Runs localmake resetbefore delegating to the Postgres bootstrap script. Requires VM/shell access; dev-only volume wipe, not a remote boundary change.postgres_psql_initfailure handling: Syncsindexer/.envthen exits non-zero. Reliability/misconfiguration guard; does not expose credentials beyond existing dev-script stdout or broaden network reach.Prior review notes (still hold)
127.0.0.1:5432; scripts provision local compose Postgres and write devindexer/.envcredentials — not production runtime.scripts/lib/postgres-dev.env/ repo.env(developer-controlled); password escaping forCREATE ROLEis unchanged from pre-MR bootstrap logic.cloud_agent_docker_compose/postgres_docker_composepass args viaprintf '%q 'insidesg docker -c, reducing injection risk.route_solve_get_with_trader_returns_higher_estimateseeds tier 5 to avoid cache-key collision (#283); test-only, no production impact.Inline threads
None — no medium+ findings to anchor.
Automated security review (Cursor Cloud Agent).
mentioned in commit
a4127b646cmentioned in merge request !823
mentioned in commit
c0baf17f46mentioned in commit
d50d39a3ed