Encryption Proxy Guide

πŸ” Purpose

This configuration is used to run Encryption Proxy as middleware to encrypt sensitive data fields (PII) in PostgreSQL databases - for example in applications like Keycloak.


πŸ“ Configuration Structure

1. πŸ”– License

license:
  file: "/etc/app/licenses.pem"
  • License file for running Encryption Proxy.


2. πŸ“ Logging

log:
  level: trace
  format: pretty
  sync: false
  • level: Level log (trace, debug, info, dll.)

  • format: Format log (pretty, json)

  • sync: If true, the log is directly written to the output.


3. 🌐 Server Settings

  • Enable the internal API server.

  • Can be used to expose Prometheus metrics or other internal endpoints.


4. πŸ’Ύ Storage (Token Cleanup / Persistence)

  • Set up an internal storage driver (for token/session management).

  • cleanup_token_interval: in seconds.


5. πŸ” Encryption Settings

  • Default algoritma: AES-GCM 128 bit.

  • Provider ID and prefix key for retrieval from the environment or KMS.


6. πŸ” PostgreSQL Proxy

  • Enable PostgreSQL proxy.

  • The proxy will listen for connections on port 5432 and forward them to the original DB.


7. πŸ›‘οΈ Encryption Rules

  • Rules for writing fields that you want to encrypt/hash.

  • compatibility_mode: true allows fallback to plaintext if fields are not encrypted (useful during initial migration).

  • The rule above targets a database named <database_name>.


βœ… Full File Example: config.yaml


Last updated