-
Notifications
You must be signed in to change notification settings - Fork 312
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: Integrate with Apache Ranger #1054
Comments
It is also tracked in Ranger community https://issues.apache.org/jira/browse/RANGER-3831 |
If I understand it correctly, the ACL model is so simple now. There are two access_controller class.
Super User is allowed to do anything.
Super User is allowed to do anything. It seems we first have to enhance the access controller mech, add per-user / per-table support. |
Add a draft of Ranger Service definition |
The current ACL is described in #170 and Pegasus 安全认证 It can be summarized as following:
The extended ACL is based on the former design and detailed as following:
|
|
|
We have finished the service definition in ranger according to this draft. |
See https://issues.apache.org/jira/browse/RANGER-3831
You have to import the service definition into RANGER at first.
Using the REST API of ranger:
curl -X 'POST' \
'http://rangerhost:6080/service/public/v2/api/servicedef' \ -H
'Accept: application/json' \ -H 'Content-Type: application/json' \
-u 'admin:adminpassword' \
-d ***@***.***'
WHBANG ***@***.***> 于2023年2月22日周三 11:45写道:
… Introduce the implementation and how to use:
1. The class diagram
[image: image]
<https://user-images.githubusercontent.com/38547944/218993763-91a7072b-086b-44fa-9041-636c5ea1d089.png>
First, you need to add ACL related configurations. The client
configuration has not changed, the server has added new configurations:
enable_ranger_acl: indicates whether to use ranger for acl
ranger_service_url: ranger server url
ranger_service_name: use ranger policy name
mandatory_enable_acl: mandatory use range policy, currently used for testing
The details are as follows:
server
[security]
update_ranger_policy_interval_sec
[ranger]
ranger_service_url
ranger_service_name
ranger_legacy_table_database_mapping_rule
mandatory_enable_acl
[security]
enable_auth = true
krb5_keytab = /root/apache/pegasus.keytab
krb5_config = /etc/krb5.conf
krb5_principal = XXXXX
sasl_plugin_path = /root/apache/incubator-pegasus/thirdparty/output/lib/sasl2
service_fqdn = XXXXX
service_name = XXXXX
mandatory_auth = true
enable_acl = true
super_users =
meta_acl_rpc_allow_list =
enable_ranger_acl = true
java client
java
meta_servers = 127.0.0.1:34601,127.0.0.1:34602,127.0.0.1:34603
operation_timeout = 5000
async_workers = 4
enable_perf_counter = false
perf_counter_tags = cluster=onebox,app=unit_test
push_counter_interval_secs = 10
meta_query_timeout = 5000
auth_protocol = kerberos
kerberos_service_name = XXXXX
kerberos_service_fqdn = XXXXX
kerberos_keytab = /root/apache/pegasus.keytab
kerberos_principal = XXXXX
shell
[security]
enable_auth = true
krb5_keytab = /root/apache/pegasus.keytab
krb5_config = /etc/krb5.conf
krb5_principal = XXXXX
sasl_plugin_path = /root/apache/incubator-pegasus/thirdparty/output/lib/sasl2
service_fqdn = XXXXX
service_name = XXXXX
Second compatibility:
Retained the old ACL mode
1. Use the old ACL
enable_acl = true
enable_ranger_acl = false
1. user ranger for ACL
enable_acl = true
enable_ranger_acl = true
1. Third, define the ranger policy
- Pegasus resources can be divided into multiple types, and the
operation types of each resource can also be divided. One operation type
corresponds to one ACL symbol
[image: image]
<https://user-images.githubusercontent.com/38547944/204430376-17e8ae9a-bdac-466c-a2a7-d4f27cae09e0.png>
- ACLs on each type of resource correspond to specific rpc_code
[image: image]
<https://user-images.githubusercontent.com/38547944/204430797-5b45e079-84c5-4f3e-a470-db063d6d87d5.png>
[image: image]
<https://user-images.githubusercontent.com/38547944/204430865-ffc16771-90ca-43c7-903a-5451cb58c86c.png>
[image: image]
<https://user-images.githubusercontent.com/38547944/204430917-febf6ba1-eddc-4db0-b428-a00e7e651828.png>
1. pegasus+ranger
After completing the integration of ranger with pegasus, you can set
permissions on the ranger web page according to your own needs
[image: image]
<https://user-images.githubusercontent.com/38547944/204432012-230db07c-47d0-4960-9c10-04340c19b2ff.png>
[image: image]
<https://user-images.githubusercontent.com/38547944/204432186-344267c5-d966-4b21-99f5-cc6d4ade55db.png>
—
Reply to this email directly, view it on GitHub
<#1054 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZ6PHW5QXYPU2GTDNQM55LWYWDVRANCNFSM533BJVLA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
#1054 This patch is compatible with old and new acl. - Modify some method names and parameter names to make them more accurate. - Defines the configuration parameters that the new ACL needs to use. - Two new 'allowed()' methods are provided for meta_server and replica_server. - Some incompatible methods will be removed, (allowed&pre_check)commented.
#1054 This patch is to prepare for parse policies and dump policies: - 'DEFINE_JSON_SERIALIZATION' for data structure. - Preparations for json parsing - add unit test for 'parse_policies_from_json'
…resources policies (#1388) #1054 This patch implements how to pull policies from the Ranger Service and dump policies to remote storage. - Pull policies in JSON format from Ranger service and parse policies from JSON formated string. - Create the path to save policies in remote storage, and update using resources policies. - Dump policies to remote storage. - Sync policies to app envs. - Update the cached global/database resources policies.
#1054 This patch implements meta access controller using Ranger for ACL. 1. Re-implemented the access control logic of RPCs registered in `meta_serivce.h`, and adapt the old and new ACL. 2. Some internal RPCs are registered in the `_allowed_rpc_code_list`. 2. Realize periodic update of resource strategy from Ranger service. 3. Changed some ut.
#1054 This patch implements replica access controller using Ranger for ACL. 1. The Ranger policy info of the table is written to the app_envs of the table. 2. Support using the policy in the app_envs for ACL when the replica server reads and writes. 3. Modify some unit tests, and be compatible with old and new ACL.
#1452) #1054 This patch add ACL to the NFS copy of replica. 1. Added `gpid` info to the data structure defined in `nfs.thrift` 2. Perform ACL through the Ranger policy matched by `gpid` 3. The registration of nfs is moved to `replica_stub.cpp`, and the original registration information is retained, which is convenient for testing
) #1054 The access control management of RPC RPC_CM_LIST_APPS is removed from the global level resource, which is managed by the database resource.
) #1054 This patch adds a new conf item `legacy_table_database_mapping_policy_name`, the legacy table (the tables which are created before Ranger ACL enabled) will be matched to the database named `legacy_table_database_mapping_policy_name` for ACL. "*" can match any table, including legacy tables and tables named by new rules.
#1054 This patch fixes the judgment logic when ranger matches policies: 1. Traverse all resource policies i. If the current policy matches deny_condition a. does not match any deny_exclude, returns kDenied, and the traversal ends b. A deny_exclude is matched, return kPending, and continue to the next policy judgment ii. No policy is matched or the return value is kPending, enter 2 2. Traverse all resource policies again i. If the current policy matches allow_condition a. does not match any allow_exclude, returns kAllowed, and the traversal ends b. An allow_exclude is matched, return kPending, and continue to the next policy judgment ii. If the return value is kPending, it will return kDenied 3. dose not match any policy, return kDenied
Apache Ranger™ [1] is a framework to enable, monitor and manage comprehensive data security across the Hadoop platform. There are many big data components support to integate with Ranger, like HDFS,HBase,Hive,Yarn,Kafka,Kudu.
Now Pegasus supports Kerberos and built-in ACL, but it's a bit of difficult to manage it, we can make Pegasus interact with Ranger to make it easier for management.
The text was updated successfully, but these errors were encountered: