Uploaded image for project: 'Sentry (Retired)'
  1. Sentry (Retired)
  2. SENTRY-2151

Automatically derive owner privileges from Hive Object Ownership

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 2.1.0
    • Sentry
    • None

    Description

      admins want users who create tables to get implicit owner privileges during the table creation. These privileges cannot be revoked.

      For instance, a user under role1 with CREATE privileges gets all privileges on newly created tables

      # As an admin
      hive> grant create on db1 to role1;
      
      # As a user
      user1> use db1;
      user1> create table t1(id int);
      -- An implicit 'grant all on db1.t1 to user user1' is generated in Sentry 
      user1> insert into table t1 values (1);
      user1> select * from t1;
      user1> drop table t1;
      

      For backward compatibility, the default implicit privilege to be applied must be determined by a configuration set by admins. This is to ensure that an upgrade to this new feature does not affect the behavior of old privileges set before the upgrade. For newly created tables, the privilege must be obtained from the property ‘owner.privileges’ of the database property where the table is created.

      For instance, a user on db1 gets "all with grant privileges" but on db2 does not get any privilege

      # As an admin
      hive> alter database db1 set dbproperty('owner.privileges'='all with grant');
      hive> grant create on db1 to role1;
      hive> alter database db1 set dbproperty('owner.privileges='none');
      hive> grant create on db2 to role2;
      
      # As a user
      user1> create table db1.t1(id int);
      -- An implicit 'all with grant' privilege is granted to the user on db1.t1
      user1> create table db2.t1(id int);
      -- No privileges are granted to the user on db2.t1
      

      The privilege granted implicitly cannot be revoked by explicit revoke commands nor if the 'owner.privileges' property changes. The only way is to remove the implicit privileges is by dropping the table or changing the owner of the table.

      Attachments

        Issue Links

          1.
          Only Admin can set dbproperty 'owner.privileges' Sub-task Closed Unassigned  
          2.
          Get owner.privileges value from hive for a given DB Sub-task Closed Krishna Kalyan  
          3.
          Update schema to grant privileges to user Sub-task Resolved Na Li  
          4.
          Update JDO to grant privileges to user Sub-task Resolved Na Li  
          5.
          Update provider-db backend code to grant privileges to user Sub-task Resolved Na Li  
          6.
          Update audit log to grant/revoke owner privileges Sub-task Resolved Sergio Peña  
          7.
          Add e2e tests for granting owner privileges Sub-task Resolved Na Li  
          8.
          Add owner in create table notification event Sub-task Resolved Krishna Kalyan  
          9.
          Make sure partial invoke only applies to explicit privileges Sub-task Resolved Na Li  
          10.
          Retrieve and list user privileges for authorization Sub-task Resolved Sergio Peña  
          11.
          Make sure that the implicit privileges for a role are synced with HDFS Sub-task Resolved Krishna Kalyan  
          12.
          Update the Sentry-HDFS thrift for user level privileges. Sub-task Resolved Krishna Kalyan  
          13.
          Permission full snapshot should include owner privileges Sub-task Resolved Krishna Kalyan  
          14.
          Owner privileges added should be persisted and sent in delta updates Sub-task Resolved Krishna Kalyan  
          15.
          Extend PrivilegeInfo to hold user privileges Sub-task Resolved Krishna Kalyan  
          16.
          Sentry authorization provider should now generate ACL for users Sub-task Resolved Krishna Kalyan  
          17.
          Add owner privileges to create database notifications Sub-task Resolved Krishna Kalyan  
          18.
          Implement SentryJSONAlterDatabaseMessage in SentryJSONMessageFactory Sub-task Resolved Unassigned  
          19.
          Support HDFS ACL for fine grained privileges Sub-task Resolved Unassigned  
          20.
          Extend the thrift definition for policy service to handle user privileges Sub-task Resolved Krishna Kalyan  
          21.
          Extend sentry policy client to handle user privileges Sub-task Resolved Krishna Kalyan  
          22.
          Sentry-plug-in should have API's to handle grant/revoke privileges to users. Sub-task Resolved Krishna Kalyan  
          23.
          Update SentryPermissions with user permissions Sub-task Resolved Krishna Kalyan  
          24.
          Add e2e tests for testing HDFS sync for owner privileges. Sub-task Resolved Krishna Kalyan  
          25.
          Extend the Sync Listener to pass owner information to sentry server. Sub-task Resolved Krishna Kalyan  
          26.
          Add schema changes to limit one one user as owner privilege per object Sub-task Resolved Krishna Kalyan  
          27.
          Extend the thrift definition for policy service to learn owner information Sub-task Resolved Krishna Kalyan  
          28.
          Construct owner privilege (TSentryPrivilege) Sub-task Resolved Krishna Kalyan  
          29.
          Add e2e tests to verify owner privileges Sub-task Resolved Na Li  
          30.
          Remove privileges that do not associate with a role or a user Sub-task Resolved Na Li  
          31.
          Update user privileges based on changes to authorizables Sub-task Resolved Krishna Kalyan  
          32.
          Normalize the Sentry store API's to handle both user/role privileges Sub-task Resolved Krishna Kalyan  
          33.
          Alter sentry role or user at granting privilege can avoid extra query to database Sub-task Resolved Na Li  
          34.
          alter table set owner command can be executed only by user with proper privilege Sub-task Resolved Na Li  
          35.
          Make thrift API changes to get user privileges from Sentry Sub-task Resolved Sergio Peña  
          36.
          Remove user when it is not associated with other objects Sub-task Resolved Na Li

          0%

          Original Estimate - 72h
          Remaining Estimate - 72h
          37.
          Update HDFS ACL's based on owner privileges. Sub-task Resolved Krishna Kalyan  
          38.
          Translate owner privilege in sentry binding for authorization Sub-task Resolved Sergio Peña  
          39.
          Fix the sentry store logic for listing user privileges Sub-task Resolved Sergio Peña  
          40.
          Create the SHOW GRANT USER task for Hive Sub-task Resolved Arjun Mishra  
          41.
          Grant and revoke owner privileges based on HMS updates(server-side) Sub-task Resolved Krishna Kalyan  
          42.
          Grant and revoke owner privileges based on HMS updates(client-side) Sub-task Resolved Krishna Kalyan  
          43.
          list_privileges_by_user() fails with a JDODetachedFieldAccessException Sub-task Resolved Arjun Mishra  
          44.
          It is possible to elevate privileges from DROP using alter table rename Sub-task Resolved Na Li  
          45.
          The request received in SentryPolicyStoreProcessor.sentry_notify_hms_event is null Sub-task Resolved Na Li  
          46.
          Notification Processor should update user privileges for path notification events Sub-task Resolved Na Li  
          47.
          Add requestorUsername to client.notifyHmsEvent() method Sub-task Resolved Sergio Peña  
          48.
          Owner privileges should not be granted to sentry admin users Sub-task Resolved Krishna Kalyan  
          49.
          Add PermissionsUpdate for adding owner privilege on owner transfer Sub-task Resolved Krishna Kalyan  
          50.
          Update owner privileges for table when owner is changed. Sub-task Resolved Krishna Kalyan  
          51.
          alter database set owner command can be executed only by user with proper privilege Sub-task Resolved Na Li  
          52.
          Sentry listener should log the failure if grant/revoke of owner privilege fails Sub-task Resolved Krishna Kalyan  
          53.
          ownership change should be done only by admin users Sub-task Resolved Na Li  
          54.
          SHOW GRANT does not display owner privileges for admin users Sub-task Resolved Arjun Mishra  
          55.
          Support grant option for DDL operation Sub-task Resolved Na Li  
          56.
          Support transfer of ownership for database/table to roles Sub-task Resolved Krishna Kalyan  
          57.
          Merge the DB owner privileges configurations into one enum configuration Sub-task Resolved Sergio Peña  
          58.
          Sentry Server should provide API for Sentry Client to get Owner Privilege Type Sub-task Resolved Na Li  

          Activity

            People

              linaataustin Na Li
              linaataustin Na Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 72h
                  72h
                  Remaining:
                  Remaining Estimate - 72h
                  72h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified