-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-8566. ListSatus should check LIST ACL. #4674
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
Conversation
|
@swamirishi could you please help to review it? |
ashishkumar50
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@z-bb Thanks for working on this, Please find comment inline.
Also please update PR according to template given in https://github.com/apache/ozone/blob/master/.github/pull_request_template.md
| objectStore.setAcl(volumeObj, OzoneAcl.parseAcls( | ||
| "user:" + USER1 + ":r," + | ||
| "user:" + USER2 + ":r")); | ||
| "user:" + USER1 + ":l," + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need ":l" permission for volume object? You have modified to handle only keys permission in ListStatus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashishkumar50 Hi, Because list the volume or bucket also requires the "l" permission
For example
[hadoop@bigdata-pre-master01.nmg01 ~]$ ~/om-current/bin/ozone sh vol create vol-test
[hadoop@bigdata-pre-master01.nmg01 ~]$ ~/om-current/bin/ozone sh bucket create vol-test/blk-test
[hadoop@bigdata-pre-hdp02.nmg01 ~]$ export HADOOP_USER_NAME=test
[hadoop@bigdata-pre-hdp02.nmg01 ~]$ ~/hadoop-2.7.2-5504-ozone-client/bin/hadoop fs -ls /
[hadoop@bigdata-pre-hdp02.nmg01 ~]$ ~/hadoop-2.7.2-5504-ozone-client/bin/hadoop fs -ls /vol-test
-ls: Fatal internal error
java.lang.RuntimeException: PERMISSION_DENIED org.apache.hadoop.ozone.om.exceptions.OMException: User test doesn't have LIST permission to access volume Volume:vol-test
at org.apache.hadoop.ozone.client.OzoneVolume$BucketIterator.getNextListOfBuckets(OzoneVolume.java:527)
at org.apache.hadoop.ozone.client.OzoneVolume$BucketIterator.<init>(OzoneVolume.java:497)
at org.apache.hadoop.ozone.client.OzoneVolume.listBuckets(OzoneVolume.java:368)
at org.apache.hadoop.fs.ozone.BasicRootedOzoneClientAdapterImpl.listStatusVolume(BasicRootedOzoneClientAdapterImpl.java:801)
at org.apache.hadoop.fs.ozone.BasicRootedOzoneClientAdapterImpl.listStatus(BasicRootedOzoneClientAdapterImpl.java:885)
at org.apache.hadoop.fs.ozone.BasicRootedOzoneFileSystem.listStatusAdapter(BasicRootedOzoneFileSystem.java:869)
at org.apache.hadoop.fs.ozone.BasicRootedOzoneFileSystem.listStatus(BasicRootedOzoneFileSystem.java:844)
at org.apache.hadoop.fs.shell.PathData.getDirectoryContents(PathData.java:268)
at org.apache.hadoop.fs.shell.Command.recursePath(Command.java:373)
at org.apache.hadoop.fs.shell.Ls.processPathArgument(Ls.java:90)
at org.apache.hadoop.fs.shell.Command.processArgument(Command.java:271)
at org.apache.hadoop.fs.shell.Command.processArguments(Command.java:255)
at org.apache.hadoop.fs.shell.Command.processRawArguments(Command.java:201)
at org.apache.hadoop.fs.shell.Command.run(Command.java:165)
at org.apache.hadoop.fs.FsShell.run(FsShell.java:287)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
at org.apache.hadoop.fs.FsShell.main(FsShell.java:340)
Caused by: PERMISSION_DENIED org.apache.hadoop.ozone.om.exceptions.OMException: User test doesn't have LIST permission to access volume Volume:vol-test
at org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB.handleError(OzoneManagerProtocolClientSideTranslatorPB.java:710)
at org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB.listBuckets(OzoneManagerProtocolClientSideTranslatorPB.java:632)
at org.apache.hadoop.ozone.client.rpc.RpcClient.listBuckets(RpcClient.java:1188)
at org.apache.hadoop.ozone.client.OzoneVolume$BucketIterator.getNextListOfBuckets(OzoneVolume.java:525)
... 17 more
If add "l" permission to volume, then
[hadoop@bigdata-pre-master01.nmg01 ~]$ export HADOOP_USER_NAME=hadoop
[hadoop@bigdata-pre-master01.nmg01 ~]$ ~/om-current/bin/ozone sh vol addacl -a user:test:l /vol-test
ACL user:test:l[ACCESS] added successfully.
[hadoop@bigdata-pre-hdp02.nmg01 ~]$ export HADOOP_USER_NAME=test
[hadoop@bigdata-pre-hdp02.nmg01 ~]$ ~/hadoop-2.7.2-5504-ozone-client/bin/hadoop fs -ls /vol-test
Found 1 items
drwxrwxrwx - hadoop hadoop 0 2023-05-10 17:17 /vol-test/blk-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But according to documentation it needs only READ permission on volume and for bucket it needs LIST and READ for listKeys. Can you please check for list Key behaviour as well.
https://ozone.apache.org/docs/1.3.0/security/securitywithranger.html
What changes were proposed in this pull request?
In the listKeys method,ACLType is LIST, but in the listStatus method, ACLType is READ
So it causes inconsistent return information.
I think listStatus should also check LIST.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8566
How was this patch tested?
Unit tests.