Post-quantum cryptography workspace for messaging, files, WebAssembly, desktop, and database security.
A zero-trust, wire-protocol database cryptographic gateway for PostgreSQL. It transparently intercepts query response streams to decrypt and mask encrypted database fields on-the-fly, allowing off-the-shelf BI tools (DBeaver, PowerBI, Tableau) and application clients to access encrypted data securely without modifying database engine logic.
db-proxy works in conjunction with @vollcrypt/db-guard to enforce field-level security, role-based access control (RBAC), and decryption rate limits at the network layer.
npm install @vollcrypt/db-proxy
DataRow packets without parsing or modifying complex SQL command dialects.SSLRequest frames by responding with standard protocol fallback indicators, forcing clients to establish unencrypted TCP connections to the local proxy. This eliminates local certificate management overhead.WHERE tenant_id = 'org_xxx') into SQL statements executed by tenant-scoped database users.avg, sum, or count) to prevent inference attacks.logs/siem.cef.RowDescription packets) to match column tags against RBAC permissions.42501 - Insufficient Privilege) when an unauthorized client requests columns they are not permitted to decrypt or performs forbidden SQL commands.graph TD
classDef client fill:#f0db4f,stroke:#333,stroke-width:1px,color:#333;
classDef proxy fill:#8A2BE2,stroke:#333,stroke-width:1px,color:#fff;
classDef db fill:#df5c3f,stroke:#333,stroke-width:1px,color:#fff;
client_app["BI Tool / SQL Client<br>(DBeaver, PowerBI, pg)"]:::client
db_proxy["Vollcrypt DB-Proxy<br>(TCP Interceptor Port 54320)"]:::proxy
postgres_db["PostgreSQL Server<br>(Port 5432)"]:::db
kms_service["KMS Key Provider / HSM"]:::proxy
subgraph WAF ["1. Database WAF Block"]
check_sqli["SQLi Scan"]
check_ddl["DDL Permission Control"]
end
subgraph DLP ["2. Response Inspection Block"]
check_crypt["Decryption Parser (VOLLVALT)"]
check_pii["DLP PII Scan (CC, Email, ID, IBAN)"]
end
client_app -- "1. Send Query" --> db_proxy
db_proxy --> WAF
WAF -- "Violation? Yes" --> client_app
WAF -- "Violation? No" --> postgres_db
postgres_db -- "2. Return DataRows" --> db_proxy
db_proxy --> DLP
DLP -- "3. Decrypt / Mask cells" --> client_app
Start the proxy server using the built-in CLI:
vollcrypt-db-proxy --port 54320 --db-host 127.0.0.1 --db-port 5432 --config config.json
The proxy is configured via a JSON configuration file (config.json). This file defines the database username-to-role mappings, RBAC permissions, masking filters, decryption keys, and security rate limits.
config.json):{
"key": "0101010101010101010101010101010101010101010101010101010101010101",
"users": {
"postgres": { "role": "OWNER", "userId": "usr-admin" },
"analyst_hr": { "role": "HR_ADMIN", "userId": "usr-hr-01" },
"analyst_marketing": { "role": "MARKETING", "userId": "usr-mkt-01" }
},
"cryptoRbac": {
"roles": {
"OWNER": {
"decrypt": ["users.email", "users.tc_no", "users.credit_card"]
},
"HR_ADMIN": {
"decrypt": ["users.email", "users.tc_no"],
"mask": {
"users.credit_card": "credit_card"
}
},
"MARKETING": {
"decrypt": ["users.email"],
"mask": {
"users.tc_no": "tc_no",
"users.credit_card": "credit_card"
}
}
}
},
"rateLimiter": {
"maxDecryptionsPerSecond": 100,
"mode": "fail_closed"
},
"firewall": {
"ipBanning": {
"enabled": true
}
}
}
When deploying multiple proxy nodes, configuring hybrid startups, or securing the cryptographic boundaries, the proxy accepts the following parameters:
minResponseTimeMs: The target constant round-trip duration (in ms) for query executions and WAF block events to mitigate timing attack side-channels. Defaults to 15 ms.gossipPort: TCP port used for clustering peer-to-peer state synchronization and IP bans gossip.peers: An array of peer address strings (host:port) representing nodes in the consensus cluster.--interactive / -i: Direct launch of the interactive feature configuration menu.--non-interactive / -y / --yes / -n: Bypass the hybrid countdown startup sequence to launch instantly.--fips / --no-fips: Require an already active Node.js/OpenSSL FIPS mode and fail startup otherwise. This option does not certify the package as FIPS validated.--jit / --no-jit: Toggle Just-In-Time access approval webhook checking for restricted column queries.--anomaly / --no-anomaly: Toggle real-time AI Semantic Anomaly Engine threat checking.--db-type <type>: Target database protocol driver. Options are postgres, mysql, or mongodb. Defaults to postgres.When a SQL client connects to the proxy, the proxy parses the connection parameters:
analyst_hr maps to the HR_ADMIN role, or tenant_user maps to a specific tenantId).' OR 1=1), the query is aborted.DROP TABLE) are run by a non-OWNER role, the query is aborted.WHERE tenant_id = 'org_xxx') to isolate database records at the proxy layer.credit_card with 'XXXX-XXXX-XXXX-' || right(credit_card, 4)) before transmission to the database.logs/siem.cef.VOLLVALT: is scanned.
42501 - Insufficient Privilege) back to the client.avg, sum, or count) are subjected to Differential Privacy checks, which inject mathematically calibrated Laplace noise to safeguard against statistical inference attacks.VOLLVALT: prefix) are scanned by the DLP engine. If a cell matches Credit Cards, Emails, National IDs, or IBAN formats, it is dynamically masked before transmission.ANOMALY_DETECTED security log is written in CEF format, and the proxy injects a 50ms per-row delay to restrict bulk database scraping.Navigate to the db-proxy folder and build the package:
cd db-proxy
npm install
npm run build
Run the integration tests:
npm test
Implement custom hybrid mTLS handshakes (Ed25519 + ML-DSA-65) for client-to-proxy certificate authentication, cryptographically preventing unauthorized machines from establishing TCP connections to the gateway.
Multiplex client connections into a persistent backend pool to reduce database connection allocation costs, and cache KMS key handshakes locally in memory within the secure cache wrapper.
db-proxy is dual-licensed under:
For licensing details or commercial purchases, please contact berat.vural.tr@gmail.com.