假设Bob@aliyun.com为test_project_a的项目所有者,Worker为项目中的角色。命令示例如下。
describe role Worker;
[users]
RAM$Bob@aliyun.com:Allen
Authorization Type: ACL
A projects/test_project_a: CreateTable | CreateResource | CreateInstance | CreateFunction | List
A projects/test_project_a/tables/bank_data: Download
Authorization Type: Policy
A projects/test_project_a/tables/bak*: Download
A projects/test_project_a/tables/sale_detail: Update
A projects/test_project_a/tables/tb_*: Download | Drop
A projects/test_project_a/tables/view_1: Drop
show grants;
假设Bob@aliyun.com为test_project_a的项目所有者,Allen为隶属于test_project_a的RAM用户,已经被添加到test_project_a中。
show grants;
命令,返回结果如下。
[ALIYUN$Bob@aliyun.com]
projects/test_project_a: Project Owner
show grants;
命令,返回结果如下。
[roles]
worker
Authorization Type: ACL
[user/RAM$Bob@aliyun.com:Allen]
A projects/test_project_a: CreateTable | CreateResource | CreateInstance | CreateFunction | List
A projects/test_project_a/packages/project_test_b.datashare: Read
Authorization Type: Policy
[role/worker]
A projects/test_project_a/tables/tb_*: Drop | Download
假设Bob@aliyun.com为test_project_a的项目所有者,Allen为隶属于test_project_a的RAM用户,已经被添加到test_project_a中。
show grants for ALIYUN$Bob@aliyun.com;
返回结果如下。
[ALIYUN$Bob@aliyun.com]
projects/test_project_a: Project Owner
show grants for RAM$Bob@aliyun.com:Allen;
返回结果如下。
[roles]
worker
Authorization Type: ACL
[user/RAM$Bob@aliyun.com:Allen]
A projects/test_project_a: CreateTable | CreateResource | CreateInstance | CreateFunction | List
A projects/test_project_a/packages/project_test_b.datashare: Read
Authorization Type: Policy
[role/worker]
A projects/test_project_a/tables/tb_*: Drop | Download
show tables;
命令获取表或视图名称。
list resources;
命令获取资源名称。
list functions;
命令获取函数名称。
show instances;
命令获取实例ID。
查看test_project_a项目中的对象授权信息。
show acl for test_project_a on type project;
返回结果如下。
Authorization Type: Implicit
AG project_owner/ALIYUN$Bob@aliyun.com: All
AG admin/ALIYUN$Bob@aliyun.com: All
Authorization Type: ACL
A role/worker(projects/test_project_a): CreateTable | CreateResource | CreateInstance | CreateFunction | List
A role/worker1(projects/test_project_a): CreateTable | CreateResource | CreateInstance | CreateFunction | List
A role/worker2(projects/test_project_a): CreateTable | CreateResource | CreateInstance | CreateFunction
show acl for sale_detail on type table;
返回结果如下。
Authorization Type: Implicit
AG project_owner/ALIYUN$Bob@aliyun.com: All
AG admin/ALIYUN$Bob@aliyun.com: All
AG object_creator/ALIYUN$Bob@aliyun.com: All
Authorization Type: ACL
A user/RAM$Bob@aliyun.com:Allen(acs:odps:*:projects/test_project_a/tables/sale_detail/customer_id): Describe | Select
A user/RAM$Bob@aliyun.com:Allen(acs:odps:*:projects/test_project_a/tables/sale_detail/shop_name): Describe | Select
show acl for udtf.jar on type resource;
返回结果如下。
Authorization Type: Implicit
AG project_owner/ALIYUN$Bob@aliyun.com: All
AG admin/ALIYUN$Bob@aliyun.com: All
AG object_creator/ALIYUN$Bob@aliyun.com: All
Authorization Type: ACL
A user/RAM$Bob@aliyun.com:Allen(acs:odps:*:projects/test_project_a/resources/udtf.jar): Read | Write
show acl for UDTFResource on type function;
返回结果如下。
Authorization Type: Implicit
AG project_owner/ALIYUN$Bob@aliyun.com: All
AG admin/ALIYUN$Bob@aliyun.com: All
AG object_creator/ALIYUN$Bob@aliyun.com: All
Authorization Type: ACL
A role/worker1(acs:odps:*:projects/test_project_a/registration/functions/udtfresource): Download
A user/RAM$Bob@aliyun.com:Allen(acs:odps:*:projects/test_project_a/registration/functions/udtfresource): All
show acl for 20220105031923461ghu**** on type instance;
返回结果如下。
Authorization Type: Implicit
AG project_owner/ALIYUN$Bob@aliyun.com: All
AG admin/ALIYUN$Bob@aliyun.com: All
AG object_creator/ALIYUN$Bob@aliyun.com: All
Authorization Type: ACL
A user/RAM$Bob@aliyun.com:Allen(acs:odps:*:projects/test_project_a/instances/20220105031923461ghu****): All
假设Bob@aliyun.com为test_project_a的项目所有者,Allen为隶属于test_project_a的RAM用户,已经被添加到test_project_a中。
show label grants;
命令,返回结果如下。
User Label: 0
+--------------+--------------+--------------------------+
| TableName | GrantedLabel | Expires |
+--------------+--------------+--------------------------+
| bank_data | 3 | 2022-07-04T16:30:47+0800 |
+--------------+--------------+--------------------------+
| bank_data_pt | 4 | 2022-07-04T16:36:04+0800 |
+--------------+--------------+--------------------------+
show label grants;
命令,返回结果如下。
User Label: 1
+-------------+--------------+--------------------------+
| TableName | GrantedLabel | Expires |
+-------------+--------------+--------------------------+
| sale_detail | 2 | 2022-01-09T11:43:27+0800 |
+-------------+--------------+--------------------------+
假设Bob@aliyun.com为test_project_a的项目所有者,Allen为隶属于test_project_a的RAM用户,已经被添加到test_project_a中。
show label 3 grants;
返回结果如下。
User Label: 0
+--------------+--------------+--------------------------+
| TableName | GrantedLabel | Expires |
+--------------+--------------+--------------------------+
| bank_data | 3 | 2022-07-04T16:30:47+0800 |
+--------------+--------------+--------------------------+
show label 2 grants;
返回结果如下。
User Label: 1
+-------------+--------------+--------------------------+
| TableName | GrantedLabel | Expires |
+-------------+--------------+--------------------------+
| sale_detail | 2 | 2022-01-09T11:43:27+0800 |
+-------------+--------------+--------------------------+
假设Bob@aliyun.com为test_project_a的项目所有者,Allen为隶属于test_project_a的RAM用户,已经被添加到test_project_a中。查询Allen可访问的高敏感等级数据表,命令示例如下。
show label grants for user RAM$Bob@aliyun.com:Allen;
返回结果如下。
User Label: 2
+-----------+--------------+--------------------------+
| TableName | GrantedLabel | Expires |
+-----------+--------------+--------------------------+
| bank_data | 3 | 2022-07-04T16:29:32+0800 |
+-----------+--------------+--------------------------+
show label <level> grants for user <user_name>;
假设Bob@aliyun.com为test_project_a的项目所有者,Allen为隶属于test_project_a的RAM用户,已经被添加到test_project_a中。查询Allen可访问的高敏感等级数据表,命令示例如下。
show label 3 grants for user RAM$Bob@aliyun.com:Allen;
返回结果如下。
User Label: 2
+-----------+--------------+--------------------------+
| TableName | GrantedLabel | Expires |
+-----------+--------------+--------------------------+
| bank_data | 3 | 2022-07-04T16:29:32+0800 |
+-----------+--------------+--------------------------+
show label grants on table <table_name>;
查询项目test_project_a中可访问高敏感数据表sale_detail的用户列表,命令示例如下。
show label grants on table sale_detail;
返回结果如下。
Sensitive Label Range: [3, 4]
+-------------------------------------------------+--------------+--------------------------+
| UserName | GrantedLabel | Expires |
+-------------------------------------------------+--------------+--------------------------+
| worker | 4 | 2022-07-04T11:23:35+0800 |
+-------------------------------------------------+--------------+--------------------------+
| RAM$Bob@aliyun.com:Allen | 4 | 2022-07-04T17:54:00+0800 |
+-------------------------------------------------+--------------+--------------------------+
show label <level> grants on table <table_name>;
查询项目test_project_a中可访问高敏感数据表sale_detail的用户列表,命令示例如下。
show label 4 grants on table sale_detail;
返回结果如下。
Sensitive Label Range: [3, 4]
+-------------------------------------------------+--------------+--------------------------+
| UserName | GrantedLabel | Expires |
+-------------------------------------------------+--------------+--------------------------+
| worker | 4 | 2022-07-04T11:23:35+0800 |
+-------------------------------------------------+--------------+--------------------------+
| RAM$Bob@aliyun.com:Allen | 4 | 2022-07-04T17:54:00+0800 |
+-------------------------------------------------+--------------+--------------------------+
show label [<label>] grants on table <table_name> for user <user_name>;
查询项目test_project_a中Allen可访问sale_detail的数据,命令示例如下。
show label grants on table sale_detail for user RAM$Bob@aliyun.com:Allen;
返回结果如下。
User Label: 2
+-------------+--------------+--------------------------+
| Column | GrantedLabel | Expires |
+-------------+--------------+--------------------------+
| customer_id | 4 | 2022-07-04T17:54:00+0800 |
+-------------+--------------+--------------------------+
| shop_name | 4 | 2022-07-04T17:54:00+0800 |
+-------------+--------------+--------------------------+
| total_price | 4 | 2022-07-04T17:54:00+0800 |
+-------------+--------------+--------------------------+
describe <table_name>;
查询项目test_project_a中表sale_detail及其列的敏感等级,命令示例如下。
describe sale_detail;
返回结果如下。
+------------------------------------------------------------------------------------+
| Owner: ALIYUN$Bob@aliyun.com | Project: project_test_a |
| TableComment: |
+------------------------------------------------------------------------------------+
| CreateTime: 2021-12-13 11:27:04 |
| LastDDLTime: 2021-12-13 11:27:04 |
| LastModifiedTime: 2021-12-13 11:27:26 |
+------------------------------------------------------------------------------------+
| TableLabel: 3 |
| MaxLabel: L4 |
+------------------------------------------------------------------------------------+
| InternalTable: YES | Size: 784 |
+------------------------------------------------------------------------------------+
| Native Columns: |
+------------------------------------------------------------------------------------+
| Field | Type | Label | Comment |
+------------------------------------------------------------------------------------+
| shop_name | string | 4 | |
| customer_id | string | 4 | |
| total_price | double | 3 | |
+------------------------------------------------------------------------------------+
| Partition Columns: |
+------------------------------------------------------------------------------------+
| sale_date | string | |
| region | string | |
+------------------------------------------------------------------------------------+
show acl for <project_name>.<package_name> on type package;
show acl for test_project_b.datashare on type package;
返回结果如下。
Authorization Type: Implicit
AG project_owner/ALIYUN$Bob@aliyun.com: All
AG admin/ALIYUN$Bob@aliyun.com: All
Authorization Type: ACL
A user/RAM$Amy@aliyun.com:Bella(acs:odps:*:projects/test_project_b/packages/test_project_a.datashare): Read
show grants on <object_type> <object_name> privilegeproperties ("refobject"="true", "refproject"="<project_name>", "package"="<package
_name>");
show grants on Table sale_detail privilegeproperties ("refobject"="true", "refproject"="test_project_a", "package"="datashare");
返回结果如下。
Authorization Type: Implicit
AG project_owner/: All
Authorization Type: InstalledObjecACL
[datashare]
A user/RAM$Amy@aliyun.com:Bella(acs:odps:*:projects/test_project_a/tables/sale_detail): Select
show label grants on table <table_name> privilegeproperties ("refobject"="true", "refproject"="<project_name>", "package"="<package_name>");
show label grants on table sale_detail privilegeproperties ("refobject"="true", "refproject"="test_project_a", "package"="datashare");
返回结果如下。
Sensitive Label Range: [2, 4]
+-------------------------------------------------+--------------+--------------------------+
| UserName | GrantedLabel | Expires |
+-------------------------------------------------+--------------+--------------------------+
| RAM$Amy@aliyun.com:Bella | 3 | 2022-07-12T22:24:24+0800 |
+-------------------------------------------------+--------------+--------------------------+