Files
threshold/website/content/docs/configuration/worker/kms-worker.mdx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

136 lines
4.3 KiB
Plaintext
Raw Normal View History

2022-06-22 00:37:49 -06:00
---
layout: docs
page_title: KMS worker configuration
2022-06-22 00:37:49 -06:00
description: |-
KMS worker-specific parameters.
---
2023-06-06 15:14:31 -07:00
# KMS worker configuration
2022-06-22 00:37:49 -06:00
2023-03-30 16:20:28 -04:00
This page describes configuration for workers that authenticate to upstreams
using a shared KMS. This mechanism auto-registers the worker in addition to
authenticating it, and does not require on-disk storage for credentials since
each time it connects it reauthenticates using the trusted KMS.
~> If using 0.13+ workers with pre-0.13 controllers you _must_ set the
`use_deprecated_kms_auth_method` value to true. Additionally, a worker
registered using this method _against a pre-0.13 controller_ will only be able
to register directly to a controller, and cannot be used as part of multi-hop or
Vault private access capabilities.
KMS Workers require a `name` field. This specifies a unique name of this worker
within the Boundary cluster and _must be unique across workers_. The `name`
value can be:
2022-06-22 00:37:49 -06:00
- a direct name string (must be all lowercase)
- a reference to a file on disk (`file://`) from which the name is read
- an env var (`env://`) from which the name is read.
2023-03-30 16:20:28 -04:00
KMS Workers accept an optional `description` field. The `description` value can
be:
2022-06-22 00:37:49 -06:00
- a direct description string
- a reference to a file on disk (`file://`) from which the name is read
- an env var (`env://`) from which the name is read.
```hcl
worker {
name = "example-worker"
description = "An example worker"
public_addr = "5.1.23.198"
2023-03-30 16:20:28 -04:00
# Uncomment if using 0.13 worker against pre-0.13 controller
# use_deprecated_kms_auth_method = true
2022-06-22 00:37:49 -06:00
}
```
2023-03-30 16:20:28 -04:00
KMS Workers also require a KMS block designated for `worker-auth`. This is the
KMS configuration for authentication between the workers and controllers and
must be present. Example (not safe for production!):
2022-06-22 00:37:49 -06:00
```hcl
2023-03-30 16:20:28 -04:00
kms "aead" {
2022-06-22 00:37:49 -06:00
purpose = "worker-auth"
aead_type = "aes-gcm"
2023-03-30 16:20:28 -04:00
key = "X+IJMVT6OnsrIR6G/9OTcJSX+lM9FSPN"
2022-06-22 00:37:49 -06:00
key_id = "global_worker-auth"
}
```
2023-03-30 16:20:28 -04:00
The upstream controller or worker must have a `kms` block that references the
same key and purpose. (If both a controller and worker are running as the same
server process only one stanza is needed.) It is also possible to specify a
`kms` block with the `downstream-worker-auth` purpose. If specified, this will
be a separate KMS that can be used for authenticating new downstream nodes.
Blocks with this purpose can be specified multiple times. This allows a single
upstream node to authenticate with one key to its own upstream (via the
`worker-auth` purpose) and then serve as an authenticating upstream to nodes
across various networks, each with their own separate KMS system or key:
2022-06-22 00:37:49 -06:00
```hcl
kms "aead" {
2023-03-30 16:20:28 -04:00
purpose = "downstream-worker-auth"
aead_type = "aes-gcm"
key = "XthZVtFtBD1Bw1XwAWhZKVrIwRhR7HcZ"
key_id = "iot-nodes-auth"
}
kms "aead" {
purpose = "downstream-worker-auth"
aead_type = "aes-gcm"
key = "OLFhJNbEb3umRjdhY15QKNEmNXokY1Iq"
key_id = "production-nodes-auth"
2022-06-22 00:37:49 -06:00
}
```
2023-03-30 16:20:28 -04:00
In the examples above we are encoding key bytes directly in the configuration
file. This is because we are using the `aead` method where you directly supply a
key; in production you'd want to use a KMS such as AWS KMS, GCP CKMS, Azure
KeyVault, or HashiCorp Vault. For a complete guide to all available KMS types,
see our [KMS documentation](/boundary/docs/configuration/kms).
2022-06-22 00:37:49 -06:00
2023-06-06 15:14:31 -07:00
## Complete configuration example
2022-06-22 00:37:49 -06:00
```hcl
listener "tcp" {
purpose = "proxy"
tls_disable = true
address = "127.0.0.1"
}
worker {
# Name attr must be unique across workers
name = "demo-worker-1"
description = "A default worker created for demonstration"
# Workers must be able to reach upstreams on :9201
initial_upstreams = [
"10.0.0.1",
"10.0.0.2",
"10.0.0.3",
]
public_addr = "myhost.mycompany.com"
tags {
type = ["prod", "webservers"]
region = ["us-east-1"]
}
2023-03-30 16:20:28 -04:00
# use_deprecated_kms_auth_method = true
2022-06-22 00:37:49 -06:00
}
# must be same key as used on controller config
kms "aead" {
purpose = "worker-auth"
aead_type = "aes-gcm"
2023-03-30 16:20:28 -04:00
key = "X+IJMVT6OnsrIR6G/9OTcJSX+lM9FSPN"
2022-06-22 00:37:49 -06:00
key_id = "global_worker-auth"
}
```
2023-01-20 18:17:34 -05:00
[`initial_upstreams`](/boundary/docs/configuration/worker/overview#initial_upstreams)
2022-06-22 00:37:49 -06:00
are used to connect to upstream Boundary clusters.
## Resources
2022-06-22 00:37:49 -06:00
For more on how `tags{}` in the above configuration are used to facilitate
routing to the correct target, refer to the [Worker
2023-01-20 18:17:34 -05:00
Tags](/boundary/docs/concepts/filtering/worker-tags) page.