-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consul key size limit hit with many identity entries #5597
Comments
One of the many benefits of the IAM method is that it has values that can be reused. See https://www.vaultproject.io/api/auth/aws/index.html#configure-identity-integration |
Putting on 1.0 milestone for discussion but will likely slip. |
While the underlying problem is that the storage imposes a size limit, there could be ways to delay reaching this limit, while satisfying the needs of the workflows. The primary reason which caused the problem in this case is that each ec2 instance with a new alias ID ( What if there were options to configure which property of the instance gets used as the alias ID? For example, if the |
If we had an option to add them to a common entry, for example based on ImageId, would vault not just create a new alias entry for each machine. And that would basically have the same problem. Or have I misunderstood how it would work? If the aliasing is not a problem then being able to group them according to an instance property like ImageID or VpcID would solve the problem for us. |
How can we work around this issue? |
You can upgrade to Consul 1.5.3 and increase the key value size limit or switch to the integrated Raft storage. Closing as this is handled now by those solutions, and it's now easier (and by default) to not hit this. |
@jefferai thanks! |
Describe the bug
The AWS auth method will create a new entity in the identity subsystem for each new host authenticating. These are never reaped and will eventually hit the limits of the storage engine. When this happens vault tend to crash and become unusable.
To Reproduce
Expected behavior
I had expected the identities to be reaped when the associated tokens expired. Or alternatively that it would not create a new identity entity for each new machine authenticating.
Environment:
Vault server configuration file(s):
The aws auth method configuration
A typical identity entry
Additional context
It has taken us a while to build up this number of identities but with lots of autoscaling we eventually got there. Each new machine has a unique instance-id which is why they each get a new entry in the identities subsystem. In our case the machines normally live for just a few hours and the token expire after 7 days.
Identifying the root cause of the issue we saw was not easy. There was nothing in the vault server logs or stdout/stderr so our only clue was the error message returned to the client when they tried to authenticate: {“errors”:[“failed to persist packed storage entry: Unexpected response code: 413 (Value exceeds 524288 byte limit)“]}
There was no indication what kind of storage entry was hitting that limit and I had t modify the source to find that.
Also getting the list of ids in the identity database was hard since the server would crash when I asked via the API. I had to modify the source to print the list to the log as it was generated.
Vault seems to spread these entities among 256 buckets which are stored in consul. The error happens when the used storage bucket would get bigger than 512Kb which is the maximum size of a value in consul.
The text was updated successfully, but these errors were encountered: