Forge Home

firewall

Unified Firewall management for Windows, Linux, Mac OS/X

12,213 downloads

11,918 latest version

4.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.1.1 (latest)
  • 0.1.0
released Dec 18th 2014
This version is compatible with:

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'gildas-firewall', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add gildas-firewall
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install gildas-firewall --version 0.1.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

gildas/firewall — version 0.1.1 Dec 18th 2014

puppet-firewall

Firewall management for Windows, Linux, and OS/X

Note: At the moment, only Windows (7, 2008R2, 8, 8.1, 2012R2) is implemented.

Description

Unified types and rules to manage firewall.

Installation

Via puppet module:

$ puppet module install gildas-firewall

Via librarian-puppet or r10k, by adding the following line to your Puppetfile:

mod 'gildas/firewall'

Usage

Load the base class:

include firewall

By default, firewall resources that are declared in hiera will be automatically loaded and created. If you do not want this behavior, configure the base class as follows:

class {'firewall':
  hiera_loader => false
}

Configuring the firewall

To configure firewall rules, simply instanciate resources in you manifests, e.g.:

  firewall::rule { 'SQLServer':
    rule        => 'SQLServer-Instance-In-TCP',
    ensure      => enabled,
    create      => true,
    display     => 'SQLServer Instance (TCP-In)',
    description => 'Inbound Rule to access the SQLServer instance [TCP 1433]',
    action      => 'Allow',
    direction   => 'Inbound',
    protocol    => 'TCP',
    local_port  => 1433,
  }

This resource creates a rule (as needed) to allow incoming SQL Server communication.

If a rule should already exist in Windows and just be enabled or disabled, you can do the following:

  firewall::rule { 'WinRM':
    rule   => 'WINRM-HTTP-In-TCP-NoScope',
    ensure => enabled,
  }

Note: It is not possible to delete rules yet.

Similarly, it is possible to enable firewall groups:

  firewall::group { 'File and Printer Sharing':
    group  => '@FirewallAPI.dll,-28502',
    ensure => enabled,
  }

Note: It is not possible to create/delete groups yet.

Finally, managing firewall profiles:

  firewall::profile { "Private":
    profile => "Private",
    ensure  => enabled,
  }

Hiera configuration

If you use hiera, the puppet class firewall will search for firewall entries and create resources. At the moment, the following firewall entries are available:

  • firewall::profiles
  • firewall::groups
  • firewall::rules

For example, to configure the Remote Desktop group in Windows, add the following to you hiera database:

{
  ...

  "firewall::groups": {
    "Remote Desktop":
    {
      "group":  "@FirewallAPI.dll,-28752",
      "ensure": "enabled"
    }
  },

  ...
}

Or to accept WinRM connections over HTTP on Windows 8/8.1:

{
  ...

  "firewall::rules": {
    "WINRM-HTTP-In-TCP-NoScope":
    {
      "rule": "WINRM-HTTP-In-TCP-NoScope",
      "ensure": "enabled"
    },
  
  ...
}