-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Proposal: support OpenPolicyAgent for access control #5714
Comments
SGTM! |
sounds good |
SGTM!! I noticed Open Policy Agent supports Ecosystem 😄 see https://www.openpolicyagent.org/docs/latest/ecosystem/ |
It's great to see the Apache APISIX ecosystem expanding.
… 琚致远 ***@***.***>於2021年12月7日 上午11:22寫道:
SGTM!! I noticed Open Policy Agent supports Ecosystem 😄 see https://www.openpolicyagent.org/docs/latest/ecosystem/
cc @yzeng25 @bzp2010 @moonming
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Just added a Discussion here[1], looking forward to more reviews from community :) |
Thanks for raising this @bzp2010 👍 Let me know if there's any questions along the way with regards to OPA, and I'd be happy to answer them :) As for the suggested input format - looks mostly good to me! I would suggest however to not use As for the response object, also looks pretty good to me! I'd suggest renaming But either way, looks like a great start! |
Great!! |
UpdateThe current OPA basic support plugin has been completed and will begin the phase 2 of feature development on the roadmap. So I reopened this issue to track the status of the next PR. |
cc @yzeng25 to know this. 😄 |
Cool! Got it! |
Hi, @anderseknert. The development of Thanks. |
This comment has been minimized.
This comment has been minimized.
That's really exciting! Thanks for your work on this @bzp2010 , and everyone else who has been involved 👍 As for best practices, no not really. It's important to note that OPA doesn't do enforcement by design, so IMHO the status code for the client to return upstream should be decided by the client/caller. For an HTTP Gateway this would likely be a 403, but if we leave that decision to the client (i.e. not in the policy response) we can be flexible in reusing the same policy across other clients, where a different type of enforcement (like a 500 response, or just an audit log entry) might be desirable. So for me, I'd say the minimum decision to return would be 1) whether the request is allowed or not, and 2) (optionally) a string explaining the reason if the request was denied. As for reusing the Envoy/Istio authorization input structure, that's an interesting idea, as it would mean you could pretty much take any policy written for those systems and directly use it with APISIX. The downside of that (again, IMHO ;)) is that there's a lot of (most often) unused data being sent with each request. No policy I've seen has used things like the |
The first point is got, while I will try to do some work on the second point. |
UpdateStage 2 PR #5779 and scheme here #5779 (comment) |
Apache APISIX is added to OPA's ecosystem page :) Thanks @anderseknert for reviewing open-policy-agent/opa#4137 and open-policy-agent/opa#4138 |
👏 |
Already done. |
Background
OPA is an open source lightweight general-purpose policy engine, which is a full-featured policy engine that can replace the built-in policy module in your software and decouple the service from the policy engine.
![image](https://user-images.githubusercontent.com/8078418/144813586-bbe724cd-5cde-4a18-9e0c-4ed205a0b66f.png)
It describes policies through a policy DSL language "Rego" and stores policy data through JSON, after which the user can send a query request and OPA will combine the policy with the data and the query request entered by the user to generate policy decisions.
Users can easily integrate OPA with its services, such as program libraries, HTTP API, etc. In this plugin, we will integrate OPA using HTTP API.
Test Environment
Solutions
Configure schema
More functions (Need more discuss)
Implemention
Create a plugin that encodes the request information as JSON during the access execution phase, sends it to the OPA Data API and gets the response, decides whether to overwrite the response and terminates the request processing accordingly.
We provide a standard OPA response body specification, and the parts that conform to it will be parsed by APISIX. (complex response as follows)
Roadmap
The plugin implementation will follow the following roadmap, splitting into different PRs for submission.
Other
What are your ideas?
The text was updated successfully, but these errors were encountered: