All Projects → voxpupuli → puppet-posix_acl

voxpupuli / puppet-posix_acl

Licence: Apache-2.0 license
A puppet module for POSIX ACLs

Programming Languages

ruby
36898 projects - #4 most used programming language
Dockerfile
14818 projects
Puppet
460 projects

Projects that are alternatives of or similar to puppet-posix acl

puppet-logstash
Puppet module to manage Logstash
Stars: ✭ 193 (+1186.67%)
Mutual labels:  puppet, linux-puppet-module
puppet-kafka
The kafka module for managing the installation and configuration of Apache Kafka
Stars: ✭ 30 (+100%)
Mutual labels:  puppet, linux-puppet-module
puppet-stash
A puppet module to install atlassian stash
Stars: ✭ 19 (+26.67%)
Mutual labels:  puppet, linux-puppet-module
puppet-postfix
Puppet postfix module
Stars: ✭ 72 (+380%)
Mutual labels:  puppet, linux-puppet-module
puppet-kmod
manage kernel module with puppet
Stars: ✭ 18 (+20%)
Mutual labels:  puppet, linux-puppet-module
puppet-openldap
Manage OpenLDAP with Puppet
Stars: ✭ 35 (+133.33%)
Mutual labels:  puppet, linux-puppet-module
puppet-mrepo
Puppet module for creating and managing RPM based repository mirrors.
Stars: ✭ 17 (+13.33%)
Mutual labels:  puppet, linux-puppet-module
puppet-snmp
Puppet module to manage Net-SNMP.
Stars: ✭ 33 (+120%)
Mutual labels:  puppet, linux-puppet-module
puppet-kibana
Kibana Puppet module by Elastic.
Stars: ✭ 17 (+13.33%)
Mutual labels:  puppet, linux-puppet-module
puppet-prometheus
Puppet module for prometheus
Stars: ✭ 56 (+273.33%)
Mutual labels:  puppet, linux-puppet-module
puppet-keepalived
Puppet Module to manage Keepalived
Stars: ✭ 47 (+213.33%)
Mutual labels:  puppet, linux-puppet-module
puppet-elasticsearch
Elasticsearch Puppet module
Stars: ✭ 406 (+2606.67%)
Mutual labels:  puppet, linux-puppet-module
puppet-dhcp
Puppet module for deploying dhcp
Stars: ✭ 41 (+173.33%)
Mutual labels:  puppet, linux-puppet-module
puppet-vmwaretools
Puppet module to manage VMware Operating System Specific Packages for VMware tools installation.
Stars: ✭ 34 (+126.67%)
Mutual labels:  puppet, linux-puppet-module
puppet-rundeck
Module for managing the installatation and configuration of the rundeck orchestration tool
Stars: ✭ 37 (+146.67%)
Mutual labels:  puppet, linux-puppet-module
puppet-puppetserver
Puppet module for puppetserver
Stars: ✭ 21 (+40%)
Mutual labels:  puppet, linux-puppet-module
puppet-jira
Atlassian JIRA Puppet Module
Stars: ✭ 62 (+313.33%)
Mutual labels:  puppet, linux-puppet-module
puppet-network
Types and providers to manage network interfaces
Stars: ✭ 69 (+360%)
Mutual labels:  puppet, linux-puppet-module
puppet-hiera
Hiera hierarchy module for templating `hiera.yaml`
Stars: ✭ 32 (+113.33%)
Mutual labels:  puppet, linux-puppet-module
puppet-healthcheck
Puppet resources to evaluate the health and status of things.
Stars: ✭ 22 (+46.67%)
Mutual labels:  puppet, linux-puppet-module

posix_acl

Table of Contents

  1. Description
  2. Setup
  1. Usage
  1. Limitations

Description

This plugin module provides a way to set POSIX 1.e (and other standards) file ACLs via Puppet. It provides one class, posix_acl::requirements, which installs the acl package. It provides setfacl and getfacl. Those binaries are used by the Puppet Provider. You don't have to use the class, but the binaries need to be present. Puppet will autorequire the package. That means that all posix_acl resources will be applied after the acl package is installed, if the package resource is in the catalog.

The type also has logic to autorequire filepaths. It will check the catalog for the path where you want to set ACLs and any paths above. If recursive is set to true, also ascendings paths are autorequired.

Setup

Beginning with posix_acl

  • The posix_acl resource title is used as the path specifier.
  • ACLs are specified in the permission property as an array of strings in the same format as is used for setfacl.
  • The action parameter can be one of set, exact, unset or purge. These are described in detail below.
  • The provider parameter allows a choice of filesystem ACL provider. Currently only POSIX 1.e is implemented.
  • The recursive parameter allows you to apply the ACLs to all files under the specified path.
  • The ignore_missing parameter allows you to set the behavior in case the specified path is not found.
