-
Notifications
You must be signed in to change notification settings - Fork 476
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
Allow CA to configure different key type for JWTs and X509 #1991
Conversation
@@ -71,6 +71,9 @@ type Config struct { | |||
// CAKeyType is the key type used for the X509 and JWT signing keys | |||
CAKeyType keymanager.KeyType |
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.
I wonder if this should be renamed to X509CAKeyType? If so, maybe there should be some backwards compatibility with the ca_key_type
config field?
Thanks for putting this together, @mbyczkowski! As-is, this will break backwards compatibility for those who are currently using the ca_key_type configurable to change the JWT key type (which is pretty common for those using SPIRE to provide JWKS for cloud OIDC providers). I think whatever solution we land on here needs to maintain that compatibility. A couple of options: The tradeoff between the two options is between flexibility and minimizing configurables. I personally am leaning towards A. Curious what @evan2645 thinks here, based on the previous slack discussion that started the issue. |
This change introduces `jwt_key_type` config option and allows to directly control which key type will be used by CA Manager to sign JWTs. Existing `ca_key_type` config will continue to be used for defining X509 CA key type, but will no longer affect JWT key type. Signed-off-by: Mat Byczkowski <mbyczkowski@squareup.com>
300de30
to
7556b9a
Compare
@azdagron I agree that, if possible, we should try not to break compatibility (and by extension try not to surprise SPIRE users!). Both options, that you have laid out, seem reasonable to me. If we were to go with A. then we're not forcing any changes on the users (just need to make sure this is well documented and tested!). With time this can turn into B. if SPIRE maintainers decide it's time to simplify As a side note if you or @evan2645 can point at any additional tests I could add here, I'd be happy to do that as well to the PR. |
Hey @mbyczkowski, sorry for the delay, thanks for bearing with us as we get through the holiday season :) I do think there's quite a bit of work to do w.r.t. configurable key types. For example, if a user configures The first step of that journey I think will be the same, regardless of the direction we choose. Introducing What do you all think? |
@mbyczkowski Thank you for this contribution! |
Signed-off-by: Agustín Martínez Fayó <amartinezfayo@gmail.com>
Signed-off-by: Agustín Martínez Fayó <amartinezfayo@gmail.com>
@amartinezfayo Thanks for taking over! I told @evan2645 I'd address the PR comments, but I haven't really had the time to do it recently, so appreciate your help here! :) |
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!
Pull Request check list
Affected functionality
CA Manager
Description of change
This change introduces
jwt_key_type
config option and allows todirectly control which key type will be used by CA Manager to sign JWTs.
Existing
ca_key_type
config will continue to be used for defining X509CA key type, but will no longer affect JWT key type.
Which issue this PR fixes
fixes #1928