by zrail · 4y ago · 0 comments
One interesting enhancement, which is probably not within scope of this tool, would be a way to logically AND a bunch of these auth tools together. With that you could use this tool without changes to assert that someone is allowed on the tailnet then pass those results to a second process that checks what groups they belong to and authorizes them for the particular upstream being checked. One could accomplish that with one nginx proxy per application, of course, and lean into Tailscale's ACLs for authz.
And if you don't have time or want to do that, check out Pomerium it's basically a forward auth proxy with OPA policy engine integrated into it already: https://www.pomerium.com/
location /auth {
...
proxy_set_header X-Required-Caps $required_caps;
...
}
location /grafana {
...
set $required_caps "grafana.com/read,grafana.com/write"
auth_request_set $auth_caps $upstream_http_tailscale_caps;
proxy_set_header X-Webauth-Caps $auth_caps;
...
}
I.e. pass the caps through an nginx variable up to the `/auth` location, then out to `nginx-auth`, then nginx-auth passes all(?) of the user's caps to the upstream.