hashicorp / nomad

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
https://www.nomadproject.io/
Other
15k stars 1.96k forks source link

Vault integration upgrade based on Workload Identity #15617

Closed mikenomitch closed 1 year ago

mikenomitch commented 1 year ago

Proposal

Once Workload Identity upgrades make it into Nomad, we can redo the Vault integration to use these tokens as the source of auth instead of manually provided Vault tokens.

Using these tokens, Nomad Users would have a one-time set up process to integrate Nomad workloads into Vault.

The general flow for setting up the Vault-Nomad integration would be:

This would involve an up front cost to set up roles in Vault, but after that no management of tokens would be needed.

Use Cases & Advantages

This would be advantageous in many ways:

Potential simultaneous improvements

While not directly related, there are a few other Vault improvements that should be considered while we do this upgrade:

tgross commented 1 year ago

Example of a motivating use case: https://github.com/hashicorp/nomad/issues/16639

tgross commented 1 year ago

Shipped in Nomad 1.7.0-beta.1

tomqwpl commented 9 months ago

Hi, would it be expected that to successfully retrieve the JWKS, you need to have verify_https_client set to "false"? If I have that set to true, it is expected that the client present a TLS certificate (mutual TLS), but Vault isn't going to do that, so the retrieval of JWKS fails? Thanks.

tgross commented 9 months ago

@tomqwpl yeah that's right. We should probably update the verify_https_client docs to point out that it's safe to have verify_https_client=true for the API in general in the Nomad security model (so long as you've got ACLs enabled).

tomqwpl commented 9 months ago

that it's safe to have verify_https_client=true for the API in general

Do you mean "true" here? I'm assuming you mean "false"? I see in fact that the docs say "false". I suspect we've enabled it because we're doing no further authentication to nomad, but I would need to clarify that.

Thanks.

tgross commented 9 months ago

Do you mean "true" here? I'm assuming you mean "false"? I see in fact that the docs say "false".

:facepalm: yes, sorry.

I suspect we've enabled it because we're doing no further authentication to nomad, but I would need to clarify that.

Yeah in that case you really so want to enable TLS verification for the HTTP API. But it's not recommended to have ACLs disabled.