Configuration

Configuration loading and global settings

This page covers how the configuration is loaded, secret references, external keys, the top-level keys, and environment overrides. The configuration hub links every section.

0.11.x

This page covers how the configuration is loaded, secret references, external keys, the top-level keys, and environment overrides. The configuration hub links every section.

Paths in the tables are relative to the section heading. Each row gives the type and the default, or what an unset value means. Keep secrets in protected files or environment variables. Check parsing, unknown keys, and cross-field rules with gdsgate doctor --config <PATH> --json. Examples: configuration templates.

gdsgate config schema prints the configuration JSON Schema. Platform-specific values appear under x-gdsgate-platform-defaults, with separate linux and windows entries. The schema is identical on both platforms; each runtime continues to use its own default paths.

Layering

The effective config is built in three layers:

  1. Defaults: the loopback development profile and each field's default. Fields without a default stay unset until configured.
  2. TOML file from --config. A field present in the file overrides the default.
  3. Environment. A GDSGATE_* variable that is set overrides the file. See Environment overrides.

Secret references

A secret value, or a path to one, can be written as a reference to where the secret is kept. A value whose whole string is ${scheme:argument} is a reference. Any other value is read literally: ${file:unclosed and $TOKEN are literal values.

Scheme Value
(no prefix) The value; for a parameter that names a path, the file at that path.
file:PATH The file's contents, trailing newline stripped.
env:NAME An environment variable of the process.
exec:COMMAND ARG... Standard output of a command, trailing newline stripped.
kms.<name>+<source> The ciphertext <source> yields (file:, env: or exec:), unwrapped by the key <name> of [[kms_keys]]. See Wrapping a source.
toml
store_password_file = "${exec:/usr/local/bin/gdsgate-unwrap store}"  # a helper's standard output

[security.integrity]
control_keyring = "/var/lib/gdsgate/authority/control.keys"          # bare path, unchanged
audit_keyring   = "${file:/var/lib/gdsgate/authority/audit.keys}"    # the same thing, written out

[proxy]
public_key_file = "${env:PUBLIC_TLS_KEY}"                            # a variable of this process

A parameter that names a path reads a bare value as a file path: control_keyring = "/var/lib/gdsgate/authority/control.keys" and control_keyring = "${file:/var/lib/gdsgate/authority/control.keys}" are the same. A parameter that holds a value (a delegation profile's env entries, the enrollment token) reads a bare value as the value.

What accepts it

Parameter Documented at
[security.integrity].control_keyring Security
[security.integrity].audit_keyring Security
[audit].anchor_key_path (deprecated) Operations
[audit].approval_key_path (deprecated) Operations
[audit].revocation_key_path (deprecated) Operations
[audit].delegation_key_path (deprecated) Operations
[audit].inventory_key_path (deprecated) Operations
[authority].enroll_key_file Authority
[proxy].web_key_file Proxy
[proxy].webapps_key_file Proxy
[proxy].public_key_file Proxy
store_password_file Top level
[enroll].token Enrollment
[[connector.backends]].service_account_password_file Connector
[[connector.backends]].token_path Connector
[[connector.backends]].credential_file Connector
[connector.backends.discovery].password_file Connector

Running a command

exec: runs a helper and uses its standard output as the value. Use it for a hardware module or a secret store gdsgate has no driver for.

Rule Behavior
No shell The string is split on whitespace and the first word is executed. Pipelines, redirects and arguments with spaces are not possible; use a wrapper script.
Input and output The value is read from standard output. Standard input is empty.
Exit code A nonzero exit leaves the parameter unresolved; the process does not start.
Environment Inherited unchanged. The helper's own credentials must already be in it.
Timeout 30 seconds, then the command is killed and the reference refused.

References are resolved when the configuration loads. Listener certificate keys (web_key_file, webapps_key_file, public_key_file, enroll_key_file) are resolved again each time the certificate file changes.

env: and where it shows up

env: reads a variable of the process environment. Use it for values passed on to a child process's environment, such as a delegation profile's env entries. For the parameters in the table above, use file: or exec:. The process environment is readable through /proc/<pid>/environ on Linux and appears in crash dumps.

gdsgate doctor reports which form each covered parameter is using, without reading the material behind it.

Wrapping a source: ${kms.<name>+<source>}

A file:, env: or exec: source can hold ciphertext under a key held by an external service. The kms.<name>+ prefix names the [[kms_keys]] entry that unwraps it. <name> can be left out only while [[kms_keys]] declares one key. An undeclared name, or a missing name with more than one key declared, is refused when the configuration loads.

Written Means
${kms.<name>+file:PATH} The file holds ciphertext; the key <name> unwraps it.
${kms.<name>+env:VAR} The variable holds ciphertext; the key <name> unwraps it.
${kms.<name>+exec:CMD} The command's standard output is ciphertext; the key <name> unwraps it.
${kms+file:PATH} (name left out) As above, meaning the single key [[kms_keys]] declares.

Nested wrappers (${kms.a+kms.b+file:PATH}) are refused. A wrapped source that holds a plain keyring document is refused before the key is called.

Only [security.integrity].control_keyring and .audit_keyring accept the prefix. The other parameters in What accepts it refuse a ${kms...} value; the error names the parameter.

A wrapping key supports three actions:

Action Given Gets back
unwrap ciphertext the material
wrap the material ciphertext
generate nothing fresh material and its ciphertext, together, in one answer

authority init and keys rotate --prepare call generate for a wrapped keyring. wrap writes a wrapped keyring back; a keyring is wrapped as one document, so adding a key or converting from the five legacy key files calls it. Material is never passed in an argument. A nonzero exit is a refusal; a start that cannot reach the key stops. The output of a refused call is not copied into the error message.

For the exec kind, command runs with the action word appended. The rules of running a command apply: no shell, a 30-second timeout.

Action Argument appended Standard input Standard output
unwrap unwrap the ciphertext the material
wrap wrap the material the ciphertext
generate generate nothing {"ciphertext":"...","plaintext":"..."}, both base64

The native kinds perform the same three actions through their service's API; see [[kms_keys]] for the build features.

[[kms_keys]]

Used by: Authority.

External wrapping keys: what a ${kms.<name>+...} reference names, and what [authority].ca_kms_key names. A key here wraps and unwraps; it never leaves its service. A key-value secret store is read through exec: as a source and is not declared here. For Vault and OpenBao, provider = "vault" uses the transit engine.

Key Type Default Purpose
name string required What a wrapper names between kms. and +. See naming below.
provider string required exec, vault, aws, or gcp. Which of the fields below this row reads.
command array of strings [] Required for exec: the program and its arguments. The action word is appended when it runs. Arguments with spaces need no quoting.
key string "" Required for the native kinds. vault: the key name in the transit engine. aws: an ARN, alias, or key id. gcp: the key's full resource name.
address string "" Service base URL. Required for vault. Optional for aws: an interface or compliance endpoint to use in place of the region's public one. Not used by gcp.
mount string "" vault only: where the transit engine is mounted. Empty means transit.
region string "" aws only: which region the key lives in.
toml
[[kms_keys]]
name     = "audit"
provider = "exec"
command  = ["/usr/local/bin/gdsgate-kms", "--key", "audit"]
toml
[[kms_keys]]
name     = "audit"
provider = "vault"
address  = "https://vault.example.invalid:8200"
mount    = "kms-transit"
key      = "gdsgate-audit"

[[kms_keys]]
name     = "control"
provider = "aws"
region   = "eu-central-1"
key      = "arn:aws:kms:eu-central-1:123456789012:key/2f1c"

[[kms_keys]]
name     = "ca"
provider = "gcp"
key      = "projects/p/locations/europe-west1/keyRings/r/cryptoKeys/k"

Credentials for the native kinds come from the process environment. gdsgate stores none. Sources are read in this order; the first found is used:

Kind Credentials
vault VAULT_TOKEN, then ~/.vault-token. VAULT_NAMESPACE sets the namespace; VAULT_CACERT names a private CA.
aws AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (with AWS_SESSION_TOKEN for temporary credentials), then container runtime credentials, then the instance role from the metadata service.
gcp The service-account file in GOOGLE_APPLICATION_CREDENTIALS, then the instance identity from the metadata service.

Each native kind requires a build with its feature: kms-vault, kms-aws, or kms-gcp. exec is in every build. A key whose kind the binary lacks is refused at start-up; the error names the missing feature.

There is no pkcs11 kind. For a PKCS#11 hardware module, a KMIP device, or another key service, use provider = "exec" with a helper built against the vendor's library.

Naming a key

Declare separate keys for the control keyring and the audit keyring. Access to each can then be revoked separately at the key service. See [security.integrity]. Keys under different providers can be mixed.

A reference may leave the name out only while one key is declared; see Wrapping a source.

Supported service versions

vault works with Vault 1.18.5 and OpenBao 2.6.2.

The direct-encryption limit

AWS KMS encrypts at most 4096 bytes in one Encrypt or Decrypt call. A CA seed is 32 bytes. A wrapped keyring is sent as one document and fits up to 20 sealing keys or 14 signing keys. Retire old keys with keys rotate --retire to stay under the limit. A keyring over the limit is refused before anything is sent; the error names the limit and the size.

Top level

Used by: Authority, Proxy, Connector, and the foreground Resident client (profile); Authority (store_url, store_password_file, store_auto_migrate).

Key Type Default Purpose
cluster_id string (optional) unset for legacy configurations Stable cluster binding saved by connect/join. Registration checks it before sending a join token; certificate renewal preserves it. Do not copy it between clusters.
profile string (optional) unset, no deployment label Deployment name. Labels service metrics, logs, and exported traces. The foreground Resident client labels its journal but exports no service metrics or traces.
store_url string (optional) unset, ~/.gdsgate/state/store.db (persistent file SQLite) Authority state backend: audit chain, transport CA private key, SSH CAs, registration tokens, resource catalog. SQLite (file or :memory:) or PostgreSQL. :memory: is for tests only.
store_password_file string (optional) unset PostgreSQL password, kept out of store_url. A path or a secret reference.
store_auto_migrate bool true A starting service applies pending schema migrations. With false, a store with pending migrations stops the process; the error names how many are pending and the command that applies them.
toml
profile = "prod-eu"
store_url = "postgres://gdsgate@store-db.example.invalid:5432/gdsgate"
store_auto_migrate = false   # schema changes are a step of the rollout

With profile set, each service Prometheus series carries profile="<value>", each structured service log line carries a profile field, and each exported trace carries a profile resource attribute. See Metrics and health.

The value is 1 to 64 bytes from A-Z a-z 0-9 . _ -, read once at start-up. Requests, headers and tokens cannot set it. Environment: GDSGATE_PROFILE.

An invalid value stops authority, proxy, connector, all, and gdsgate up --foreground at start; the error names the character. Other commands run without the label and print a warning on stderr. gdsgate doctor reports it as a config.profile finding.

store_url unset means a persistent SQLite file at ~/.gdsgate/state/store.db. Set it for PostgreSQL or another path. sqlite::memory: loses everything on restart.

store_password_file keeps the PostgreSQL password out of store_url, which then carries only the user (postgres://gdsgate@store-db.example.invalid:5432/gdsgate). Setting both this field and a password inside store_url is refused at start-up. A password inside store_url still works and is redacted in output; gdsgate doctor warns about it. Environment: GDSGATE_STORE_PASSWORD_FILE.

Set store_auto_migrate = false to apply schema changes as a separate step: run gdsgate authority store migrate once, then start the services. A store whose schema is newer than the binary is always refused. Environment: GDSGATE_STORE_AUTO_MIGRATE.

[store.pools]

Used by: Authority and commands that open its state backend. Available in rc.13. Each named pool has independent capacity and timeouts:

Section Default maximum Purpose
[store.pools.main] 28 Working queries and writes.
[store.pools.discovery] 8 Fresh read-only discovery and transport identity lookup.
[store.pools.readiness] 2 Fresh database and leadership readiness checks.

The following keys apply within each named section. Omitted keys retain that pool's defaults, including when only a timeout is configured.

Key Type Default Purpose
max_connections u32, positive per section above Maximum open connections, including busy and idle connections.
min_connections u32 0 Minimum connections maintained after the pool opens. Must not exceed max_connections.
acquire_timeout_ms u32, positive 30000 Maximum wait to obtain a usable connection, including connection opening and checks. Does not limit SQL execution time.
idle_timeout_secs u32 600 Retire unused connections after this interval, respecting the minimum. 0 disables idle retirement.
max_lifetime_secs u32 1800 Retire aged connections when they return to the pool. 0 disables lifetime retirement. Active operations are not interrupted.
toml
store_url = "postgres://gdsgate@store-db.example.invalid:5432/gdsgate"

[store.pools.main]
max_connections = 28
min_connections = 0
acquire_timeout_ms = 30000
idle_timeout_secs = 600
max_lifetime_secs = 1800

[store.pools.discovery]
max_connections = 8

[store.pools.readiness]
max_connections = 2

These are limits for each pool in one process, not a cluster-wide connection budget. With the default maxima, these three pools can use up to 38 connections per Authority. Include every Authority, dedicated heartbeat and audit verification/recovery connections, other database clients and administrative headroom when sizing PostgreSQL max_connections. The dedicated heartbeat connection and each audit snapshot/recovery handle retain their single-connection limits; these settings do not change them. Reserved pools open on first use; their minimum does not prewarm them at process startup.

Pool tuning currently applies to PostgreSQL. SQLite keeps its existing behavior; non-default pool settings with a non-PostgreSQL store_url are refused. Unknown pool names and parameters, zero maxima or acquisition timeouts, and a minimum above its maximum are refused. Validate with gdsgate config check authority.toml --role authority --json before rollout.

Pool changes require an Authority restart. A reload containing such a change is refused. In HA, restart one Authority at a time and check readiness before continuing. The top-level store_url, store_password_file and store_auto_migrate retain their existing locations.

For the complete list of supported keys, types and default values, use gdsgate config schema or the published JSON Schema. The configuration pages explain how to choose those values for each role.

Environment overrides

Each variable below overrides the file when it is set.

Variable Overrides
GDSGATE_PROFILE profile
GDSGATE_STORE_URL store_url
GDSGATE_STORE_PASSWORD_FILE store_password_file
GDSGATE_STORE_AUTO_MIGRATE store_auto_migrate
GDSGATE_AUTH_ADDR endpoints.authority
GDSGATE_AUTH_ENROLL_ADDR endpoints.authority_enroll
GDSGATE_PROXY_PUBLIC_ADDR endpoints.proxy_public
GDSGATE_PROXY_INTERNAL_ADDR endpoints.proxy_internal
GDSGATE_PROXY_WS_ADDR endpoints.proxy_ws
GDSGATE_PROXY_JOIN_ADDR endpoints.proxy_join
GDSGATE_ENROLL_ENDPOINT enroll.endpoint
GDSGATE_ENROLL_TOKEN enroll.token
GDSGATE_ENROLL_STATE_DIR enroll.state_dir
GDSGATE_ENROLL_RENEW_ENDPOINT enroll.renew_endpoint
GDSGATE_ENROLL_NODE_NAME enroll.node_name
GDSGATE_CLIENT_TRANSPORT_CA client.transport_ca
GDSGATE_CLIENT_TRANSPORT_SNI client.transport_sni
GDSGATE_CLIENT_ALLOW_INSECURE_HTTP client.allow_insecure_http
GDSGATE_PROXY_SINGLE_PORT proxy.single_port
GDSGATE_PROXY_PEER_ADDR proxy.peer_addr
GDSGATE_PROXY_PEER_LISTEN proxy.peer_listen
GDSGATE_POLICY_PATH policy.path
GDSGATE_OIDC_ISSUER oidc.issuer
GDSGATE_OIDC_CLIENT_ID oidc.client_id
GDSGATE_OIDC_AUDIENCE oidc.audience
GDSGATE_OIDC_ALLOW_INSECURE_HTTP oidc.allow_insecure_http
GDSGATE_OIDC_JWKS_REFRESH_SECS oidc.jwks_refresh_secs
GDSGATE_OIDC_REQUEST_TIMEOUT_SECS oidc.request_timeout_secs
GDSGATE_IDENTITY_ALLOW_SYSTEM_GROUPS identity.allow_system_groups
GDSGATE_IDENTITY_MAX_LENGTH identity.max_length
GDSGATE_IDENTITY_MAX_GROUPS identity.max_groups
GDSGATE_CONNECTOR_ID connector.id
GDSGATE_CONNECTOR_AUTH_TRANSPORT connector.authority_transport
GDSGATE_CA_ROTATION_ENABLED ca_rotation.enabled
GDSGATE_CA_ROTATION_INTERVAL_SECS ca_rotation.interval_secs
GDSGATE_CA_ROTATION_PROACTIVE_SECS ca_rotation.proactive_secs
GDSGATE_CA_ROTATION_PROPAGATION_SECS ca_rotation.propagation_secs
GDSGATE_CA_ROTATION_RETIRE_SECS ca_rotation.retire_secs
GDSGATE_CA_ROTATION_CHECK_SECS ca_rotation.check_secs
GDSGATE_HA_ENABLED ha.enabled
GDSGATE_HA_OWNER ha.owner
GDSGATE_HA_LEASE_TTL_SECS ha.lease_ttl_secs
GDSGATE_HA_RENEW_SECS ha.renew_secs
GDSGATE_AUDIT_ANCHOR_KEY_PATH audit.anchor_key_path (deprecated)
GDSGATE_AUDIT_APPROVAL_KEY_PATH audit.approval_key_path (deprecated)
GDSGATE_AUDIT_REVOCATION_KEY_PATH audit.revocation_key_path (deprecated)
GDSGATE_AUDIT_DELEGATION_KEY_PATH audit.delegation_key_path (deprecated)
GDSGATE_AUDIT_INVENTORY_KEY_PATH audit.inventory_key_path (deprecated)
GDSGATE_AUDIT_EXPORT_PATH audit.export_path
GDSGATE_TELEMETRY_METRICS_LISTEN telemetry.metrics_listen
GDSGATE_TELEMETRY_OTEL_ENDPOINT telemetry.otel_endpoint
GDSGATE_ADMIN_ENDPOINT admin.endpoint
GDSGATE_ADMIN_IDENTITY_DIR admin.identity_dir
GDSGATE_ADMIN_TRANSPORT admin.transport

Client-only variables:

Variable Purpose
GDSGATE_ID_TOKEN Identity token a client command should present (headless / CI).
GDSGATE_USER Local-dev principal name when no [oidc] is configured.
RUST_LOG Log filter. Default warn,gdsgate=info: gdsgate* at INFO, everything else at WARN. A set value replaces the default.

[[connector.backends]] has no environment override.

Search this documentation edition.