-
Notifications
You must be signed in to change notification settings - Fork 475
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
Spire-Agent is failing to rotate its SVID due to Missing KeyManager directory #5488
Comments
We can have the check in the Configure function, so we can fail the agent startup if the directory does not exist. This is really a pre-requisite for the plugin to work. |
That's true but we saw the issue at runtime when the directory path gets deleted for some reason. Our agents were healthy but couldn't rotate key due to missing directory. |
@amartinezfayo Do we want to address both checks in this issue.
|
I think the answer to these 2 questions is log error (also emit metric?) and crash agent. I would argue that is better than quietly failing to rotate keys, but it is a different trade-off. Maybe we do want to keep failure to rotate keys behavior, but make more noise about it? |
I personally don't think that the key manager should be creating directories. If the key manager is unable to rotate the key (due to an error writing the key to disk or other reason), I think that we should keep the current logic of retrying with backoff, and not just crash, because it could be recoverable. |
We noticed that due to missing KeyManager directory on the host, spire-agent is failing to rotate its keys.
To avoid this we could add a check in the disk keymanager 'writeEntries' method: https://github.com/spiffe/spire/blob/main/pkg/agent/plugin/keymanager/disk/disk.go#L108
The text was updated successfully, but these errors were encountered: