ADR#0081: Every NATS Connection Uses TLS Unless Explicitly Disabled, and Clients Enter Operator-Mode Accounts Only Through Platform Credentials or the Auth Callout
Context
NATS carries every protocol the platform routes (ADR#0003), tenant secret resolution included (ADR#0023), and ADR#0055 makes the NATS account the primary tenant boundary. Those decisions assume a transport that encrypts and an account that the server chooses for the client. Neither the clients nor the servers in the repository enforce either assumption today.
Clients encrypt only when asked. First-party binaries connect through trogon_nats::connect, directly or through the mcp-nats and acp-nats re-exports, except for the a2a crates described below. In rsworkspace/crates/platform/trogon-nats, NatsTls derives Default with nothing set (src/tls.rs:35-36), NatsConfig::new and NatsConfig::from_url start from that default (src/auth.rs:64-74), and apply_tls returns the options untouched unless NATS_CERT, NATS_KEY or NATS_CA is set (src/connect.rs:121-125). Only then does it call require_tls(true). The crate README (README.md:22) and the compose example environment (devops/docker/compose/.env.example:52) document this as "setting any TLS variable requires TLS". Without those variables, async-nats 0.50.0 upgrades to TLS only when the URL scheme is tls:// or the server's INFO line asks for it (src/connector.rs:597-603), and that INFO line arrives in plaintext before any handshake. Whoever can rewrite it receives the CONNECT frame in the clear, with any token or password in it. A forgotten variable is a silent downgrade, not an error.
The a2a crates bypass the shared path. a2a-auth-callout (rsworkspace/crates/a2a/a2a-auth-callout/src/main.rs:182-189) and a2a-bridge (rsworkspace/crates/a2a/a2a-bridge/src/main.rs:122-129) build async_nats::ConnectOptions themselves, with an optional user and password and no TLS settings, and the bridge opens a connection the same way for each caller it serves (src/inbound.rs:220-225 and :355-360).
Turning TLS on today leaves the crypto provider to the dependency graph. rustls 0.23.46 builds a client configuration from the process-level crypto provider. When none is installed it infers one from crate features, and when more than one provider is compiled in it panics instead of choosing (src/crypto/mod.rs:243-257). async-nats 0.50.0 builds its configuration that way (src/tls.rs:99). The workspace's own rustls dependency enables aws-lc-rs (rsworkspace/Cargo.toml:187), while async-nats's ring feature, which trogon-nats and trogon-gateway enable (rsworkspace/crates/platform/trogon-nats/Cargo.toml:12, rsworkspace/crates/platform/trogon-gateway/Cargo.toml:18), and reqwest's rustls-tls, hyper-rustls and bollard enable ring in the same rustls. Only trogon-gateway and trogon-provider-gateway install a provider (rsworkspace/crates/platform/trogon-gateway/src/main.rs:55, rsworkspace/crates/provider/trogon-provider-gateway/src/main.rs:20), through a helper that fails when a provider is already installed (rsworkspace/crates/platform/trogon-std/src/tls.rs:24-28). Every other binary gets whatever its dependency graph implies: where the graph enables both providers, the first TLS connection panics, and where it enables only ring, NATS TLS runs on ring against ADR#0015's preference. async-nats also loads the system roots only when no root certificate is configured, so a private CA replaces the public roots rather than adding to them (src/tls.rs:58-75).
The servers trust everything. The compose NATS server runs nats:2.14.2-alpine with --jetstream, --store_dir=/data and --http_port=8222 and nothing else (devops/docker/compose/compose.yml:4-18): no TLS, no accounts, no authorization, an unencrypted store, and plain HTTP monitoring. Services reach it at nats://nats:4222 (compose.yml:32). Clients fall back to NatsAuth::None when no credential is configured (rsworkspace/crates/platform/trogon-nats/src/settings.rs:96, src/connect.rs:106), so any process that can reach the port lands in the server's default global account. The only server configuration with accounts and a callout is a config-mode test fixture. base_server_config declares AUTH with a static callout user and password, APP, SYS and a tenant account in the server file, under an authorization { auth_callout { ... } } block (rsworkspace/crates/a2a/a2a-auth-callout/tests/nats_server_callout_integration.rs:285-312), and the tests that start it are ignored (:638, :675, :708).
The callout's user JWTs fit neither server mode. mint_nats_user_jwt in a2a-auth-callout sets both iss and issuer_account to the callout's own signing key and names the target account in aud (src/jwt/nats_user_jwt.rs:105, :133, :136). nats-server 2.14.1 rejects issuer_account outside operator mode, and in operator mode it places the user in the account that issuer_account names and ignores aud (server/auth_callout.go:156-243). The callout also picks the credential scheme by which CONNECT fields are present: the jwt field or an opaque password as OIDC, then a client certificate as mTLS, then a token as an API key (src/dispatcher.rs:49-63). In operator mode every connection that reaches the callout carries the sentinel's JWT in that field, so this order would read every caller as OIDC.
Other clients lean the right way or cannot encrypt at all. The OpenBao client requires TLS unless told otherwise. openbao_transport_from_env returns TlsRequired unless OPENBAO_ALLOW_PLAINTEXT is true (rsworkspace/crates/platform/trogon-gateway/src/main.rs:993-1001), and TlsRequired refuses an http address (src/secret_store/openbao_secret_store.rs:251-259). The compose stack sets that flag (compose.yml:33-35). Postgres cannot use TLS at all: the workspace sqlx dependency enables no TLS feature (rsworkspace/Cargo.toml:118), the scheduler's Postgres projection takes a caller-built PgPool (rsworkspace/crates/scheduler/trogon-scheduler/src/projections/postgres/store.rs:43), and the compose OpenBao reaches its Postgres with sslmode=disable (compose.yml:108).
What this builds on. ADR#0015 already prefers rustls with aws-lc-rs, and prefers terminating TLS at the deployment edge with in-process TLS as the exception. ADR#0033 puts the NATS operator and account signing seeds, the callout's signing keys, and the NATS credentials the callout and the secrets service use for their own connections on the platform boot path, outside the SecretStore and KeyManagement ports. It keeps the callout's signing keys deployment-provisioned until the callout and the secrets service connect with credentials that are not subject to callout admission. ADR#0042 already requires nats-server 2.14 or newer. ADR#0017 specifies a binding in which agents sign NATS messages themselves, so an agent can be a direct NATS client and not only an HTTP caller.
Decision
NATS is treated as a network an attacker can reach. Every connection is encrypted and mutually authenticated, every client lands in an account that the operator's keys chose, and the only way to weaken either is a switch whose name says what it does.
1. TLS is the default for every NATS client, and only an explicit switch disables it
trogon_nats::connect is the only way first-party code connects to NATS. a2a-auth-callout and a2a-bridge move onto it, the bridge's per-caller connections included.
NatsTls::default() means TLS against the system roots, and require_tls(true) is applied unconditionally, so neither the URL scheme nor the server's INFO line can downgrade a connection. NATS_CA names a private CA, which becomes the client's only trust anchor. NATS_CERT and NATS_KEY together add a client certificate for mutual TLS, and either one without the other is a configuration error.
NATS_TLS_DISABLED=true is the only way to get a plaintext connection. It exists for tests and local debugging, and a client that uses it logs a warning at startup naming the servers it reaches without TLS. Plaintext is a distinct NatsTls::Disabled value rather than the absence of settings, so rg 'NATS_TLS_DISABLED|NatsTls::Disabled' lists every plaintext path in the repository, and that search has no hits under devops/.
Configuration disables TLS explicitly. Nothing "allows plaintext", and nothing has to turn TLS on.
The same stance covers the platform's other network clients. Postgres connections use sslmode=verify-full unless the connection string explicitly says sslmode=disable, and no mode in between is accepted: allow and prefer fall back to plaintext under another name, and require and verify-ca encrypt without checking the server's name. sqlx is built with its tls-rustls-aws-lc-rs feature. The OpenBao client uses https unless TLS is explicitly disabled. Its existing check already enforces that, and OPENBAO_ALLOW_PLAINTEXT gives way to a switch that names the disabling, in the same form as NATS_TLS_DISABLED.
2. The servers run in operator mode with a fixed account topology
Every deployed nats-server, the dev compose stack's included, runs in operator mode under one operator JWT. The operator's identity key signs nothing in routine operation; an operator signing key signs the account JWTs. The accounts are fixed in kind:
SYSis the system account. No application user exists in it. Only operator tooling holds aSYSuser, to push account JWTs and to monitor.AUTHhosts the auth callout. Its account JWT lists the callout service's user inauth_users, lists the tenant accounts the callout may place users into inallowed_accounts, and carries the callout's xkey where one is used. Every otherAUTHuser is a sentinel, a bearer user with no permissions whose only purpose is to trigger the callout.PLATFORMholds the shared workloads: gateways, bridges, the secrets service and schedulers. Each workload is its own user, signed by aPLATFORMsigning key, with its own allow lists.- Each tenant has its own account. It registers the callout signing key, imports what
PLATFORMexports for it, and has no users except the ones the callout mints.
Account JWTs are served by the full resolver, which receives them as pushes over the system account, keeps them on disk and synchronizes them between servers. It runs with allow_delete: false, and resolver_preload carries the SYS account JWT, which a server needs before it can accept any push.
An account can use JetStream only when its account JWT sets JetStream limits, and a new account JWT sets none (NewAccountClaims and IsJSEnabled in v2/account_claims.go, configJetStream in server/jetstream.go). The bootstrap therefore sets them on PLATFORM and on any other account that owns streams.
The server features this depends on were checked against the nats-server 2.14.1 source and the nats-io/jwt v2.8.1 module that release pins: callout placement and allowed_accounts (server/auth_callout.go, and isAllowedAcount in server/accounts.go), export authorization by account token position for services and streams alike (checkAuth in server/accounts.go), renaming imports with local_subject (v2/imports.go), default_sentinel (server/auth.go), and in-place JetStream key rotation (server/jetstream.go, server/filestore.go). ADR#0042 already makes 2.14 the minimum server version.
3. Inside PLATFORM, the tenant token is the importing account's public key
Amended 2026-11-15 by the Decision 3 amendment that follows this section. A
PLATFORMsubject that JetStream stores carries the tenant token right after its literal protocol prefix, because the server refuses a stream whose subjects start with a wildcard. The export of the invalidation subtree is conditional on tenant-account readers.
Tenant traffic reaches the shared workloads through imports, not through shared users. PLATFORM exports each protocol subtree with the account token on the first token, for example *.mcp.v1.> with account_token_position: 1. A tenant account imports <tenant account key>.mcp.v1.> with local_subject: mcp.v1.>, and the server authorizes that import only when the token at that position is the importing account's own public key (checkAuth in server/accounts.go).
Subjects inside a tenant account therefore stay bare: the prefix is the protocol alone, as ADR#0055 intends when the account is the boundary. Inside PLATFORM, the {tenant} component of ADR#0055's [{tenant}.]{protocol} prefix is the tenant's account public key. A request that arrives through a service import carries a key the server authorized only for the account it names, so a PLATFORM responder reads the tenant from the subject and no tenant can present another tenant's key. A message that PLATFORM publishes for a tenant can be imported only by the account whose key leads its subject.
This amends ADR#0055. Inside PLATFORM, {tenant} is the 56-character uppercase account public key, exempt from the lower_snake token rule in the same way as the escape encoding. It costs 57 of the 256 bytes and one of the 16 tokens in ADR#0055's budget and keeps the prefix inside its 128-byte limit. The slug form of {tenant} remains for single-account test fixtures. A decider in PLATFORM that serves several tenants builds its ADR#0027 SubjectScope from the same account key token. Until decider state is scoped by tenant, the decider host refuses to start with a wildcard at the tenant position, so each host serves one tenant account (ADR#0082 Decision 2).
A stream import carries messages one way, so a request that a PLATFORM workload sends to a responder inside a tenant account travels through a service that the tenant account exports and PLATFORM imports. How a responder authorizes a PLATFORM workload acting for a tenant is not settled here.
Decision 3 amendment: a stored PLATFORM subject puts the tenant after a literal prefix
This amendment replaces the rule that the tenant token leads every PLATFORM subject, for subjects that a PLATFORM stream stores. Request subjects that reach a PLATFORM responder through a service import keep the tenant first.
A stream that holds notices for every tenant must list a subject filter with a wildcard at the tenant position. With the tenant first, that filter starts with a wildcard, for example *.secrets.invalidation.v1.>, and the server refuses it: a stream subject that collides with $JS.>, $JSC.>, $NRG.> or $SYS.> is accepted only when the stream sets no_ack, and a leading wildcard followed by > collides with all of them (checkStreamCfg in server/stream.go). nats-server 2.15.3 returns error 10052 for that stream. Older servers accepted it, which is why the restriction surfaced only against a current one. Setting no_ack would take away the publish acknowledgement that a publisher needs before it acknowledges its source, so it is not an option.
A subject that a PLATFORM stream stores therefore keeps its literal protocol prefix first and carries the tenant's account public key right after it, for example secrets.invalidation.v1.{tenant}.{owner_token}.{credential_id}. The stream lists secrets.invalidation.v1.*.>. The tenant token is the 56-character account public key, exempt from the lower_snake rule, and it costs the same bytes and token in the subject budget wherever it sits.
Readers of that stream are shared PLATFORM workloads. The first planned readers, the gateway and the egress proxy, each run as a PLATFORM user allowed the JetStream calls the shipped client makes on the stream: stream info, creating and reading its own filtered consumer, and pulling from it. They read the PLATFORM stream directly, so PLATFORM does not export the subtree and no tenant account holds an import, a stream or a consumer for it. A notice carries metadata only, and reading every tenant's notices is platform trust under ADR#0095 Decision 5.
Exporting the subtree is conditional on a reader that lives in a tenant account, such as the customer-run gateways of ADR#0023 Decision 7. When one arrives, the required shape is a durable source, not a subject export:
- The operator provisions one push durable per tenant on the
PLATFORMSECRETS_INVALIDATIONstream, named by the tenant's account public keyA, with filtersecrets.invalidation.v1.<A>.>and deliver subjectsecrets.source.v1.<A>.notice. The durable usesack_policyflow_controlwith flow control and an idle heartbeat enabled: the server refuses to source from a durable with any other ack policy (NewJSMirrorConsumerRequiresAckFCErrorinserver/stream.go). PLATFORMexports the streamsecrets.source.v1.*.noticewithaccount_token_position4, the service$JS.API.CONSUMER.RESET.SECRETS_INVALIDATION.*with position 6, and the service$JS.FC.SECRETS_INVALIDATION.*.*with position 4. The server authorizes an import only when the token at that position is the importing account's own public key (checkAuthinserver/accounts.go), so each tenant reaches only its own durable, reset and flow control.- Each tenant imports those three, mapping the reset service under the local subject
SECRETS_SOURCE.CONSUMER.RESET.SECRETS_INVALIDATION.<A>, and owns a source-onlySECRETS_INVALIDATIONstream, with the same deny flags as thePLATFORMstream, that sources from the durable. The stored subject is unchanged, so the shipped client reads it as it does today. - A tenant reader must also confirm that the source still forwards. The shipped client checks only its local consumer: gaps in what it is delivered, and what the server says it delivered. A durable that stops forwarding leaves that consumer owed nothing, so the reader would count itself caught up while it holds a value revoked upstream. On each look, a tenant reader therefore reads the local stream's info and finds the durable source. If that source carries an
error, or itsactiveis -1 or older than a few idle heartbeats, the reader has lost its place. The server refreshesactiveon every message and idle heartbeat the durable delivers (trySetupSourceConsumerinserver/stream.go). Having lost its place, the reader holds no released value until the source reports active again and the reader has caught up. The shipped client does not make this check, so it lands before any tenant-account reader ships. - The flow-control route assumes the v1 subject format, which 2.15.3 uses while the
js_ack_fc_v2feature flag is off, its default. With the flag on, flow control moves to$JS.FC.<domain>.<account hash>.SECRETS_INVALIDATION.<A>.*, so enabling it also requires the service export$JS.FC.*.*.SECRETS_INVALIDATION.*.*with position 6 and the matching tenant import, verified against a broker before the flag changes. - The NATS server must be 2.15.3 or later. The 2.14.2 image pinned today created the tenant stream and delivered nothing. 2.14.4 fixed reset replies through service imports (nats-server PR #8407), and 2.15.3 fixed recovery of a durable source (nats-server PR #8802).
A plain subject export with a tenant capture stream is rejected. A stream that captures an import stores only what is published after it exists, so notices published before the view was created, or while it was down, are lost, and the reader cannot see the gap.
4. Admission is PLATFORM credentials or the callout, and nothing else
Platform workloads connect with nsc-generated credentials for their PLATFORM user through NATS_CREDS, and the deployment's NATS bootstrap is the step that issues those users and their allow lists. The callout service connects as the AUTH user named in auth_users, which the server exempts from the callout, and the secrets service connects as a PLATFORM workload. Both therefore use deployment-provisioned credentials that are not subject to callout admission, which is the topology ADR#0033 names as the precondition for moving the callout's signing keys behind KeyManagement. The keys stay deployment-provisioned until that ordering is proven, as ADR#0033 requires.
Every other client is a tenant caller and enters only through the callout. It connects as the AUTH sentinel, or with no NATS user JWT on servers that set default_sentinel, and presents its own credential: an OIDC token, an API key, or its client certificate. The callout answers with a user JWT whose issuer_account is the tenant account and which the callout signing key registered on that account signs, inside an authorization response signed by an AUTH signing key. The server places the user in the tenant account only if AUTH lists that account in allowed_accounts and the account lists the signing key (server/auth_callout.go:140-243). The minted user carries explicit publish and subscribe allow lists, and everything else is denied. The callout signing key is registered unscoped, because for a scoped key nats-server takes the permissions from the scope's template, and the jwt library rejects a scoped user that sets permissions of its own (v2/signingkeys.go:94-106).
The callout reads credentials in a new order. The connections it sees all presented the sentinel, so the CONNECT jwt field always holds the sentinel's JWT, and an OIDC token placed there never arrives, because nats-server replaces a jwt value that is not a NATS user JWT with default_sentinel or refuses the connection (server/auth.go:813-834). Under verify: true every connection also presents a client certificate. A caller's OIDC token or API key therefore travels in auth_token, or in user and pass, and the callout reads those first and treats the certificate as the credential only when nothing else is presented.
No static authorization {} users or passwords exist outside tests, and application code never connects to SYS.
ADR#0033 describes the callout's signing keys as the keys "that admit platform workloads to NATS". Under this decision PLATFORM credentials admit platform workloads and the callout's keys admit tenant callers. The keys remain platform boot keys under that ADR's rule.
5. The reference server configuration
port: 4222
tls {
cert_file: "/etc/nats/tls/server.crt"
key_file: "/etc/nats/tls/server.key"
ca_file: "/etc/nats/tls/ca.crt"
verify: true
}
http: "127.0.0.1:8222"
operator: "/etc/nats/jwt/operator.jwt"
system_account: <SYS account public key>
default_sentinel: <AUTH sentinel bearer user JWT>
resolver {
type: full
dir: "/data/jwt"
allow_delete: false
interval: "2m"
timeout: "1.9s"
}
resolver_preload {
<SYS account public key>: <SYS account JWT>
}
jetstream {
store_dir: "/data/jetstream"
cipher: chacha
key: $JS_KEY
}The client listener requires TLS and a client certificate from the platform CA on every connection. Clustered deployments give cluster and leafnodes their own tls blocks with verify: true, so routes and leaf connections are mutually authenticated too. Monitoring stays on loopback, or moves to https_port where it must be reachable from outside the host; the HTTPS monitor does not ask for client certificates (getMonitoringTLSConfig in server/server.go). The client port is reachable only from the platform network. Parties outside it reach the platform through its HTTPS edges, such as trogon-gateway and a2a-bridge.
An agent on ADR#0017's NATS binding is a direct NATS client, and it is admitted like every other tenant caller: it connects from the platform network with a client certificate from the platform CA, and the callout places it in its tenant account with its own allow lists. Whether any hop also verifies the binding's per-message signatures is decided in ADR#0082, which runs proof of possession at the external HTTP edge and on no NATS hop; transport admission neither depends on those signatures nor replaces them. An agent outside the platform network has no route to the client port and reaches the platform through an HTTPS edge.
6. JetStream encrypts at rest with a key read from OpenBao
Every JetStream server sets cipher and key. The cipher is chacha, or aes where FIPS-140 mode is required, because nats-server 2.14.1 rejects chacha in that mode (server/opts.go:2621-2633). The key never lives in an image, the repository or a configuration file. The deployment reads it at startup from a platform-operator mount in OpenBao and passes it to the server through the environment, which the configuration references as key: $JS_KEY, following ADR#0007's rule that secrets come from the environment or the deployment rather than from configuration files. OpenBao does not depend on NATS, so this adds no cycle to ADR#0033's boot chain. A JetStream server cannot restart while OpenBao is unreachable, which is the same restart dependency ADR#0052 accepts for OpenBao's own seal.
Rotation happens in place. Restarting with the new key in key and the old one in prev_key makes the server open each stream with whichever key works, regenerate its key files under the new key, and convert each message block (server/jetstream.go:274-317 and :1520-1529, server/filestore.go:1360-1447). A cipher change converts the same way, and a store written in plaintext is encrypted on its first start with a key. prev_key is removed once the conversion has finished, and an old key is kept until no copy of a store written under it remains.
Encryption at rest is server-wide. It protects disks and their copies, not one tenant's data from another's; the account boundary does that.
7. The dev compose stack runs the same topology
The compose stack runs the topology above rather than a plaintext stand-in: an operator, the full resolver, SYS, AUTH, PLATFORM and a development tenant, TLS from a development CA with verify: true, and an encrypted store. A one-shot bootstrap service, in the pattern openbao-bootstrap already follows (devops/docker/compose/compose.yml:128-154), generates the operator, the accounts and their users with nsc, along with the development CA, the certificates and the store key, on first start, and is a no-op afterwards. No private key, seed or credentials file is committed; each checkout generates its own. No compose service sets NATS_TLS_DISABLED, and the healthcheck runs inside the container against the loopback monitor.
8. What this supersedes and amends
This decision supersedes the fail-open client default and its documentation (rsworkspace/crates/platform/trogon-nats/README.md:22, devops/docker/compose/.env.example:52), the direct connects in the a2a crates, the plaintext compose NATS server (devops/docker/compose/compose.yml:4-18), and the "allow plaintext" framing wherever it appears.
It amends ADR#0015: the workspace has one rustls provider, aws-lc-rs, and in-process TLS is the norm for NATS clients rather than the exception. It amends ADR#0055: inside PLATFORM, {tenant} is the account public key, exempt from the lower_snake rule. It refines ADR#0033's boot-key rule as the admission decision above describes.
Under ADR#0023, callout-minted tenant JWTs still authenticate tenant callers of the secrets service, and the tenant still comes from the authenticated connection, now through the account key the server authorized in the subject. Platform consumers connect as PLATFORM users, and how they resolve secrets on a tenant's behalf is outside this decision.
Alternatives Considered
Keep TLS opt-in and document it. This is today's behavior. A forgotten variable stays a silent downgrade, and no documentation makes that failure visible at runtime.
Terminate NATS TLS in a sidecar or service mesh. The server and the callout would see the proxy instead of the client's certificate, so verify: true and the certificate scheme would stop identifying anyone. A plaintext hop would remain between the proxy and the process, and clients that follow the server URLs a cluster advertises would bypass the proxy unless advertising is turned off. The compose stack and self-hosted deployments have no mesh to rely on.
Config-mode accounts with a configuration-file callout. Every new tenant would need a server configuration change and reload, tenant boundaries would live in a file that every server must agree on, and the callout user would keep a static password.
allowed_accounts: ["*"] on AUTH. The callout could place users into any account the operator has signed, and the tenant's registration of the callout signing key would be the only check left. An explicit list keeps a second, independent control at the cost of updating AUTH whenever a tenant is onboarded.
One shared account with {tenant} prefixes in production. Isolation would rest on permissions alone, so one permission mistake would cross tenants. ADR#0055 already makes the account the primary boundary.
A scoped callout signing key. A scope would cap what the callout can mint for a tenant, but nats-server would then take each user's permissions from the scope's template, so per-caller allow lists would have to be expressed through template tags. That trade is not taken now.
A host-local secrets broker that mints the NATS JWTs in place. A per-host daemon such as Basil keeps the operator, account and callout signing seeds in its backend, admits a caller by the kernel's uid of the socket peer, and signs user JWTs on request, so no service process ever holds a seed. The custody shape is the one ADR#0023 and ADR#0033 already chose, with the secrets service in the broker's place; what the daemon adds is a uid as the admission credential and a second policy language in front of the same OpenBao. A uid identifies nothing across containers, which is the only deployment this repository ships, and the project is pre-1.0 with an unfrozen API. The in-place signing itself is kept as the target: once Decision 4's ordering holds, the callout signs through KeyManagement and holds no seed, which is the evolution ADR#0033 leaves open.
Rotating the JetStream key by migrating streams. Copying every stream into a new store is unnecessary when the server converts in place with prev_key.
Consequences
- The ADR#0015 amendment lands before anything turns TLS on, so no binary can hit the provider panic. The TLS default in
trogon-nats, the a2a migration and the compose topology then land together, so no environment needsNATS_TLS_DISABLEDas a stopgap. - The operator signing key and the account signing keys, the callout signing key among them, live in a platform-operator OpenBao mount that deployment tooling reads outside the
SecretStoreandKeyManagementports, as ADR#0033 requires of boot keys. The operator identity key stays offline. - JetStream servers gain a start dependency on OpenBao for their store key.
- nsc becomes a bootstrap dependency of the dev stack and of deployment tooling.
- Onboarding a tenant becomes a JWT push instead of a server reload: create the account, register the callout signing key and the imports, push it, and push
AUTHwith the updatedallowed_accounts, andPLATFORMtoo when it imports a service from the tenant. Operator tooling does this with itsSYSuser; self-service onboarding is a later decision. The resolver runs withallow_delete: false, so offboarding disables or revokes an account rather than deleting it. - Every NATS client needs a certificate from the platform CA, so issuing and rotating client certificates becomes deployment work, and each of the bridge's per-caller connections pays for a TLS handshake.
a2a-auth-calloutchanges:issuer_accountnames the tenant account, the user JWT is signed by the callout signing key that tenant registers, the authorization response is signed by anAUTHsigning key, and credential selection readsauth_token,userandpassbefore the certificate. Its server tests move to operator mode and run under ADR#0010's Testcontainers rule instead of staying ignored.trogon-gatewayandtrogon-provider-gatewaystop installing a crypto provider themselves, and any other library path that builds a rustls configuration from the process default uses the same idempotent install astrogon_nats::connect.- Subjects inside
PLATFORMspend 57 bytes and one token of ADR#0055's budget on the account key. - An import rewrites the subject between the exporting and the importing account, which is the subject rewriting that ADR#0051 Decision 6 leaves unsupported in front of signed subjects, so a signature over a subject does not survive a hop between a tenant account and
PLATFORM. - Monitoring moves to loopback or
https_port, so anything that scraped the plain monitor port from outside the host has to change. - A FIPS-140 deployment uses
aes. nats-server in that mode also refuses the configuration-file callout and creates no server xkey (server/opts.go:4555-4558,server/server.go:709-712), so such a deployment proves the account-JWT callout in that mode before relying on it.
References
- ADR#0003: AI Protocol Transport Taxonomy
- ADR#0007: Configuration Sources
- ADR#0010: Unit Tests First, Testcontainers Only When Necessary
- ADR#0015: Rust TLS Library
- ADR#0017: AAuth Agent Authentication over a Trogon NATS PoP Binding
- ADR#0023: Secret Management and Key Custody on OpenBao behind a Platform Secrets Service
- ADR#0027: Declared Subject Scope for Decider Stream Resolution
- ADR#0033: Key Custody Product Model
- ADR#0042: NATS Trace Context and Message Path Tracing
- ADR#0051: Fully Bound Per-Request Signing Contract
- ADR#0052: Cloud KMS Auto-Unseal Is Mandatory for Production OpenBao
- ADR#0055: NATS Subject Design for JSON-RPC Protocol Bindings
- async-nats 0.50.0
src/tls.rs - async-nats 0.50.0
src/connector.rs - rustls 0.23.46
src/crypto/mod.rs - nats-server 2.14.1
server/auth_callout.go - nats-server 2.14.1
server/auth.go - nats-server 2.14.1
server/accounts.gocheckAuth - nats-server 2.14.1
server/accounts.goisAllowedAcount - nats-server 2.14.1
server/jetstream.go - nats-server 2.14.1
server/stream.gocheckStreamCfg - nats-server 2.14.1
server/jetstream.goconfigJetStream - nats-server 2.14.1
server/filestore.goconvertCipher - nats-server 2.14.1
server/opts.gosetJetStreamEkCipher - nats-server 2.14.1
server/server.gogetMonitoringTLSConfig - nats-io/jwt v2.8.1
v2/exports.go - nats-io/jwt v2.8.1
v2/imports.go - nats-io/jwt v2.8.1
v2/account_claims.goIsJSEnabled - nats-io/jwt v2.8.1
v2/account_claims.goExternalAuthorization - nats-io/jwt v2.8.1
v2/account_claims.goNewAccountClaims - nats-io/jwt v2.8.1
v2/signingkeys.go - NATS ADR-26: NATS Authorization Callouts
- NATS auth callout
- NATS decentralized JWT authentication
- NATS account resolvers
- NATS JetStream encryption at rest
- NATS TLS
- nsc
- Basil documentation
