tcpwrappers

pdk
Puppet module for managing tcpwrappers with Augeas

Miami University of Ohio

MiamiOH

25,765 downloads

1,247 latest version

5.0 quality score

Version information

  • 1.2.2 (latest)
  • 1.2.1
  • 1.1.0
released Aug 25th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 3.0.0 < 7.0.0
  • RedHat
    ,
    CentOS
    ,
    OracleLinux
    ,
    Debian
    ,
    Ubuntu

Start using this module

Documentation

MiamiOH/tcpwrappers — version 1.2.2 Aug 25th 2020

tcpwrappers

Build Status Puppet Forge Puppet Forge Downloads Puppet Forge Score

Formerly: netmanagers/puppet-tcpwrappers

Getting started

This is a Puppet module for tcpwrappers

It provides only package installation and file configuration (hosts.allow / hosts.deny).

Based on:

Official site: http://www.netmanagers.com.ar

USAGE - Basic management

TCP wrappers are installed by default in almost every Linux system around and you'll rarely use this capabilities, but they are provided by every Example42 module, so they are available here too. I just removed the "harmful" ones, like the possibility to remove the package.

  • Install tcpwrappers with default settings

      class { 'tcpwrappers': }
    
  • Managing entries in /etc/hosts.allow and /etc/hosts.deny.

    Parameters daemon defaults to ALL and client defaults to $title if not specified.

      # Simple client specification
      tcpwrappers::allow { '192.0.2.0/24': }
    

    and

      tcpwrappers::allow { foo:
        daemon => "ALL",
        client => "192.0.2.0/24";
      }
    

    are equivalent, and add an entry

      ALL: 192.0.2.0/24
    

    into /etc/hosts.allow

      # With an exception specification
      tcpwrappers::allow { foo:
        daemon => "daemon",
        client => "ALL",
        except => "/etc/hosts.deny.inc";
      }
    

    Adds an entry

      daemon: ALL EXCEPT "/etc/hosts.deny.inc"
    

tcpwrappers::deny accepts the same parameters

The following parameters are available:

  • ensure: Whether the entry should be "present" or "absent".

  • daemon: The identifier supplied to libwrap by the daemon, often just the process name.

  • client: The client specification to be added.

  • except (optional): Another client specification, acting as a filter for the first client specifiction.

    The $client and $except parameters must have one of the following forms:

      FQDN:          example.com
      Domain suffix: .example.com
      IP address:    192.0.2.1
      IP prefix:     192. 192.0. 192.0.2.
      IP range:      192.0.2.0/24 192.0.2.0/255.255.255.0
      Filename:      /path/to/file.acl
      Keyword:       ALL LOCAL PARANOID
    

    The client specification will be normalized before being matched against or added to the existing entries in hosts.allow/hosts.deny.

  • Install a specific version of tcpwrappers package

      class { 'tcpwrappers':
        version => '1.0.1',
      }
    
  • Enable auditing without without making changes on existing tcpwrappers configuration files

      class { 'tcpwrappers':
        audit_only => true
      }
    
  • Module dry-run: Do not make any change on all the resources provided by the module

      class { 'tcpwrappers':
        noops => true
      }
    

USAGE - Overrides and Customizations

  • Use custom sources for main config file

      class { 'tcpwrappers':
        allow_source => [ "puppet:///modules/netmanagers/tcpwrappers/hosts_allow-${hostname}",
                          "puppet:///modules/netmanagers/tcpwrappers/hosts_allow.conf" ],
        deny_source  => [ "puppet:///modules/netmanagers/tcpwrappers/hosts_deny-${hostname}",
                          "puppet:///modules/netmanagers/tcpwrappers/hosts_allow.conf" ],
      }
    
  • Use custom template for main config file. Note that template and source arguments are alternative.

      class { 'tcpwrappers':
        allow_template => 'netmanagers/tcpwrappers/hosts_allow.erb',
      }
    

    and provide custom values using the "$options" parameter.

  • Automatically include a custom subclass

      class { 'tcpwrappers':
        my_class => 'netmanagers::my_tcpwrappers',
      }