Skip to content
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 /validate authorization per host based on claims in jwt #98

Closed
artagel opened this issue Apr 6, 2019 · 6 comments
Closed

Allow /validate authorization per host based on claims in jwt #98

artagel opened this issue Apr 6, 2019 · 6 comments

Comments

@artagel
Copy link
Contributor

artagel commented Apr 6, 2019

With #95 implemented, we can allow users to be authenticated based on each post being proxied. This would add a significant capability to vouch to allow per-application authorization, which is especially important when the proxies applications don't have the ability to do this on their own. Additionally, this is in line with the beyondcorp model.

@bnfinet
Copy link
Member

bnfinet commented Apr 9, 2019

Could this functionality be handled inside of the nginx config instead of being put in Vouch Proxy? If the correct header were returned could it be interpreted by nginx?

How would the end user be informed that they are Unauthorized for a particular domain? What should happen then?

@artagel
Copy link
Contributor Author

artagel commented Apr 9, 2019

I actually tried for several days to find a good way to handle this inside NGINX before I went back to adding this to vouch. The answer is, without recompiling nginx with some special plugins, or using OpenResty nginx (which I wasn't so hot on adding that requirement), nginx cannot handle this.
The real problem is more complex claims, such as the way 'groups' are returned. They are returned as an array or list, and even when returning them as a comma or space separated string, nginx has no concept such as explode or split to be able to split on the string.
I went down a complicated route of trying to write a regex to match a single group within a list of groups, but it seemed way to error-prone. Simply looking for a string match wasn't feasible because you'd also match on longer group names with the same string.
Splitting the header into X-Vouch-Group-1, X-Vouch-Group-2, etc also didn't seem very efficient, especially with the number of groups someone can have.

I can authorize on the keycloak server for instance, but that is only per client. If I were to do that, I would either need to do 1 vouch per app, or modify vouch to handle a different oidc config per app I'm proxying. is authorization on the oidc side based on some other factor available for other providers outside of adfs/keycloak? I'm not sure...

/Validate currently returns the error for failed auth anyways to the user, so I handled returning the error the same way.

@artagel
Copy link
Contributor Author

artagel commented Apr 12, 2019

Based on IRC conversation, we will try to offload this function.
I will try to make the functionality available as an alternative configuration via openresty.

@artagel
Copy link
Contributor Author

artagel commented Apr 19, 2019

I'm closing this. I have documented a way to offload the authorization function and keep vouch purely IdP.

@artagel artagel closed this as completed Apr 19, 2019
@davidgibbons
Copy link
Contributor

@artagel where did that get documented?

@bnfinet
Copy link
Member

bnfinet commented Jul 3, 2019

@davidgibbons it's in #107 pending merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants