-
Notifications
You must be signed in to change notification settings - Fork 63
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
Authservice should implicitly deny requests that don't match config prefixes #140
Comments
I am a bit confused on the problem statement. Could you elaborate a bit? Some sample configuration would help.
This means envoyfilter created on the workload correct?
What does this mean? The virtual service/gateway contains the paths |
Using this example config:
Right now if a request comes into a sidecar for It'd be ideal if a request is proxied to the authservice, and it does not match any chains, the request would be denied. |
I see. It sounds like this use case want to ensure the application behind sidecar/gateway is always protected under OIDC. I think this is possible in updated config example. I can verify it a bit. BTW, are you enabling authservice on application sidecar or the ingress gateway? |
Currently we're doing this at the application sidecar, but plan to support both gateway and application implementations based off of the environment we're deploying to. |
We get bitten by this routinely and I came here about to file a similar issue. A default-deny/fail-safe mode seems like a key feature for security relevant software. |
I tested indeed if you configure "test.example.com" in the chain match, a not matched filter chain will make authservice chain allow request go through without oidc authenticaiton. It gives some log like below.
For longer term, we won't expose this low level filter match logic as end user configuration. Moreover, as we are updating to use Istio 1.9 ext authz api, you can configure a proxy (sidecar or gateway), when to trigger the ext authz to the authservice. e.g. not trigger it if the path is "/public". but the authservice itself is always kicked off the OIDC flow. I can update the documentation of how to selectively trigger ext authz to authservice with new API. Once we verified (need to compare the feature set a bit) selectively triggering condition are same, we can totally remove the match from the config option. For the time being, if you remove the |
@incfly I also think this feature |
Add a field to control the behavior when the no match is found sounds good to me. |
What are the security guarantees we are trying to provide with this? This change wouldn't quite let you say "any request that authservice allowed is trusted". Currently Authservice allows requests through that already have an authservice/src/filters/oidc/oidc_filter.cc Lines 104 to 113 in 39833fb
|
Yes. It makes sense. I also think authservice should provide verifying JWKs every time. It is worth doing in another PR. Thanks. |
I tried with 0.5.1 image, which should include #183. However it does not have intended behavior: the request with unmatched However, I don't think we should go after fixing that. Instead I still think we should achieve this via Istio RequestAuthentication and AuthorizationPolicy. People using this repo would always use Istio. Istio authn & authz policy has already supports such use case: we should configure a request authentication to validate the id token, and then in the authorization policy we can specify Additionally istio authz allows much richer flexibility in terms of when to allow or deny requests (conditions, app label selector). Authservice in this case can be just viewed as a token acquisition component. I have tested and here is some sample configuration for the bookinfo product page. I am using accounts.google.com as IdP. And access it via localhost:8443.
|
We talked with @atoy3731 and the reason is that while it's recommended and we should rely on istio API for such access control, this change is just to make less likely to shoot ourselves in the foot. e.g. someone less familiar with istio internals. having a double safety net is good. That's why #223 is made. |
Issue
Currently, a request to a workload that is authservice-enabled that does not match one of the prefixes in the authservice config will allow the request.
Recreation
Expected behavior
If a workload is authservice-enabled and it doesn't match a filter in the chain, it should be denied.
The text was updated successfully, but these errors were encountered: