keith-turner commented on code in PR #6203:
URL: https://github.com/apache/accumulo/pull/6203#discussion_r2908548482


##########
server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java:
##########
@@ -355,11 +355,18 @@ private boolean _hasTablePermission(String user, TableId 
table, TablePermission
       boolean useCached) throws ThriftSecurityException {
     targetUserExists(user);
 
+    // Allow all users to read root and metadata tables
     if ((table.equals(SystemTables.METADATA.tableId()) || 
table.equals(SystemTables.ROOT.tableId()))
         && permission.equals(TablePermission.READ)) {
       return true;
     }
 
+    // Allow root user to scan all system tables
+    if (user.equals(getRootUsername()) && SystemTables.containsTableId(table)

Review Comment:
   We probably do not need to hard code this access for root because the root 
user can grant itself access by default.



##########
test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java:
##########
@@ -703,8 +710,16 @@ public void tablePermissionTest() throws Exception {
         loginAs(rootUser);
         verifyHasOnlyTheseTablePermissions(c, c.whoami(), 
SystemTables.METADATA.tableName(),
             TablePermission.READ, TablePermission.ALTER_TABLE);
-        String tableName = getUniqueNames(1)[0] + "__TABLE_PERMISSION_TEST__";
 
+        // check test user permissions on FATE and SCAN_REF tables
+        loginAs(testUser);
+        verifyHasOnlyTheseTablePermissions(c, test_user_client.whoami(),
+            SystemTables.FATE.tableName());
+        verifyHasOnlyTheseTablePermissions(c, test_user_client.whoami(),
+            SystemTables.SCAN_REF.tableName());
+

Review Comment:
   If the test scans the fate table here it will probably succeed because the 
namespace grants permission 
[here](https://github.com/apache/accumulo/blob/db1e6525168ba3951daa5e0e7346e1e741a0f6d7/server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java#L387).
  Would be good to also add a scan attempt here.
   
   Seems like we need to remove this namespace code because there is table code 
that already grants anyone access to read metadata and root.   Was not sure if 
removing that would impact the system user, but it does not seem it will 
because SecurityOperation has an explicit check that gives the system user all 
permissions.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to