-
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: Addition of an authorization plugin #4674
Comments
LGTM. There are three minor issues:
|
We already have |
@spacewander thanks! |
Just one question, So if people want to use this plugin when they deploy their Apache APISIX cluster on Kuberentes, we may have to prepare an image which contains the policy file and the mode configuration. Or, we should support to mount such files when they run the container, say, we can expose such configurations items in the helm chart. In addition, is it convenient to support to write literal policy and mode config just in the plugin config? |
Thanks! |
I had the same thought when developing this, so in its current stage they would have to have their model/policy files across all nodes. But, I am not very sure which option could be better. We can add support to write literal policies/models directly into config but I am not sure if this will be convenient if the policy file is large (say 1000 policies or so), still this would be a good option. Should we add this as an alternative to using files? Thanks! |
@rushitote |
+1, that'd would be better. |
That is a great option, we could use that! |
Created a PR at #4710. |
Background
Hi, we have been developing
casbin-authz
plugin for APISIX based on Lua Casbin which is the Lua implementation of the Casbin library. Casbin is an authorization library which supports access control models like ACL, RBAC and ABAC.casbin-authz
is a plugin for APISIX that enables authorization based on Casbin. The initial implementation is at apisix-authz.Implementation and Usage
This is what we have developed till now:
The user can send send a request to configure the plugin on a route by:
This will use the model in
model_path
and policy inpolicy_path
of the configuration to create a Casbin Enforcer when run for the first time. (Example model file and policy file here). The plugin checks whether the username (as passed in header), the object (the path URL) and the HTTP request method are authorized or not. If the username header is not present, it assumes it to beanonymous
whose permissions can be set in the model/policy files. If such request is authorized, it will proceed normally as it would and if not it would return a 403 code (for now).It also features an API to get the policies, configure the policies and save all of them again(if updated) to the policy file path. The API is in initial stage and may support more functions as needed.
What do you think about this? Will this be helpful? If so, I can start with an initial PR.
The text was updated successfully, but these errors were encountered: