Synadia Protect

Configuration reference

All gateway configuration is done through a YAML file. There are three configuration modes depending on how the gateway is deployed:

  • Standalone - hosts everything needed to run and manage the gateway. Security policies are installed and managed directly via protect admin or the protect UI.
  • Configuration Server - centralized management for a fleet of gateways. Security policies are installed and managed here, then distributed to managed gateways. The management service runs on an external NATS server provided by the user.
  • Managed Gateway - hosts everything needed to run the gateway, but security policies are installed and managed via a configuration server.

The mode is determined by which top-level block is present in the configuration file.

Configuration sections

SectionDescription
nameunique instance identifier
portslistening ports that proxy connections to backend NATS clusters
monitorPrometheus metrics endpoint
managementadmin API on an embedded NATS server (standalone and managed gateways)
rulesdefault policy behavior and trusted bundle signers
loggeroperational log level and format
auditaudit logging for policy decisions, API access, and connection events
configuration_serverexternal NATS cluster for centralized management (configuration server only)
remote_configuration_serverconnection to a configuration server (managed gateway only)
data_limitsstream size and retention limits (configuration server only)

Environment variable expansion

Configuration values support environment variable expansion using ${VAR} syntax. Default values are supported with ${VAR:-default}:

name: '${GATEWAY_NAME}'
configuration_server:
  urls:
    - '${NATS_URL}'
  api_credentials:
    user_name: '${API_USER}'
    password: '${API_PASS:-changeme}'

Windows paths

On Windows, use forward slashes in all path configurations. The configuration parser interprets backslashes as escape characters:

# correct
data_dir: C:/protect/data

# incorrect -- backslashes will be treated as escapes
data_dir: C:\protect\data

Standalone gateway

A standalone gateway has its own management API, stores its own data, and operates independently.

Configuration server

A configuration server differs from a standalone gateway in two ways:

  • It has a configuration_server block with api_credentials and data_credentials for connecting to an external NATS cluster where the management service runs. There is no management block — the protect admin commands and the protect UI connect to the external NATS cluster using credentials for the api_credentials account.
  • The ports section declares the port names managed gateways can expose. Only name and kind are allowed — setting host, port, backend, tls, or compression is an error. The configuration server does not listen on these ports; each managed gateway supplies the network details.

Managed gateway

A managed gateway connects to a configuration server to receive its bundles and configuration. It reports health via heartbeats.

Section reference

name

Unique identifier for this gateway instance. Appears in logs, metrics, and the admin API. Must not contain whitespace or . characters.

ports

A list of named listening ports. Each port proxies connections to a backend NATS cluster.

On a configuration server, only name and kind are allowed — the server declares port names for the fleet but does not listen. Setting host, port, tls, backend, or compression on a configuration server port is an error.

FieldTypeDefaultDescription
namestringrequiredunique port identifier (alphanumeric, -, _)
kindstringrequiredclient or leaf
hoststring127.0.0.1bind address
portintrequiredlisten port (1-65535, or -1 for random)
tlstls-TLS for incoming connections
backendbackendrequiredthe backend NATS cluster this port proxies to
compressionstringoffleaf ports only: off, s2_fast, s2_better, s2_best
max_control_lineint-max protocol control line size
max_connectionsint-max concurrent connections
max_pendingint-max pending bytes per connection
auth_timeoutduration-authentication timeout
ports:
  - name: clients
    kind: client
    host: 0.0.0.0
    port: 4222
    max_connections: 1000
    auth_timeout: 5s
    backend:
      urls:
        - nats://backend-1:4222
        - nats://backend-2:4222
  - name: leafnodes
    kind: leaf
    host: 0.0.0.0
    port: 7422
    compression: s2_fast
    backend:
      urls:
        - nats://backend-1:7422

backend

A backend is the destination NATS cluster that a port proxies connections to.

FieldTypeDefaultDescription
urlsstring[]requiredNATS server URLs
tlstls-TLS settings for the connection to the backend

monitor

Prometheus metrics endpoint served on /metrics.

FieldTypeDefaultDescription
hoststring127.0.0.1bind address
portintrequiredlisten port (0 = disabled)
tlstls-TLS settings
countersobject-per-subject traffic tracking

monitor.counters

FieldTypeDefaultDescription
count_message_with_subjectstring[]-subject patterns to track message counts
count_message_bytes_with_subjectstring[]-subject patterns to track byte counts

Subject counters are opt-in per-subject traffic tracking. Subjects in the list may not overlap and there is a maximum of 1000 entries per list. Enabling these will impact performance.

