Secrets configuration reference
For other top-level configuration options, see:
- Global Options - Global settings like data directories and timezone
- Pipeline Components - Configure sources, transforms, sinks, and enrichment tables
- API - Configure Vector's observability API
- Schema - Configure Vector's internal schema system
Secrets management lets you keep sensitive configuration values like API keys, passwords, and tokens out of your Vector configuration files. Instead of writing a secret’s plaintext value directly into a config option, you configure a secret backend and reference the secret with SECRET[<backend name>.<secret name>]. Vector resolves these references by querying the backend when it loads the configuration, before any other config processing happens.
This is the recommended way to supply secrets to Vector, in preference to environment variable interpolation. Unlike environment variables, secret values are never written to the Vector process’s environment, so they can’t leak to anyone with access to /proc/<PID>/environ or similar. Note that, like environment variable interpolation, secret resolution substitutes the retrieved value directly into the configuration text before it’s parsed, so a secret value containing YAML/TOML syntax can still alter the parsed configuration; only pull secrets from backends and paths you trust.
Usage
Configure one or more backends under the top-level secret option, then reference secrets from that backend anywhere in your configuration using the SECRET[<backend name>.<secret name>] syntax:
secret:
backend_1:
type: "exec"
command: ["/path/to/cmd1"]
sources:
my_source_id:
type: "aws_sqs"
region: "us-east-1"
queue_url: "https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue"
auth:
access_key_id: "SECRET[backend_1.aws_access_key_id]"
secret_access_key: "SECRET[backend_1.aws_secret_access_key]"
Here, auth.access_key_id and auth.secret_access_key are resolved using secrets named aws_access_key_id and aws_secret_access_key, retrieved from the backend_1 secret backend. You can reference the same backend from multiple places in your configuration, and you can configure multiple backends if you need to pull secrets from more than one source.
The backend name portion supports only letters, digits, and _; backend names containing - aren’t addressable from a SECRET[...] reference (known issue), even though - is otherwise a valid character in a backend’s component ID. The secret name portion is more permissive and supports ., -, and / characters, so backends that key secrets hierarchically (such as the directory backend, below) can be referenced like SECRET[backend_1.nested/secret_name].
Text that matches the SECRET[<backend name>.<secret name>] grammar but can’t be resolved — for example, because the backend doesn’t recognize the requested secret name, returns an error, or returns an empty value — causes Vector to log the error and exit during configuration loading. Secrets are never partially applied. Text that doesn’t match the grammar at all, for example a backend name containing -, is left in the configuration as a literal string instead, with no resolution error.
secret
optional objectsecret.*
required objectsecret.*.auth
optional objecttype = "aws_secrets_manager"secret.*.auth.assume_role
required stringsecret.*.auth.credentials_file
required stringsecret.*.auth.external_id
optional stringsecret.*.auth.imds
optional object1(seconds)4secret.*.auth.load_timeout_secs
optional uintTimeout for successfully loading any credentials, in seconds.
Relevant when the default credentials chain or assume_role is used.
secret.*.auth.profile
optional stringThe credentials profile to use.
Used to select AWS credentials from a provided credentials file.
defaultsecret.*.auth.region
optional stringThe AWS region to send STS requests to.
If not set, this defaults to the configured region for the service itself.
secret.*.auth.secret_access_key
required stringsecret.*.auth.session_name
optional stringThe optional RoleSessionName is a unique session identifier for your assumed role.
Should be unique per principal or reason. If not set, the session name is autogenerated like assume-role-provider-1736428351340
secret.*.auth.session_token
optional stringsecret.*.command
required [string]Command arguments to execute.
The path to the script or binary must be the first argument.
type = "exec"secret.*.endpoint
optional stringtype = "aws_secrets_manager"secret.*.path
required stringtype = "file" or type = "directory"secret.*.protocol
optional objecttype = "exec"secret.*.protocol.backend_config
optional *config field in the
backend request. Refer to the documentation of your backend_type to see which options
are required to be set.version = "v1_1"secret.*.protocol.backend_type
required stringtype field in the backend request.version = "v1_1"secret.*.protocol.version
optional string enum| Option | Description |
|---|---|
v1 | Expect the command to fetch the configuration options itself. |
v1_1 | Configuration options to the command are to be curried upon each request. |
v1secret.*.region
optional stringtype = "aws_secrets_manager"secret.*.remove_trailing_whitespace
optional booltype = "directory"falsesecret.*.secret_id
required stringtype = "aws_secrets_manager"secret.*.timeout
optional uinttype = "exec"5secret.*.tls
optional objecttype = "aws_secrets_manager"secret.*.tls.alpn_protocols
optional [string]Sets the list of supported ALPN protocols.
Declare the supported ALPN protocols, which are used during negotiation with a peer. They are prioritized in the order that they are defined.
secret.*.tls.ca_file
optional stringAbsolute path to an additional CA certificate file.
The certificate must be in the DER or PEM (X.509) format. Additionally, the certificate can be provided as an inline string in PEM format.
secret.*.tls.crt_file
optional stringAbsolute path to a certificate file used to identify this server.
The certificate must be in DER, PEM (X.509), or PKCS#12 format. Additionally, the certificate can be provided as an inline string in PEM format.
If this is set and is not a PKCS#12 archive, key_file must also be set.
secret.*.tls.key_file
optional stringAbsolute path to a private key file used to identify this server.
The key must be in DER or PEM (PKCS#8) format. Additionally, the key can be provided as an inline string in PEM format.
secret.*.tls.key_pass
optional stringPassphrase used to unlock the encrypted key file.
This has no effect unless key_file is set.
secret.*.tls.server_name
optional stringServer name to use when using Server Name Indication (SNI).
Only relevant for outgoing connections.
secret.*.tls.verify_certificate
optional boolEnables certificate verification. For components that create a server, this requires that the client connections have a valid client certificate. For components that initiate requests, this validates that the upstream has a valid certificate.
If enabled, certificates must not be expired and must be issued by a trusted issuer. This verification operates in a hierarchical manner, checking that the leaf certificate (the certificate presented by the client/server) is not only valid, but that the issuer of that certificate is also valid, and so on, until the verification process reaches a root certificate.
Do NOT set this to false unless you understand the risks of not verifying the validity of certificates.
secret.*.tls.verify_hostname
optional boolEnables hostname verification.
If enabled, the hostname used to connect to the remote host must be present in the TLS certificate presented by the remote host, either as the Common Name or as an entry in the Subject Alternative Name extension.
Only relevant for outgoing connections.
Do NOT set this to false unless you understand the risks of not verifying the remote hostname.
secret.*.type
required string enum| Option | Description |
|---|---|
aws_secrets_manager | AWS Secrets Manager. |
directory | Directory. |
exec | Exec. |
file | File. |