Skip to content

Commit 6c1a5ee

Browse files
authored
HDDS-7240. List all volume operation should go through ACL check as well in order to trigger audit logging (#3770)
1 parent 1a6b4d2 commit 6c1a5ee

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

hadoop-hdds/common/src/main/resources/ozone-default.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,11 @@
608608
<description>
609609
Allows everyone to list all volumes when set to true. Defaults to true.
610610
When set to false, non-admin users can only list the volumes they have
611-
access to. Admins can always list all volumes.
611+
access to. Admins can always list all volumes. Note that this config
612+
only applies to OzoneNativeAuthorizer. For other authorizers, admin
613+
needs to set policies accordingly to allow all volume listing
614+
e.g. for Ranger, a new policy with special volume "/" can be added to
615+
allow group public LIST access.
612616
</description>
613617
</property>
614618
<property>

hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,12 +2712,9 @@ public List<OmVolumeArgs> listAllVolumes(String prefix, String prevKey, int
27122712
auditMap.put(OzoneConsts.USERNAME, null);
27132713
try {
27142714
metrics.incNumVolumeLists();
2715-
if (!allowListAllVolumes) {
2716-
// Only admin can list all volumes when disallowed in config
2717-
if (isAclEnabled) {
2718-
checkAcls(ResourceType.VOLUME, StoreType.OZONE, ACLType.LIST,
2719-
OzoneConsts.OZONE_ROOT, null, null);
2720-
}
2715+
if (isAclEnabled) {
2716+
checkAcls(ResourceType.VOLUME, StoreType.OZONE, ACLType.LIST,
2717+
OzoneConsts.OZONE_ROOT, null, null);
27212718
}
27222719
return volumeManager.listVolumes(null, prefix, prevKey, maxKeys);
27232720
} catch (Exception ex) {

0 commit comments

Comments
 (0)