-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Reload TLS certificates for bundle downloads #1898
Comments
As far as implementation goes, one option is to just re-read the certificates each time a request is made (if OPA sees a partially written cert file, it will just log an error and retry later.) Another option would be to reload the config (and any referenced files) on SIGHUP. I took a look to figure out how much work this would be.
One option would be to modify the In either case, I noticed the rest client exports the underlying http client. I don't see a good reason for this so we should unexport it. As fr as plumbing goes, I would update the @patrick-east WDYT? |
Maybe for starters we just do the new client for each download attempt. Longer term I like the idea of supporting SIGHUP for config changes (works better for like side-car usages where you maybe don't want to just kill and start and new opa), but we maybe don't need it right now. |
The HTTP client we were using for bundle downloads was being loaded once and then re-used. This was problematic for users that configure cert files and then have them change. This updates the client wrapper in OPA to re-create the underlying client for each request. Fixes: open-policy-agent#1898 Signed-off-by: Patrick East <east.patrick@gmail.com>
The HTTP client we were using for bundle downloads was being loaded once and then re-used. This was problematic for users that configure cert files and then have them change. This updates the client wrapper in OPA to re-create the underlying client for each request. Fixes: #1898 Signed-off-by: Patrick East <east.patrick@gmail.com>
Expected Behavior
When a short-lived certificate / key combination used for bundle downloads is reloaded, OPA should use the new certificate / key combination instead of the old ones.
Actual Behavior
OPA loads the certificate / key as soon as the server is created, and uses that combination for the life of the server.
Steps to Reproduce the Problem
Additional Info
This is critical functionality for my team, as short-lived certificates are vital for security reasons and restarting OPA upon certificate refresh is not feasible.
The text was updated successfully, but these errors were encountered: