You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like for each secret keyword in a template, consul-template spawns a new query to Vault, and all queries are spawned simultaneously. This makes rendering a simple template easily a DoS to the Vault.
For example, if consul-template renders a file with 10k secrets, it can be observed that the single process starts 10K concurrent tcp connections to Vault all at a time.
In our environment, 20 pods can easily bring Vault to 700K GoRoutines. Potentially it crashed the Vault quorum.
We are using
vault agent
to render templates.It looks like for each
secret
keyword in a template, consul-template spawns a new query to Vault, and all queries are spawned simultaneously. This makes rendering a simple template easily a DoS to the Vault.For example, if consul-template renders a file with 10k
secret
s, it can be observed that the single process starts 10K concurrent tcp connections to Vault all at a time.In our environment, 20 pods can easily bring Vault to 700K GoRoutines. Potentially it crashed the Vault quorum.
Consul Template version
I am using
vault agent
with Vault version 1.15.0.Configuration
config.hcl
:/tmp/test.gotmpl
-- This simply listsecret/test-kv
path, and render all secrets to under the path to the output file:/tmp/token
: content isroot
.Command
test-kv
.Debug output
The vault agent during rendering starts 16K tcp connections, which is even more than the count of secrets (10000).
Expected behavior
consul-template should have a http connection pool which limits the concurrent requests it's sending to Vault.
Actual behavior
consul-template spawns as many requests as
secret
to render, DoSing server.The text was updated successfully, but these errors were encountered: