-
Notifications
You must be signed in to change notification settings - Fork 44
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: using OPA Agent instead of assertions in EAS #33
Comments
Very cool, I'll do some research and see where/how it might fit. I'm not familiar with OPA so if you have any insights to share on that and how it would integrate please share. |
I don't have so much information for OPA. |
Does the client specify which policy/rule to apply (already defined on the opa server) when making the request? This seems like a pretty cool idea and fits nicely with some longer term changes I'd like to make to assertions. I'd like to combine all assertion data into a single struct and make the rule definitions operate on that instead of the individual datasets (ie: cross check something in userinfo against some portion of the request data, or cross check userinfo against access token etc). |
Yes the client can specify the policy an optionally the rules (you can have multiple rules by policy) to use on the opa server. See: |
Very cool. I'll start digging around at it and see how it might fit into the picture. |
Haha, great more people like OPA. We were thinking to use it after EAS instead of Istio authorization. Istio supports OPA as well, but we didn't see an exact benefit versus Istio native functionality. But could be great to separate core EAS installation from the assertion logic, although another dependency would be introduced in this case. Perhaps it could be like some opt-in feature of EAS. |
@travisghansen I think an interesting part for EAS could be this https://www.openpolicyagent.org/docs/latest/http-api-authorization/. It didn't work for us because we would have to rewrite many apps to call OPA agent from inside the app, but for EAS as a central piece of authz workflow, it would be awesome I think. |
Yeah it would simply be specific type of assertion I think. If nothing is defined in the I think this is pretty trivial to implement honestly and seems fairly powerful. I would have performance concerns about a sub request within a sub request but the added latency becomes a concern to the operator I suppose and a decision for them to make. At least they'll have the option. |
Thinking through your reply again, maybe you don't need to provide any OPA block, just allow possibility to call OPA for request validation like in the link I shared, like specifying OPA endpoint and a flag to use it or not. So, OPA installation etc is left to the user |
Yeah, I would leave the installation to the user for sure, I think I would handle this similar the to the header injection stuff that can be applied at the
We'd create a normalized data block containing information about the request to eas, parent request, specific plugin being analyzed, whole config_token, authorization data (ie: tokens for oauth/oidc, whatever else for other plugins), etc and pass that along. If the result is pass then additionally add the opa data to the same block of info that is/can be used for header injection with the opa data. Happy to hear other thoughts. Seems like a pretty powerful framework..wished I'd bumped into it sooner. Above and beyond the idea of replacing the assertions, it feels like it could be a plugin all it's own depending on how much code can be imported to the endpoints/policies (ie: ldap clients and the like). We'd simply need to define a proper result/response structure that effectively would expose the whole functionality of the internal plugins (ie: set response code, headers, and cookies in essence) and just let |
Sounds good. I was thinking something in the lines of gatekeeper that rules themselves could be kubernetes objects but then realised that your project is not only kubernetes-specific, so having rules defined inside config_token set up may be better. Also, things like gatekeeper deal with crud operations on kubernetes, while for the proxy - api autorization I posted above is needed and other things don't matter |
@mlushpenko yeah. One of the items on the todo is to add features that determine if/when specific routes are authenticated or not (similar to items described here: https://www.keycloak.org/docs/latest/securing_apps/index.html#_keycloak_generic_adapter). I wasn't sure how badly I wanted to get into that but this seems like it could be a happy medium (if replacing assertions) or full blown replacement (if a full plugin was created). In any case, lots of good stuff to review here and design. |
Indeed, lots of stuff =D |
@mlushpenko yeah, I'd agree about the handling at the proxy level (that was my original thought as well). I can however see folks wanting a unified (and proxy agnostic) solution. We'll see where it all goes. |
On a related note, I may create a specific plugin to handle endpoint auth/no-auth logic. I've realized that with clever combination of the existing |
That would be great, as I mentioned before we do have use-cases for such functionality and the workaround for now is to use separate endpoint not protected by EAS for public endpoints |
Just getting around to revisiting this feature. Do you see more value in integrating with an existing instance of I've mostly got concerns about adding another http request from a performance perspective. We could also run In any case, this integration opens up some really cool stuff, just want to make sure it gets done 'right'. |
@mlushpenko any thoughts from you on this one? I've been doing my research and feel I have a decent enough grasp on |
hey, @travisghansen, it's been some time since our last discussion (not taking into account cookie settings). I've reviewed this thread a bit to refresh the memory and I can say that with the newer version of istio, we do handle public/private endpoints on the level of ingress. But still thinking that doing it on EAS side could have been a bit easier, envoy filters are not easy to work with. Apart from that, just sharing info :) we are using header auth plugin so that our monitoring system can bypass oidc and monitor our endpoints. Testing full authz/authn flow would be awesome, but much more work and we don't have time right now. Next one, regarding performance, I agree it is important. We have some problems with networking and wanted to increase the timeout for outgoing requests, it is hardcoded here for 10 seconds. So, adding extra request could lead to more problems and then doing it locally seems very interesting. But the bad news from my side, I am leaving the company at the end of March and my colleague still doesn't have github account even though he is the one usually diving into eas code to try some new settings :) What I am saying is I will likely not be able to test your changes, so if not many other people are interested, perhaps it's not worth to spend your time. I will check at a new place if there is a space to use EAS there :) And I can still review/discuss changes if that's good enough, just won't have a production system to see real usage of the new feature. |
@mlushpenko no problem! best wishes at the new place :) |
Ah, good to know, that looks like some pretty cool work! |
Hi,
This is a request feature to use the OPA Agent instead of assertion parts of EAS.
With this we can use a common DSL language (rego) to create policies for authz.
The text was updated successfully, but these errors were encountered: