-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
feat(acme): make account_key configurable #9746
Conversation
|
Thanks for the PR @szesch ! I agree it's a correct way to do. I leave a comment, some tests might need to be adjusted |
@szesch I forgot to mention last time that we need to add this field to https://github.com/Kong/kong/blob/master/kong/clustering/compat/removed_fields.lua for hybrid mode compatibility. |
ece89bb
to
8083e5a
Compare
@fffonion Done! Thanks. |
cc @jschmid1 this PR adds the account private key field to acme plugin, with key mgmt feature coming in 3.1, do |
yeah, I think it would. the acme-plugin would need to add a config field that allows to specify a key (or a set of keys) |
@szesch I assume this wasn't in the urgency of getting in 3.1 (correct me if i'm wrong). As we now introduce |
@fffonion it's not urgent to get in to 3.1. Is there another PR I can reference or some docs to better understand what I have to refactor? |
This PR needs rebasing. |
8083e5a
to
357dca4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the vein of #9367, IMO we should make this accept a base64-encoded key also.
@gszr @fffonion Do I need to add base64 support if the plan is to wait for the key entity work to be done and then update this PR to use that (as mentioned #9746 (comment))? In other words, is the vision to support the key entity AND base64 encoded values or just the key entity? |
@szesch the key/key-sets feature is in Kong now. There is an ee-plugin that already uses this entity (see https://github.com/Kong/kong-ee/pull/4013 for inspiration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment would need to be actioned before this PR can be merged:
@szesch the key/key-sets feature is in Kong now. There is an ee-plugin that already uses this entity (see https://github.com/Kong/kong-ee/pull/4013 for inspiration)
Note that a base64 encoded version of a key-pair is not supported currently, but may be useful
Since this PR has not been updated in time, I am removing it from the 3.2 milestone. |
357dca4
to
5186c0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jschmid1 could you take another look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I'm merging this in as it's been a long while. @szesch Could you also make seperate PR to add changelog in https://github.com/Kong/kong/blob/master/CHANGELOG.md and update docs at |
Summary
There is currently no way to configure an existing private key to be used for the acme plugin. If the account does not have a key in storage, then a new one is created. This is a problem when external account binding credentials have already been associated with a key elsewhere (e.g. cert-manager or cert-bot). Some issuers like ZeroSSL allow for EAB credentials to be reused and multiple accounts can be created with different private keys. Others like GCP Public CA only allow for EAB credentials to be associated with one key so when the plugin tries to create a new account with a new key it fails.
The current workaround for this has been to manually insert the key in storage so a new key is not created.
This PR exposes
account_key
and will use that if the account was not found in storage and the value ofaccount_key
is not nil. Otherwise, it will generate a key on the fly as it does currently.Full changelog
account_key
in acme plugin schemaaccount_key
is present and when it is absent in the configurationcc @fffonion