- Server-Side TLS: Secures incoming connections to TrustGate.
- Client-Side TLS: Secures outgoing connections from TrustGate to upstream services.
Server-Side TLS
Server-side TLS is configured using environment variables. This configuration secures incoming connections to the TrustGate proxy server. TLS settings are loaded once at proxy startup.Environment Variables Configuration
Add the following variables to your.env file:
Configuration Parameters
- disabled: Set to
trueto disable TLS entirely. - enable_mtls: Enables mutual TLS (mTLS) to require client certificates for authentication.
- disable_system_ca_pool: If
true, disables the system certificate authority (CA) pool. - ca_cert: Absolute path to the CA certificate file used to verify client certificates.
- keys.public_key: Absolute path to the server’s public certificate file.
- keys.private_key: Absolute path to the server’s private key file.
- cipher_suites: List of cipher suite IDs supported (e.g.,
4865corresponds toTLS_AES_128_GCM_SHA256). - curve_preferences: List of elliptic curve IDs used for ECDHE key exchange (e.g.,
23=secp256r1). - min_version: Minimum supported TLS version (
TLS12orTLS13). - max_version: Maximum supported TLS version (
TLS12or `TLS13_
Note: All certificate and key paths must be absolute. Place certificates and keys in the certs/ directory within your deployment.
Client-Side TLS
Client-side TLS settings in TrustGate are host-specific, allowing you to define distinct TLS configurations for each upstream host. This provides flexibility to tailor certificates, cipher suites, and security parameters based on individual service requirements. In theclient_tls section of the gateway configuration, each entry is keyed by the upstream host name (e.g., localhost). This allows different upstream services to have their own:
- CA certificates
- Client certificates and private keys (for mutual TLS)
- Cipher suites
- Curve preferences
- TLS version ranges
Example Configuration (Gateway Creation)
- The TLS settings apply only to outbound connections targeting
localhost. - Each upstream service you interact with (e.g.,
api.example.com,service.internal) can have its own unique TLS configuration.
Configuration Parameters
- allow_insecure_connections: Set to
trueto allow non-TLS connections to upstream services. Defaults tofalsefor secure communication. - ca_cert: Absolute path to the CA certificate file used to verify upstream service certificates.
- client_certs.certificate: Absolute path to the client certificate for mutual TLS authentication with upstream services.
- client_certs.private_key: Absolute path to the private key associated with the client certificate.
- cipher_suites: List of supported cipher suite IDs (e.g.,
4865,4866). - curve_preferences: List of elliptic curve IDs used for ECDHE key exchange (e.g.,
23,24). - disable_system_ca_pool: If
true, disables use of the system CA pool for upstream certificate verification. - min_version: Minimum supported TLS version (
TLS12orTLS13). - max_version: Maximum supported TLS version (
TLS12orTLS13).
Note: All certificate and key paths must be absolute. Place certificates and keys in the certs/ directory within your deployment.
Certificate Management
- Directory Structure: Store all certificates and keys in the
certs/directory at the root of your deployment. - Absolute Paths: Ensure all configuration entries for certificates and keys use absolute paths.
Best Practices
- Use TLS 1.2 or higher for all communications.
- Enable mutual TLS (mTLS) where possible for enhanced security.
- Regularly rotate certificates and keys to maintain strong security posture.