posix_acl { "/var/log/httpd":
  action     => set,
  permission => [
    "user::rwx",
    "group::---",
    "mask::r-x",
    "other::---",
    "group:logview:r-x",
    "default:user::rwx",
    "default:group::---",
    "default:mask::rwx",
    "default:other::---",
    "default:group:logview:r-x",
  ],
  provider   => posixacl,
  require    => [
    Group["logview"],
    Package["httpd"],
    Mount["/var"],
  ],
  recursive  => false,
}

Usage

Using action => set

The set option for the action parameter allows you to specify a minimal set of ACLs which will be guaranteed by Puppet. ACLs applied to the path which do not match those specified in the permission property will remain unchanged.

Initial permissions

# file /var/www/site1
user::rwx
group::r-x
other::r-x
mask::rwx
group:webadmin:r-x
group:httpadmin:rwx

Specified acls

permission  => [
  'user::rwx',
  'group::r-x',
  'other::r-x',
  'mask::rwx',
  'group:webadmin:rwx',
  'user:apache:rwx',
],

Updated permissions

# file /var/www/site1
user::rwx
group::r-x
other::r-x
mask::rwx
user:apache:rwx
group:webadmin:rwx
group:httpadmin:rwx

Using action => exact

The exact option for the action parameter will specify the exact set of ACLs guaranteed and enforced by Puppet. ACLs applied to the path which do not match those specified in the permission property will be removed.

Initial permissions

# file /var/www/site1
user::rwx
group::r-x
other::r-x
mask::rwx
group:webadmin:r-x
group:httpadmin:rwx

Specified acls

permission  => [
  'user::rwx',
  'group::r-x',
  'other::r-x',
  'mask::rwx',
  'group:webadmin:r--',
  'user:apache:rwx',
],

Updated permissions

  • group:httpadmin permission is removed
  • user:apache permission is added
  • group:webadmin permission is updated
# file /var/www/site1
user::rwx
group::r-x
other::r-x
mask::rwx
group:webadmin:r--
user:apache:rwx

Using action => unset

The unset option for the action parameter will specify the set of ACLs guaranteed by Puppet to NOT be applied to the path. ACLs applied to the path which match those specified in the permission property will be removed. ACLs applied to the path which do not match those specified in the permission property will remain unchanged.

Initial permissions

# file /var/www/site1
user::rwx
group::r-x
other::r-x
mask::rwx
group:webadmin:r-x
group:httpadmin:rwx

Specified acls

permission  => [
  'user::rwx',
  'group::r-x',
  'other::r-x',
  'mask::rwx',
  'group:webadmin:r--',
  'user:apache:rwx',
],

Updated permissions

# file /var/www/site1
user::rwx
group::r-x
other::r-x
mask::rwx
group:httpadmin:rwx

Using action => purge

The purge option for the action parameter will cause Puppet to remove any file ACLs applied to the path.

NOTE: Although the permission property is unused for this action, it needs to have a valid ACL value for the action to work. This is a known issue.

Initial permissions

# file /var/www/site1
user::rwx
group::r-x
other::r-x
mask::rwx
group:webadmin:r-x
group:httpadmin:rwx

Specified acls

See note above.

permission  => [
  'user::rwx',
  'group::r-x',
  'other::r-x',
  'mask::rwx',
  'group:webadmin:r--',
  'user:apache:rwx',
],

Updated permissions

  • All file ACLs are removed.
# file /var/www/site1
user::rwx
group::r-x
other::r-x

Using ignore_missing

The ignore_missing parameter allows to set the behavior in case the specified path does not exist. It can take these values:

  • false (default): If the path is missing, an Error is raised.
  • notify: If the path is missing, no action is taken, but a notice is shown in the agent output.
  • quiet: If the path is missing, the ACL is silently ignored.

Limitations

Conflicts with "file" resource type:

If the path being modified is managed via the File resource type, the path's mode bits must match the value specified in the permission property of the ACL.

Mask check

The ACL setter doesn't recalculate the rights mask based on the user/group ACLs specified, so it is possible to specify ACLs on a file for which a more restrictive set of rights is enforced, known as "effective rights". For example, with these permission parameters on a file test:

permission  => [
  'user::rw-',
  'group::---',
  'mask::r--',
  'other::---',
  'user:apache:rwx',
  'group:root:r-x',
  'group:admin:rwx',
],

The output of getfacl test reveals a more restrictive set of effective rights, which might not be what was expected:

# file: test
# owner: root
# group: root
user::rw-
group::---
other::---
mask::r--
user:apache:rwx                 #effective:r--
group:root:r-x                  #effective:r--
group:admin:rwx                 #effective:r--
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].