Permissions on Windows have never been a simple thing to manage. Unix Mode does a reasonable job administering some permissions, but what most Windows admins really want is to work with the actual permissions. Show
We heard you loud and clear. And yes, we have a module for that. You can work directly with ACLs (Access Control Lists) and to a degree, security descriptors, through the puppetlabs-acl module. The ACL module serves to make that process easy for you while satisfying your needs for very advanced permissions. The ACL module was released in May 2014, and works with Puppet Enterprise 3.2+ (and open source Puppet 3.4.0+). ACL became a supported module as soon as it was released. ACL adds a type and provider for Windows so you can manage those pesky permissions without a ton of hassle. Let’s talk about a couple of real-world scenarios:
These are very possible with the ACL module and just a few short lines of Puppet code. We’ll show you that in the Examples section below, but first let’s talk about ACLs and ACEs for those who want a refresher. ACLs and ACEs, oh my!ACLs (also called Discretionary Access Control Lists) typically contain a list of access control entries (ACEs). An ACE is a defined trustee (identity) with a set of rights, and information about how those rights are passed to (and inherited by) child objects — for example, files and folders. For each ACE, the ACL contains an allowed/denied status, as well as the ACE's propagation strategy. You cannot specify inherited ACEs in a manifest; you can only specify whether to allow upstream inheritance to flow into the managed target location (the location where you are applying the ACL). ##ACL features Here are some features of Puppet’s ACL you should know:
Here’s what sets Puppet’s ACL module apart from other configuration management tools:
##Getting Started Let’s take a look at what a typical ACL resource looks like: If you were to run the above on a system that had the module installed, you would be giving the Administrator account full access to the temp folder, and giving the Users group access to read and execute (and list for folders). All the other options are set to Windows defaults, but if we need to get to them, we can. Let’s look at that same ACL resource with all the options specified: We have just specified the resource with all parameters and properties specified; what you are seeing is how the defaults line up. The only exception here are owner and group, which by default are not managed unless specified. The defaults for these depend on the user that created the target (the folder) and could be different based on who the user has as their default group and owner. With both of the above examples we have done the following:
By default, if a user is not granted access through an ACE (whether individually or as a member of a group), then Windows will deny access. So if a user is not the Administrator account and not a member of the Users group, they will not have access to c:\temp. With the ACL module, this also means that access could be granted outside of Puppet (when purge => ‘false’) and/or it is an inherited ACE (when inherit_parent_permissions => ‘true’). ACL type structureNow let’s take a look at the ACL type and all it has to offer. ParametersThe parameters are (bold means the parameter is required):
PropertiesThe properties are (bold means the property is required):
Permissions propertyThe permissions property could be considered the most important part of the ACL resource, because it contains each ACE in the order specified for the ACL. The available elements for each ACE hash are identity, rights, type, child_types, affects, and mask. The elements are (bold means the key is required):
For more specific details and up-to-date information on the ACL type, see the usage documentation. ExamplesIn the following examples we are going to show you how to lock down a folder, set appropriate permissions for a website, and set very granular permissions. Locking down a folder for sensitive dataHere’s what you need to do when you keep sensitive data in a specific folder, and need to limit access to administrators only. We’ve done the following:
That was pretty simple! And very self-documenting as well. It’s worth mentioning that one goal of Puppet is for anyone to be able to read and understand the intent of the code, and the ACL module does not disappoint. Now let’s try something a little more involved. Website setup with ACLsLet’s take a look at setting up an IIS site and locking down permissions. The script above does the following:
All of that, done in just a few lines of code! You can add more for getting the files there in the first place, using Puppet, but I have left that as an exercise for the reader :) Granular permissionsIn our last example, let’s get into very granular permissions. We’ve done the following:
So you see 1507839 and it looks like a magic number. How does one arrive at this number? I wrote a blog post on this once that shows you how to add up the numbers. Now we have a much simpler way to add those permissions: We have created and made available a worksheet to add up the ACL rights mask! This will allow you to add up the rights and will give you a heads up if you should use named rights from the module (like read or execute or a combination of read, execute). Tips for using ACLsHere are some tips to consider when using ACL:
ACL module: We think it’s awesome, and we think you will, too!ACLs on Windows give you a lot of control over permissions. The ACL module harnesses that ability and makes it easy — even fun — to control permissions on Windows. While the ACL module makes it easy to get started, it allows advanced users to manage permissions in granular detail. And did we mention it’s a supported module? That means you get the same support for this module that you get with your Puppet Enterprise license. Give the ACL module a look today — if you manage permissions on Windows, we think you are going to love it! Rob Reynolds is a software engineer at Puppet Labs. ##Learn more
What is an access control list in Windows?An access control list (ACL) is a list of ACEs created by the operating system to control the security behavior associated with a given (protected) object of some sort. In Windows there are two types of ACLs: Discretionary ACL--this is a list of zero or more ACEs that describe the access rights for a protected object.
Which type of control is access control?Three main types of access control systems are: Discretionary Access Control (DAC), Role Based Access Control (RBAC), and Mandatory Access Control (MAC).
What type of access control is Active Directory?Access privileges for resources in Active Directory Domain Services are usually granted through the use of an access control entry (ACE). An ACE defines an access or audit permission on an object for a specific user or group.
What are file access control lists?An ACL is a list of permissions that are associated with a directory or file. It defines which users are allowed to access a particular directory or file. An access control entry in the ACL defines the permissions for a user or a group of users.
|