Intentionally Creating File Server Permissions Chaos
We know you’ve been there. One day you decide to try to clean up or reorganize a file share which stores files worked on by hundreds or thousands of users and groups. You run some Powershell scripts and quickly realize the horror that is the ACLs associated with the content.
Content migrations are an excellent opportunity to cleanup or reorganize your users’ content. Permissions structures themselves are not a technological problem; they are more a reflection of how an organization functions, how users behave, or how previous administrators approached the permissions problem. Because of this we see a wide variety of permissions structures on source systems ranging from well-kept and organized to total nightmares. Cloud FastPath has solutions and automation strategies for each one and they have to be tested.
Recreating the chaos of permissions that exists in the wild is difficult. Below is a python script we use to do that. It is a handy script to create seemingly overly complex ACL structures to mimic some of the chaos we see with our customers.
Why do we think anyone would want to use this? Simple. If you’re evaluating a tool for large-scale content migration we think the way in which a solution handles permissions hell is very indicative of how successful you will be when you put it to use. So go ahead and run the script on a directory and then try to migrate the directory into a cloud service. Good luck!
Running this script will take the provided directory and apply random permissions to the contents of the directory with existing users. You can preview the result before applying it to the files and folders. The number input means how many random permissions will be generated. For example, inputting a “4” will choose four random directories or files and apply grant/revoke/read/write permissions.
Permissions Chaos Script:
What is ACL density?
This how the script determines the number of unique permissions granted on set of files and folders. This is calculated on a sliding scale to control how chaotic you want the ACLs to be. ACL density takes into account how many users there are. This is done to mimic likely real-world situations. For example, if there are a high number of users it is unlikely that a very high portion of the paths would have ACLs associated. Therefore, the larger the number that is inputted for ACL density the amount of ACLs will increase at a decreasing marginal rate.
How to remove all permissions:
script from reddit user /u/joelbarlow40