Skip to main content

Network configuration YAML reference

This document describes the YAML configuration for the Genesis network layer. The file is deserialized into NetworkConfigContainer and supports messaging, Netty, and TLS settings.

Introduction and file usage

Purpose

The network configuration drives:

  • Messaging: protocol version, serialization format, request-reply timeout
  • Netty: thread usage and socket options
  • TLS: encryption mode, identity/trust, client auth, peer verification, and authorization

File names and merge behaviour

  • Application-level: network-config.yaml (loaded first)
  • Process-level (optional): network-config-{processName}.yaml (overrides application config for that process)

If both files are present, process level configuration will overwrite any global settings.

Environment placeholders

Environment variable placeholders in the YAML are resolved when the config is loaded, use ${...} to refer to environmental variables.

Validation

  • When tls.mode is not PLAIN_TEXT, the TLS block is validated after parsing.

Root schema

The YAML root is the network config container. Top-level keys:

SectionTypeDefault / notes
messagingobjectmessaging section
nettyobjectnetty section
tlsobjecttls section (default: PLAIN_TEXT)

Unknown top-level keys are ignored.


messaging section

KeyTypeDefaultDescription
protocolstringV2Genesis net protocol: V1 or V2
serializationstringMSGPACKMessage serialization: MSGPACK or JSON
requestTimeoutinteger60Request-reply timeout in seconds

There is no TLS-style validator for this section; values are used as configured.


netty section

KeyTypeDefaultDescription
useNettyThreadsbooleanfalseUse Netty threads for message processing
socketobjectSocket options (below)

netty.socket

KeyTypeDefaultDescription
soKeepALivebooleantrueTCP keep-alive
tcpNoDelaybooleantrueTCP no-delay (Nagle off)

tls section

When tls.mode is not PLAIN_TEXT, the TLS subtree is validated. Invalid or unknown enum values (e.g. typos) can produce validation errors.

Note: tls.observability is not documented here (not yet implemented).

Top-level TLS

KeyTypeDefaultDescription
modestringPLAIN_TEXTEncryption mode: PLAIN_TEXT, TLS, SELECTIVE_TLS, MUTUAL_TLS
protocolPolicyobjecttls.protocolPolicy
identityobjecttls.identity
trustobjecttls.trust
clientAuthstringAUTOClient auth (server-side): AUTO, NONE, OPTIONAL, REQUIRE. AUTO → NONE for TLS/SELECTIVE_TLS, REQUIRE for MUTUAL_TLS
peerVerificationobjecttls.peerVerification
authorizationobjecttls.authorization

Validation: tls.mode and tls.clientAuth must be valid enum values (see error messages in Validation summary).

tls.protocolPolicy

KeyTypeDefaultDescription
minVersionstringTLSv1.2Minimum TLS version: TLSv1.2 or TLSv1.3
enabledProtocolslist of string[]e.g. ["TLSv1.2", "TLSv1.3"]
cipherSuiteslist of string[]Cipher suite names

Validation: minVersion must be TLSv1.2 or TLSv1.3.

tls.identity

KeyTypeDefaultDescription
sourcestringNONENONE, CERTIFICATE, or KEYSTORE
certificateobjectUsed when source: CERTIFICATE (below)
keystoreobjectUsed when source: KEYSTORE (below)
reloadobjectCertificate/keystore reload (below)

Validation: When tls.mode is MUTUAL_TLS, identity.source must be CERTIFICATE or KEYSTORE. identity.source must be a valid enum.

When identity.source: CERTIFICATE

KeyTypeDefaultDescription
certChainPathstring""Path to certificate chain (e.g. PEM)
privateKeyPathstring""Path to private key
privateKeyPasswordstring""Optional password for encrypted key

Validation: certChainPath and privateKeyPath must not be blank when source is CERTIFICATE.

When identity.source: KEYSTORE

KeyTypeDefaultDescription
typestringPKCS12PKCS12 or JKS
pathstring""Path to keystore file
storePasswordstring""Keystore password
keyAliasstring""Key alias
keyPasswordstring""Key password

Validation: path must not be blank and type must be valid when source is KEYSTORE.

identity.reload (certificate/keystore reload)

KeyTypeDefaultDescription
enabledbooleanfalseEnable periodic reload
pollIntervalstring"60s"Duration: e.g. 60s, 5m, 1h, 1d (pattern: \d+[smhd])

Validation: When reload is enabled, pollInterval must not be blank and must match the duration pattern (e.g. 60s, 5m, 1h, 1d).

tls.trust

KeyTypeDefaultDescription
sourcestringSYSTEMSYSTEM, CERTIFICATE, or TRUSTSTORE
certificateobjectWhen source: CERTIFICATE (below)
truststoreobjectWhen source: TRUSTSTORE (below)
additionalCaBundleslist of string[]Additional CA bundle file paths

Validation: trust.source must be a valid enum.

When trust.source: CERTIFICATE

KeyTypeDefaultDescription
caBundlePathstring""Path to CA bundle (e.g. PEM)

Validation: caBundlePath must not be blank when source is CERTIFICATE.

When trust.source: TRUSTSTORE

KeyTypeDefaultDescription
typestringPKCS12PKCS12 or JKS
pathstring""Path to truststore file
storePasswordstring""Truststore password

Validation: path must not be blank and type must be valid when source is TRUSTSTORE.

tls.peerVerification

KeyTypeDefaultDescription
modestringAUTOAUTO, HOSTNAME, or CERT_IDENTITY
hostnameobjectHostname verification (below)

tls.peerVerification.hostname

KeyTypeDefaultDescription
enabledbooleantrueEnable hostname verification

Validation: peerVerification.mode must be a valid enum value.

tls.authorization

KeyTypeDefaultDescription
enabledbooleanfalseEnable authorization checks
defaultDecisionstringDENYDefault decision: DENY or ALLOW
identitySourceobjectWhere to take identity from (below)
allowobjectAllow list (identities + patterns)
denyobjectDeny list (identities + patterns)

tls.authorization.identitySource

KeyTypeDefaultDescription
sanTypestringURISAN type used for identity: URI or DNS

tls.authorization.allow / tls.authorization.deny (identity list policy)

KeyTypeDefaultDescription
identitieslist of string[]Exact identity values
identityPatternslist of string[]Regex patterns for identities

Validation: When authorization is enabled: defaultDecision and identitySource.sanType must be valid; at least one of allow or deny must have non-empty identities or identityPatterns (otherwise: "authorization is enabled but no allow or deny rules are configured").


Validation summary

When TLS is enabled (tls.modePLAIN_TEXT), the following conditions are enforced. Violations produce the corresponding error message:

ConditionError message
tls.mode invalid/unknowntls.mode must be a valid mode (PLAIN_TEXT, TLS, SELECTIVE_TLS or MUTUAL_TLS)
tls.clientAuth invalid/unknowntls.clientAuth must be a valid client auth mode (AUTO, NONE, OPTIONAL, or REQUIRE)
protocolPolicy.minVersion invalid/unknownprotocolPolicy.minVersion must be a valid TLS version (TLSv1.2 or TLSv1.3)
tls.mode: MUTUAL_TLS but identity.source not CERTIFICATE/KEYSTOREtls.identity.source must be configured (CERTIFICATE or KEYSTORE) when mode is MUTUAL_TLS
identity.source invalid/unknownidentity.source must be a valid source (NONE, CERTIFICATE, or KEYSTORE)
CERTIFICATE identity but blank certChainPathidentity.certificate.certChainPath must not be blank when CERTIFICATE identity source is used
CERTIFICATE identity but blank privateKeyPathidentity.certificate.privateKeyPath must not be blank when CERTIFICATE identity source is used
KEYSTORE identity but blank pathidentity.keystore.path must not be blank when KEYSTORE identity source is used
KEYSTORE identity but invalid typeidentity.keystore.type must be a valid store type (PKCS12 or JKS)
Reload enabled but blank pollIntervalidentity.reload.pollInterval must not be blank when reload is enabled
Reload enabled but invalid pollInterval formatidentity.reload.pollInterval must be a valid duration string (e.g., '60s', '5m', '1h', '1d')
trust.source invalid/unknowntrust.source must be a valid source (SYSTEM, CERTIFICATE, or TRUSTSTORE)
CERTIFICATE trust but blank caBundlePathtrust.certificate.caBundlePath must not be blank when CERTIFICATE trust source is used
TRUSTSTORE trust but blank pathtrust.truststore.path must not be blank when TRUSTSTORE trust source is used
TRUSTSTORE trust but invalid typetrust.truststore.type must be a valid store type (PKCS12 or JKS)
peerVerification.mode invalid/unknownpeerVerification.mode must be a valid mode (AUTO, HOSTNAME, or CERT_IDENTITY)
Authorization enabled but defaultDecision invalid/unknownauthorization.defaultDecision must be a valid decision (DENY or ALLOW)
Authorization enabled but identitySource.sanType invalid/unknownauthorization.identitySource.sanType must be a valid SAN type (URI or DNS)
Authorization enabled but both allow and deny emptyauthorization is enabled but no allow or deny rules are configured

Full YAML examples

Example 1: Minimal (plain text, TLS disabled)

tls:
mode: PLAIN_TEXT

Example 2: Server TLS with PEM identity and system trust

tls:
mode: TLS
identity:
source: CERTIFICATE
certificate:
certChainPath: /etc/certs/server.crt
privateKeyPath: /etc/certs/server.key
trust:
source: SYSTEM
protocolPolicy:
minVersion: TLSv1.2

Example 3: MUTUAL_TLS with CERTIFICATE identity and trust, plus authorization

tls:
mode: MUTUAL_TLS
identity:
source: CERTIFICATE
certificate:
certChainPath: /etc/certs/server.crt
privateKeyPath: /etc/certs/server.key
trust:
source: CERTIFICATE
certificate:
caBundlePath: /etc/certs/ca-bundle.crt
protocolPolicy:
minVersion: TLSv1.3
authorization:
enabled: true
defaultDecision: DENY
identitySource:
sanType: URI
allow:
identities:
- "spiffe://example.com/service/allowed"
identityPatterns:
- "spiffe://example.com/service/.*"

Example 4: MUTUAL_TLS with full options (no observability)

tls:
mode: MUTUAL_TLS
clientAuth: REQUIRE
protocolPolicy:
minVersion: TLSv1.3
enabledProtocols:
- TLSv1.3
cipherSuites:
- TLS_AES_256_GCM_SHA384
- TLS_AES_128_GCM_SHA256
identity:
source: CERTIFICATE
certificate:
certChainPath: /etc/certs/server.crt
privateKeyPath: /etc/certs/server.key
privateKeyPassword: secret
reload:
enabled: true
pollInterval: 5m
trust:
source: CERTIFICATE
certificate:
caBundlePath: /etc/certs/ca-bundle.crt
additionalCaBundles:
- /etc/certs/additional-ca.crt
peerVerification:
mode: CERT_IDENTITY
hostname:
enabled: false
authorization:
enabled: true
defaultDecision: DENY
identitySource:
sanType: URI
allow:
identities:
- "spiffe://example.com/service/api"
identityPatterns:
- "spiffe://example.com/service/.*"

Enum reference

EnumAllowed values
EncryptionMode (tls.mode)PLAIN_TEXT, TLS, SELECTIVE_TLS, MUTUAL_TLS
TlsVersion (protocolPolicy.minVersion)TLSv1.2, TLSv1.3
IdentitySource (identity.source)NONE, CERTIFICATE, KEYSTORE
TrustSource (trust.source)SYSTEM, CERTIFICATE, TRUSTSTORE
StoreType (identity/trust store type)PKCS12, JKS
ClientAuthMode (tls.clientAuth)AUTO, NONE, OPTIONAL, REQUIRE
PeerVerificationMode (peerVerification.mode)AUTO, HOSTNAME, CERT_IDENTITY
SanType (authorization.identitySource.sanType)URI, DNS
DefaultDecision (authorization.defaultDecision)DENY, ALLOW

Messaging (root):

EnumAllowed values
GenesisNetProtocol (messaging.protocol)V1, V2
MessageSerialization (messaging.serialization)MSGPACK, JSON