monitor:
  host: 0.0.0.0
  port: 8080
  counters:
    count_message_with_subject:
      - 'orders.>'
      - 'events.>'
    count_message_bytes_with_subject:
      - 'orders.>'

management

The management service hosts the admin API. For standalone and managed gateways, it runs on an embedded NATS server and uses NKey authentication. Configuration servers do not have a management block — the management service runs on the external NATS cluster specified in configuration_server.urls, and protect admin / the protect UI connect using whatever credentials the external cluster requires for the API account.

FieldTypeDefaultDescription
api_keystringrequiredpublic NKey(s) for admin API access
system_keystringrequiredpublic NKey(s) for system access
data_keystring-public NKey(s) for data access
hoststring127.0.0.1bind address
portintrequiredlisten port
data_dirstringrequiredJetStream data storage directory
enable_server_logboolfalselog embedded NATS server output
tlstls-TLS settings
bundle_install_timeoutduration-max time for bundle installation
bundle_install_max_sizebyte size-max bundle file size
evaluate_timeoutduration-max time for rule evaluation
management:
  api_key:
    - UBZ4SGUAFFUBHNNZJ6K76SWRGC7TE7XIFMRDFHGZHTCQ2BB23FZG42L6
  system_key:
    - UD6MMRSS6DFTSXHVSV3TYELESX2E2VMCKV6XMKHIILTOXN7IZ2GQG3SY
  host: 127.0.0.1
  port: 4911
  data_dir: /var/lib/protect/data
  bundle_install_timeout: 10s
  bundle_install_max_size: 10MB

Gateways use NKey authentication. Each gateway generates its own internal keys. The configuration lists the public keys authorized to access each account:

  • SYSTEM — internal system account. Access is rarely needed.
  • DATA — stores bundles, rules, and related configuration.
  • API — the primary admin interface. Manage bundles, define trace profiles, disconnect or suspend clients, and view server info and statistics.

rules

Controls default policy behavior when no rule matches traffic. These settings apply globally to all ports unless overridden on a per-port basis.

FieldTypeDefaultDescription
default_rule_directionstringto_backenddirection rules evaluate unless a rule specifies its own direction
unmatched_rule_to_backend_actionstringdenyaction when no rule matches client-to-backend traffic
unmatched_rule_from_backend_actionstringdenyaction when no rule matches backend-to-client traffic
trusted_bundle_signersstring[]-public NKeys authorized to sign bundles

When trusted_bundle_signers is set, the gateway only accepts bundles signed by the listed public keys. Removing a key revokes all bundles issued by that signer -- active bundles are automatically deactivated. To restore those rules, re-create the bundle with a trusted signer.

Rule direction values:

ValueDescription
to_backendrules only evaluate traffic flowing from the client/leafnode to the backend cluster
from_backendrules only evaluate traffic flowing from the backend cluster to the client/leafnode
bothrules evaluate traffic in both directions

Unmatched action values:

ValueDescription
allowforward the traffic
denyreject the traffic and disconnect the client
suspenddrop all traffic but respond to PING so the connection believes it is still alive. Requests time out, subscriptions produce no messages, and published messages are dropped. Delays the reconnect cycle — unlike deny, which disconnects the client immediately

Individual ports can override the global defaults by adding entries under ports:

rules:
  default_rule_direction: to_backend
  unmatched_rule_to_backend_action: deny
  unmatched_rule_from_backend_action: deny
  trusted_bundle_signers:
    - <public NKey>
  ports:
    - name: clients
      default_rule_direction: both
      unmatched_rule_from_backend_action: allow
    - name: leafnodes
      unmatched_rule_from_backend_action: allow

Each entry must reference a port name defined in ports. Only the fields you specify are overridden — the rest fall back to the global values.

logger

Operational logging (not audit events).

FieldTypeDefaultDescription
levelstringrequiredtrace, debug, info, warning, error
debug_trafficboolfalsetrace protocol traffic on the embedded NATS server
file_pathstring-log file path (stdout if omitted)
formatstringnatsnats (nats-server style log format) or standard
logger:
  level: info
  file_path: /var/log/protect/protect.log
  format: nats

audit

Audit logging for policy decisions, API access, bundle management, and connection events. Intended for SIEM integration.

FieldTypeDefaultDescription
log_file_dirstringrequireddirectory for audit log files
client_trace_dirstringrequireddirectory for client trace captures
processorslistrequiredat least one processor

audit.processors[]

FieldTypeDefaultDescription
namestringrequiredprocessor identifier
typestringrequiredfile, log, or nats
formatstringtexttext, json, or cef
disabledboolfalsedisable this processor
eventsstring[]allevent types to capture (omit for all)
exclude_eventsstring[]noneevent types to exclude (mutually exclusive with events)
configobject-type-specific configuration

Event types:

EventDescription
connection.startconnection established
connection.endconnection closed
policy.actionpolicy evaluation result
management.apimutating management API access
management.informationalread-only management API access
management.policypolicy management API access
management.bundlebundle management API access
log.protocolraw protocol data (debugging)
trace.starttrace capture started
trace.endtrace capture ended

Processor config by type:

file:

FieldTypeDescription
filestringoutput file path

nats:

FieldTypeDescription
urlsstring[]NATS server URLs
credentialscredentialsNATS authentication
default_timeoutdurationrequest timeout
audit:
  log_file_dir: /var/log/protect/audit
  client_trace_dir: /var/log/protect/traces
  processors:
    - name: all_events
      type: file
      format: text
      config:
        file: /var/log/protect/audit/audit.log
    - name: connections
      type: file
      format: cef
      events:
        - connection.start
        - connection.end
      config:
        file: /var/log/protect/audit/connections.log
    - name: policy
      type: file
      format: json
      events:
        - policy.action
      config:
        file: /var/log/protect/audit/policy.log
    - name: siem
      type: nats
      format: json
      config:
        urls:
          - nats://siem-collector:4222
        credentials:
          user_name: audit
          password: secret

tls

TLS configuration used by ports, backends, monitor, and management. The fields are the same everywhere.

FieldTypeDefaultDescription
certificatestring-path to certificate file
keystring-path to private key file
castring-path to CA certificate
timeoutduration2sTLS handshake timeout
verifyboolfalserequire and verify client certificates
insecureboolfalseskip certificate verification
min_versionfloat-minimum TLS version (e.g., 1.2)
tls:
  certificate: /etc/protect/certs/server.pem
  key: /etc/protect/certs/server.key
  ca: /etc/protect/certs/ca.pem
  verify: true
  min_version: 1.3

configuration_server

Present only in configuration server mode.

FieldTypeDefaultDescription
urlsstring[]requiredexternal NATS cluster URLs
api_credentialsobjectrequiredcredentials for the API account
data_credentialsobjectrequiredcredentials for the data account
bundle_install_timeoutduration-bundle installation timeout
bundle_install_max_sizebyte size-max bundle size
evaluate_timeoutduration-rule evaluation timeout
configuration_server:
  urls:
    - nats://nats-1:4222
    - nats://nats-2:4222
  api_credentials:
    user_name: admin
    password: secret
  data_credentials:
    user_name: data
    password: datapass
  bundle_install_max_size: 10MB

remote_configuration_server

Present only in managed gateway mode.

FieldTypeDefaultDescription
urlsstring[]requiredconfiguration server NATS URLs
data_credentialsobjectrequiredcredentials to access config data
heartbeat_intervalduration-health check-in interval
remote_configuration_server:
  urls:
    - nats://config-server:4222
  data_credentials:
    user_name: gateway-01
    password: gatewaypass
  heartbeat_interval: 30s

data_limits

Only valid when configuration_server is present.

FieldTypeDefaultDescription
max_stream_sizebyte size-max JetStream storage size
max_ageduration-max message retention age
data_limits:
  max_stream_size: 1GB
  max_age: 720h

Credentials

Used in configuration_server, remote_configuration_server, and nats audit processors.

FieldTypeDescription
user_namestringbasic auth username
passwordstringbasic auth password
tokenstringbearer token
nkeystringNKey seed
nkey_filestringpath to NKey file
jwtstringJWT credential
jwt_filestringpath to JWT file
namestringconnection name
# using username/password
credentials:
  user_name: admin
  password: secret

# using NKey file
credentials:
  nkey_file: /etc/protect/admin.nk

# using JWT + NKey
credentials:
  jwt_file: /etc/protect/user.jwt
  nkey_file: /etc/protect/user.nk

Byte size values

Fields like bundle_install_max_size and max_stream_size accept human-readable sizes:

SuffixBaseExample
k1,00064k
m1,000,00010m
g1,000,000,0001g
kb, ki, kib1,02464kb
mb, mi, mib1,048,57610mb
gb, gi, gib1,073,741,8241gb

Plain integers are treated as bytes.