-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Vault 1.8.1 acl templating breaks with JWT #12336
Comments
Hi @evilmog! Thanks for submitting this issue! Could you possibly give a smaller set of steps required to reproduce this issue ? The python script looks fairly large and complex, wondering if a few cli/api commands chained together could be used to recreate this issue. If not and everything done in the python script is necessary to recreate the bug, could you write down some details as to what is going on in the script and how it is triggering the bug exactly ? |
All the script does is configure the test vault to be exactly the same.
Upgrading our binary from 1.7.3 to 1.8.1 breaks user alias templating in
the ssh certificate allowed principals.
So to setup:
1: configure vault JWT authentication against your sso provider, make sure
it configures groups.
2: configure vault for ssh certificate issuance
3: configure a TLS cert secret
4: create an internal group and policy for the ssh cert
5: create an external group and policy for ssh cert
6: configure an ssh certificate role with specific allowed principals
7: configure TLS issuance for openvpn, plus policy
8: authenticate with the JWT via your oidc sso, give the JWT to vault for a
token
Try to request a certificate in the ssh and tls certificate endpoints
Authentication fails with groups assigned and created via the JWT in 1.8.1
while it works in 1.8.3
That script will provision you a vault with JWT auth, you just need to
replace some of the redacted elements like bound issuer.
…On Tue., Sep. 7, 2021, 5:05 p.m. Pratyoy Mukhopadhyay, < ***@***.***> wrote:
Hi @evilmog <https://github.com/evilmog>! Thanks for submitting this
issue! Could you possibly give a smaller set of steps required to reproduce
this issue ? The python script looks fairly large and complex, wondering if
a few cli/api commands chained together could be used to recreate this
issue. If not and everything done in the python script is necessary to
recreate the bug, could you write down some details as to what is going on
in the script and how it is triggering the bug exactly ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZBQUUWLSW5ZSFCD27UQADUA2LCRANCNFSM5CKBZDVA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
ah perfect, having that broken down like that is super helpful for me, thank you!! Follow up questions on the script:
|
You may need to make your own JWT or setup keycloak as an OIDC provider to
issue you jwt's with groups
This should work on python 3.8 ish, it's super hacky and I should have down
terraform.
You will want to use a token that's not a root token issued from the JWT
sign on, you will want a group, we call our groups blueGroups but whatever
in the OIDC will populate the JWT SSO groups should work.
That's where I suspect the problem is, either in the templating of the
allowed usernames of the key principal or something to do with the JWT but
whenever we request the cert with the new token on 1.8.3 we get rejected vs
in 1.7.3 we get accepted.
I can line up a WebEx to show you sometime if that would help.
I'll see if I can get an exact method to replicate tomorrow.
…On Tue., Sep. 7, 2021, 5:40 p.m. Pratyoy Mukhopadhyay, < ***@***.***> wrote:
ah perfect, having that broken down like that is super helpful for me,
thank you!! Follow up questions on the script:
- What is the python version needed to run it?
- Beyond updating the redacted variables and starting up a dev mode
vault server on 127.0.0.1:8200, should I need to do anything else to
be able to reproduce this ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZBQUSDBFGBJ67CKK5JBATUA2PFLANCNFSM5CKBZDVA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
thanks for the additional details! I will try to repro this shortly keeping the advice in mind, let you know here if I run into any issues! |
I am wondering if the required options changed in the JWT plugin, I noticed
this when I tried to change my number of token uses on the JWT endpoint, it
used to default to JWT in the JWT/OIDC options, I wonder if its not set it
if breaks.
I'm going to see if I can reload a vault from scratch and see if its fixed
that way rather than doing a straight upgrade.
…On Thu, Sep 9, 2021 at 2:53 PM Pratyoy Mukhopadhyay < ***@***.***> wrote:
thanks for the additional details! I will try to repro this shortly
keeping the advice in mind, let you know here if I run into any issues!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZBQUQRMDMB5Y5FADY55ZLUBENF3ANCNFSM5CKBZDVA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Sorry, I haven't gotten around to doing a repro of this yet, but just wanted to check, did the things you were planning to try in your last message end up resolving this or shedding any more light on it ? |
I haven't managed to get things going, I'll have to try a full from scratch
rebuild so see if I can get this to reproduce
…On Wed, Sep 15, 2021 at 5:13 PM Pratyoy Mukhopadhyay < ***@***.***> wrote:
Sorry, I haven't gotten around to doing a repro of this yet, but just
wanted to check, did the things you were planning to try in your last
message end up resolving this or shedding any more light on it ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZBQUXEJU6UNDCPF4RF7TLUCESCXANCNFSM5CKBZDVA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi guys, in my opinion its not even required to go via the JWT or OIDC option. We discovered the same bug and it seems an allowed_common_name with the mail address as value is already enough to break it. Working scenario on HC Vault 1.7.3 / 1.7.4:
Not working scenario on HC Vault 1.8.2:
|
Thanks so much for the repro steps @DaspawnW , can confirm that I just tried those, and was able to repro the problem on 1.8x and see that it doesn't exist in 1.7x. |
Closing issue as it was fixed within #12716 The fix will be available within the next major release and will be backported to Vault 1.8 |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Configure vault with JWT and then template under PKI or SSH Certificates the following allowed domain template:
This matches the documentation https://learn.hashicorp.com/tutorials/vault/policy-templating
the vault ssh config is something similar to one configured by this python script:
Expected behavior
A certificate issued from
[email protected]
instead an error is given{'errors': ['common name [email protected] not allowed by this role']}
the only fix was to downgrade to 1.7.3
Environment:
vault status
): 1.8.1 (fixed in 1.7.3)vault version
): Vault v1.8.1 (4b0264f)Vault server configuration file(s):
Additional context
Add any other context about the problem here.
Worked perfect in 1.7.3, doesn't work in 1.8.1
The text was updated successfully, but these errors were encountered: