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

Feature request: validation by ip addresss (use Nginx's satisfy any; instead) #378

Closed
nrukavkov opened this issue Apr 6, 2021 · 4 comments

Comments

@nrukavkov
Copy link

I want to suggest you add a feature for validation by IP before validation by a provider (google for example).

Here is a real case... We have a private web resource, which should be protected by vouch-proxy. But we have web requests from the internal network and also external. I suppose it would be very useful to not disturb users from the internal network.

Unfortunately, it is not possible to realize using Nginx. (because 'if' is not allowed for auth_request)

@aaronpk
Copy link
Collaborator

aaronpk commented Apr 6, 2021

I am strongly opposed to any sort of IP-based filtering as that violates the principle of zero trust. I would recommend accomplishing this with the future client credentials grant described in #362

@nrukavkov
Copy link
Author

I understand. But it is not about browser clients. I have build agent(teamcity) and I do not know how to use vouch-proxy for external clients and build agents together without tricks like creating a mirror of server section, etc.

@bnfinet
Copy link
Member

bnfinet commented Apr 6, 2021

@nrukavkov you can use Nginx's satisfy any; directive to achieve that...
http://nginx.org/en/docs/http/ngx_http_core_module.html#satisfy

Here's a setup I use where some of the services should not go through VP

in the server {} block..

satisfy any;

# see if we are allowed by IP
deny 192.168.0.1;             # anything from the router is likely nat'd from outside
allow 192.168.2.0/32;         # allow special ip's on your network
allow 127.0.0.1;              # and localhost too
deny all;

# if not send all requests to the `/validate` endpoint for authorization
auth_request /validate;

@bnfinet bnfinet closed this as completed Apr 6, 2021
@bnfinet bnfinet changed the title Feature request: validation by ip Feature request: validation by ip addresss (use Nginx's satisfy any; instead) Apr 6, 2021
@nrukavkov
Copy link
Author

Thank you

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