Security Configuration Guide
Minimum actions to keep blockchain-services safe in production.
Keys and secrets
JWT signing keys live outside the repo. Mount them at
/app/config/keysand pointPRIVATE_KEY_PATH/PUBLIC_KEY_PATH(defaults already target that folder). Usechmod 400/444on POSIX systems.KeyServicevalidates key existence and warns on permissive permissions during startup.Marketplace tokens are verified with an RSA public key pulled from
marketplace.public-key-url(HTTPS). Keep the endpoint controlled/trusted and monitor fetch errors.Never commit the institutional private key;
.envis gitignored, prefer a secrets manager forINSTITUTIONAL_WALLET_*and RPC URLs.
Institutional wallet handling
Wallets are encrypted with AES-256-GCM + PBKDF2 (65,536 iterations) and stored in
./data/wallets.json.The wallet password in
wallet-config.propertiesis encrypted withwallet.config.encryption-key; the service can auto-generate and persist the key to/app/data/.wallet-encryption-keyif none is provided. Persist/app/datain Docker so restarts can decrypt the wallet.Sensitive endpoints are behind
LocalhostOnlyFilter:/wallet,/treasury,/treasury/admin/notifications,/wallet-dashboard,/institution-config, and/onboarding/token./onboarding/token/**is currently reserved in security filters/CORS; there is no public controller endpoint in this repository version.Keep
security.allow-private-networks=falseunless you run behind a trusted private network and enforce a strongsecurity.access-token./wallet/revealexists for break-glass scenarios; leave it reachable only from loopback./treasury/admin/**requires a valid access token whensecurity.access-token.required=true(default).
Authentication hardening
Wallet auth: 5-minute timestamp window + anti-replay cache (enable disk persistence with
antireplay.persistence.enabled=trueand setantireplay.persistence.file.path).SAML: signature validation is mandatory and auto-discovers IdP metadata (
saml.idp.trust-mode,saml.trusted.idp.*). Booking paths require scopebooking:read(configurable viaauth.saml.required-booking-scope).Marketplace JWTs: signature checked against the cached RSA key; failures short-circuit the flow.
RPC and contract settings
Provide RPC URLs through env vars (
ETHEREUM_MAINNET_RPC_URL,ETHEREUM_SEPOLIA_RPC_URL) instead of hardcoding API keys.Set
CONTRACT_ADDRESSfor the target Diamond deployment; leaveBASE_DOMAINunset when running behind the Lab Gateway so issuer URLs are derived automatically.
Pre-deployment checklist
Last updated