Skip to content

Conversation

@TaprootFreak
Copy link
Contributor

@TaprootFreak TaprootFreak commented Jan 24, 2026

Summary

  • Add new endpoint POST /support/debug/boltz for querying Boltz PostgreSQL database
  • Same security mechanisms as existing MSSQL debug endpoint (SQL AST parsing, column blocking)
  • Add boltz-debug.sh shell script for CLI access

Changes

  • Add pg dependency for PostgreSQL connection
  • New endpoint with DEBUG role authentication
  • Blocked sensitive columns: referrals.apiKey/apiSecret, keyproviders.privateKey, *.preimage
  • Blocked system schemas: pg_catalog, information_schema, pg_toast

Configuration

Requires new environment variables in Azure:

BOLTZ_PG_HOST=postgres.boltz.internal
BOLTZ_PG_PORT=5432
BOLTZ_PG_DATABASE=boltz
BOLTZ_PG_USER=readonly
BOLTZ_PG_PASSWORD=***

After merge: Configure BOLTZ_PG_* environment variables in Azure App Service.

Usage

./scripts/boltz-debug.sh "SELECT * FROM swaps LIMIT 10"
./scripts/boltz-debug.sh "SELECT * FROM chainswaps WHERE pair = 'USDT_ETH/JUSD_CITREA'"

Test plan

  • Configure BOLTZ_PG_* environment variables in Azure
  • Test endpoint with DEBUG role wallet
  • Verify blocked columns are masked
  • Verify blocked schemas are rejected

- Add new endpoint POST /support/debug/boltz for querying Boltz PostgreSQL
- Same security as MSSQL debug endpoint (SQL AST parsing, column blocking)
- Blocked columns: referrals.apiKey/apiSecret, keyproviders.privateKey, *.preimage
- Blocked schemas: pg_catalog, information_schema, pg_toast
- Add boltz-debug.sh shell script for CLI access
- Add pg dependency for PostgreSQL connection
- Requires BOLTZ_PG_* environment variables for configuration
- Remove non-existent keyproviders table (actual table is 'keys' with no sensitive data)
- Add dblink functions to blocked list (external DB connections)
PostgreSQL tables reverseSwaps and chainSwaps require double
quotes due to camelCase naming. Updated script help text with
correct quoting examples and clarified config comment.
- Block minerFeeInvoicePreimage in reverseSwaps table
- Block pg_sleep function to prevent DoS attacks
@TaprootFreak TaprootFreak marked this pull request as ready for review January 24, 2026 07:27
@TaprootFreak TaprootFreak merged commit aff45b6 into develop Jan 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants