Configuration

Service definitions, upstreams, TLS, middlewares, and environment variables for the Zentinel Control Plane.

Services

Services are the primary configuration unit. Each maps an HTTP route path to a backend.

Route Types

ModeDescription
Upstream URLForward to a single backend
Upstream GroupLoad-balanced pool of backends
RedirectHTTP redirect
Static ResponseFixed status + body

Service Types

TypeDescription
standardHTTP/HTTPS reverse proxy (default)
inferenceLLM inference proxy (OpenAI, Anthropic, generic)
grpcgRPC proxy
websocketWebSocket with upgrade support
graphqlGraphQL-aware proxy
streamingSSE / streaming proxy

Options

Timeout, retry policy, caching, rate limiting, health checks, CORS, compression, path rewriting, traffic splitting, access control, security headers, request/response transforms.

Services can attach: certificates (TLS), auth policies, WAF policies, OpenAPI specs.

Upstream Groups

Load-balanced pools with algorithms: round_robin, least_conn, ip_hash, consistent_hash, weighted, random.

Targets have: host, port, weight, max_connections, enabled flag.

Features: health checks, sticky sessions (cookie-based), circuit breaker (closed/open/half_open), trust stores for backend TLS verification.

TLS Certificates

Upload PEM cert + key + optional CA chain. Private keys encrypted at rest (AES-256-GCM).

Status tracking: active, expiring_soon, expired, revoked.

ACME / Let’s Encrypt

Automatic renewal via HTTP-01 challenges at /.well-known/acme-challenge/:token.

Internal CA

Per-project internal CA for mTLS. CA certificates included in compiled bundles automatically.

Middlewares

Reusable config blocks attached to services with per-service ordering and config overrides:

rate_limit, cache, cors, compression, headers, access_control, security, path_rewrite, request_transform, response_transform, auth, custom.

Secrets

Encrypted at rest (AES-256-GCM). Never exposed in API responses. Environment-scoped with rotation tracking.

GitOps Integration

Link a project to a Git repository. Push to configured branch triggers automatic bundle compilation.

SettingDescription
repositoryOwner/repo (e.g., acme/proxy-config)
branchTarget branch (default: main)
config_pathKDL config file path (default: zentinel.kdl)

Supported: GitHub, GitLab, Bitbucket, Gitea, generic webhooks.

Environment Variables

VariableRequiredDefaultDescription
DATABASE_URLProdPostgreSQL connection (ecto://user:pass@host:5432/db)
SECRET_KEY_BASEProdPhoenix secret (generate: mix phx.gen.secret)
PHX_HOSTProdlocalhostPublic hostname
PORTNo4000HTTP port
S3_BUCKETYeszentinel-bundlesBundle storage bucket
S3_ENDPOINTYeshttp://localhost:9000S3/MinIO endpoint
S3_ACCESS_KEY_IDYesS3 access key
S3_SECRET_ACCESS_KEYYesS3 secret key
S3_REGIONNous-east-1S3 region
ZENTINEL_BINARYNozentinelPath to zentinel CLI
GITHUB_WEBHOOK_SECRETNoGitHub webhook HMAC secret
OTEL_EXPORTER_OTLP_ENDPOINTNoOpenTelemetry endpoint
FORCE_SSLNofalseRedirect HTTP → HTTPS
POOL_SIZENo10DB connection pool size

Bundle Signing

Optional Ed25519 signing for bundle integrity:

config :zentinel_cp, :bundle_signing,
  enabled: true,
  private_key_path: "/secrets/signing-key.pem",
  public_key_path: "/secrets/signing-key.pub",
  key_id: "key-2024-01"