Documentation Index
Fetch the complete documentation index at: https://docs.knoxcall.com/llms.txt
Use this file to discover all available pages before exploring further.
Agent database proxy protocols
The KnoxCall agent’s database proxy binds one TCP listener per configured route on127.0.0.1. Applications connect as if they’re connecting to the database directly. The agent handles authentication upstream and pipes the connection through.
This page covers the wire-level details for each supported protocol.
General architecture
Local-only binding guarantee
For container deployments, run the agent in the same network namespace as the application (sidecar pattern). The127.0.0.1 binding then scopes to the shared namespace.
Peer attestation
On Linux, the agent checksSO_PEERCRED on every new connection to retrieve the connecting process’s UID. If a UID allowlist is configured on the route and the connecting UID is not in the list, the connection is refused immediately before any bytes are read.
On Windows, named pipes with an explicit ACL replace SO_PEERCRED. The behaviour is equivalent.
If no UID allowlist is configured, any process on localhost can connect. Configure a UID allowlist in production environments where multiple users share the same host.
PostgreSQL
Auth method: ScramSHA-256- Agent receives the client’s startup packet (protocol 3.0)
- Agent stores the requested database name and user field from the startup packet
- Agent opens TLS to the upstream PostgreSQL server
- Agent performs a full ScramSHA-256 handshake with the upstream server using KnoxCall credentials
- After
AuthenticationOk, agent sendsReadyForQueryback to the application - From this point, agent pipes bytes bidirectionally — no further inspection
PasswordMessage is never forwarded — the agent substitutes its own credentials.
TLS modes:
| Mode | Description |
|---|---|
require | Strict TLS — upstream cert validated against system CA bundle + any custom CAs in KnoxCall |
prefer (default) | Try TLS first; fall back to plain TCP if the upstream doesn’t support it. Cert not validated. |
disable | Plain TCP — no TLS to upstream |
MySQL
Auth method:CLIENT_PLUGIN_AUTH with caching_sha2_password or mysql_native_password
- Agent receives the client’s connection request (no auth info — MySQL initiates auth from server side)
- Agent opens TLS to upstream MySQL
- Agent responds to the server’s auth challenge using KnoxCall credentials
- After server sends
OK_Packet, agent pipes bidirectionally
CLIENT_SSL with the upstream server regardless of the application-to-agent TLS setting. The application always connects to 127.0.0.1 unencrypted; the agent always connects to upstream encrypted.
MongoDB
Auth method: SCRAM-SHA-256 viaOP_MSG
- Agent receives the client’s
isMaster/hellocommand - Agent opens TLS to upstream MongoDB
- Agent performs SASL SCRAM-SHA-256 authentication using KnoxCall credentials
- After auth succeeds, agent pipes all subsequent
OP_MSGframes bidirectionally
mongodb://127.0.0.1:{port}/{dbname} — no username or password in the URI.
For MongoDB Atlas clusters, the upstream address is the SRV hostname. The agent resolves SRV records and connects to the primary.
Redis
Auth method:AUTH command injection
- Agent accepts the TCP connection from the application
- Agent opens TLS to upstream Redis
- Before forwarding any application commands, agent sends
AUTH username password(Redis 6+ ACL) orAUTH password(Redis 5 and below) using KnoxCall credentials - After
+OK, agent pipes all subsequent RESP frames bidirectionally
AUTH command — the agent has already authenticated. If the application sends an AUTH command, the agent intercepts it and returns +OK without forwarding (to prevent auth token leakage).
For Redis Cluster, the agent connects to one seed node and supports MOVED / ASK redirects transparently.
TLS to upstream
The agent always connects to the upstream database over TLS, regardless of how the application connects to the agent. Certificate validation behaviour:- strict (default): certificate chain validated against the system CA bundle plus any custom CAs stored in KnoxCall PKI
- skip_verify: validation disabled — only use for local development databases with self-signed certificates
- mtls: agent presents a client certificate (stored as a KnoxCall certificate secret) during the TLS handshake
Telemetry
The agent emitsmigration.db_proxy_probe telemetry events to KnoxCall during the verification window. Each probe reports whether the upstream database is still being reached through the legacy credentials:
event_type | Probe type values | outcome values |
|---|---|---|
migration.db_proxy_probe | dns_probe, tls_probe, connection_attempt, no_traffic_window | still_reachable, nxdomain, connection_refused, tls_error, clean, unknown |
Bucket B: Database migration
Setting up DB proxy routes for a migration
Migration verification
Probe results and safe-to-delete confirmation
KnoxCall agent
Agent installation and configuration
Certificate Authority
Store client certs for mTLS upstream connections