cassandra中的权限问题

时间:2016-04-25 13:00:21

标签: cassandra datastax-enterprise

对于cassandra中的用户,我使用以下命令获得了许可:

PRICINGUSR@cqlsh:system> LIST ALL PERMISSIONS OF PRICINGUSR;

 username   | resource           | permission
------------+--------------------+------------
 PRICINGUSR | <keyspace pricing> |     CREATE
 PRICINGUSR | <keyspace pricing> |      ALTER
 PRICINGUSR | <keyspace pricing> |       DROP
 PRICINGUSR | <keyspace pricing> |     SELECT
 PRICINGUSR | <keyspace pricing> |     MODIFY
 PRICINGUSR | <keyspace pricing> |  AUTHORIZE
  

注意:系统密钥空间没有权限。

但是,当我查询系统键空间的表格时,我得到了一些响应,而对于某些我不知道。

PRICINGUSR@cqlsh:system> Select * from system.schema_keyspaces limit 1;

 keyspace_name | durable_writes | strategy_class                                       | strategy_options
---------------+----------------+------------------------------------------------------+------------------
        ccw_pd |           True | org.apache.cassandra.locator.NetworkTopologyStrategy |      {"DC1":"3"}

(1 rows)
PRICINGUSR@cqlsh:system> Select * from system.size_estimates limit 1;
Unauthorized: code=2100 [Unauthorized] message="User PRICINGUSR has no SELECT permission on <table system.size_estimates> or any of its parents"
PRICINGUSR@cqlsh:system> Select * from system.schema_usertypes limit 1;

 keyspace_name | type_name | field_names | field_types
---------------+-----------+-------------+-------------

(0 rows)
PRICINGUSR@cqlsh:system>

我正在使用DSE 4.8.1

1 个答案:

答案 0 :(得分:2)

Cassandra维护了一组READABLE_SYSTEM_RESOURCES,无论权限如何都可以读取。这对于允许Cassandra管理用户资源而不必授予每个用户权限是必要的。此列表中包含的表格是:

  • system.local
  • system.peers
  • system.schema_keyspaces
  • system.schema_columnfamilies
  • system.schema_columns
  • system.schema_triggers
  • system.schema_usertypes

以上列表适用于仅在DSE 4.8中使用的Cassandra 2.1