CIFS Access Base Enumeration Setup
Symptoms
Oftentimes, Users accessing a CIFS/SMB share are able to see folders and files that they do not have permission to access. Although access is visibility denied when attempting to open these resources, the visibility alone can cause confusion and unnecessary support requests.
In environments with shared data, this often leads to users assuming incorrect permissions or believing sensitive data is exposed when in fact that is not the case!
Purpose
This KB explains how to enable Access-Based Enumeration (ABE) on CIFS shares in SoftNAS so that users only see files and directories they are explicitly authorized to access.
ABE improves security posture, reduces user confusion, and aligns CIFS behavior with the principle of least privilege by hiding inaccessible objects from view.
Resolution
What is Access-Based Enumeration (ABE)?
Access-Based Enumeration is a CIFS/SMB feature that filters directory listings based on the user’s effective permissions. When enabled:
Users only see folders/files they have read permissions for
Unauthorized objects are completely hidden, not just inaccessible
Permission enforcement remains unchanged. Only visibility is affected
Enabling ABE on a CIFS Share (SoftNAS)
Step 1: Edit the Samba configuration file
Open the Samba config file:
vim /etc/samba/smb.conf
In the [global] section, add this line just below the last directive:
access based share enum = yes
Example:
client max protocol = SMB3
access based share enum = yes
Step 2: Update the share definition
Find the [Volume] sharename in the config and add the two lines below to control visibility of unreadable/unwritable files and folders:
hide unreadable = yes
hide unwritable files = yes
Example:
[vol1]
writable = yes
browseable = yes
public = yes
guest ok = yes
path = /pool1/vol1
directory mask = 0777
create mask = 0777
vfs objects = shadow_copy2 acl_xattr streams_depot
shadow: snapdir = .zfs/snapshot
shadow: sort = desc
shadow: snapprefix = .*
shadow: delimiter = -
shadow: format = -%Y%m%d-%H%M%S
shadow: localtime = no
hide unreadable = yes
hide unwritable files = yes
Step 3: Restart Samba services
Restart the necessary Samba and Winbind services to apply changes:
systemctl restart sernet-samba-smbd
systemctl restart sernet-samba-winbindd
Verify that the services restarted successfully:
systemctl status sernet-samba-smbd
systemctl status sernet-samba-winbindd
Setting the User Permissions from the Windows Security tab via UNC path
1. Connect to the Share
Open Windows Explorer.
Enter \\softnasIP in the address bar and press Enter. NOTE: replace this (\\softnasIP) with your actual softnasIP
2. Set Folder Permissions via Security Tab
Right-click on the volume/sharename (e.g., vol1) → select Properties.
Go to the Security tab.
Click Edit to change permissions.
Click Add → enter the domain user/group name (e.g., LAB\Administrator) → give the domain user full permissions and click OK.
Right-click on the volume/sharename (e.g., vol1) → select Properties again
Remove the ‘Everyone’ User and click Ok.
NOTE: Only remove this user when you are sure a Domain admin with full permissions have been already added to the share to avoid being locked out.Right-click on the volume/sharename (e.g., vol1) → select Properties again
Now you can start adding your desired users
Select the user → check the desired permission boxes:
Allow → Full Control / Modify / Read & Execute as needed
Deny → Explicitly deny any access you want to block
Click Apply, then OK to close all dialogs.
Create multiple Folders (e.g., folderA, folderB, folderC) under the volume/sharename
3. Confirm Inheritance
To prevent unwanted inherited access:
Go to Advanced under the Security tab.
Uncheck “Include inheritable permissions from this object’s parent” if you want to break inheritance.
NOTE: This must be done on the volume/sharename itself firstChoose to Convert or Remove inherited permissions.
Ensure only desired entries remain.
Click OK to save.
Visibility Testing (Access-Based Enumeration)
Once permissions are in place:
Test 1 – User sees only allowed folders:
Log in to a test Windows PC that is connected to you DC as LAB\qauser1.
Open \\softnasIP\vol1
You should only see folders where qauser1 has access.
Folders where access is denied or not granted should be invisible, assuming:hide unreadable = yes
hide unwritable files = yes
ACLs are working as expected
Test 2 – Login as another user (e.g.,qauser2) and repeat.
3. Confirm Inheritance
To prevent unwanted inherited access:
Go to Advanced under the Security tab.
Uncheck “Include inheritable permissions from this object’s parent” if you want to break inheritance.
Choose to Convert or Remove inherited permissions.
Ensure only desired entries remain.
Click OK to save.
Done