firewall_multi
Version information
This version is compatible with:
- Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 3.0.0 < 5.0.0
- , ,
Start using this module
Add this module to your Puppetfile:
mod 'alexharvey-firewall_multi', '1.0.1'Learn more about managing modules with a PuppetfileDocumentation
firewall_multi
##Overview
The firewall_multi module provides a defined type wrapper for spawning puppetlabs/firewall rules for arrays of sources and destinations.
##Usage
It is expected that a standard set up for the firewall module is followed, in particular with respect to the purging of firewall rules. If a user of this module, for instance, removed addresses from the array of sources, expecting that these rules would be deleted, this would not happen if purging is not enabled, and might be surprising to the user in a way that impacts security.
Otherwise, usage of the firewall_multi type is used in the same way as a firewall type, except that source and/or destination may optionally be an array of IP addresses or networks, and a string from x.x.x.x/x to y.y.y.y/x is appended to each rule to ensure their uniqueness in the catalog.
##Parameters
-
source: the source IP address or network or an array of sources. If not specified, a default of0.0.0.0/0is used. -
destination: the destination IP address or network or an array of destinations. If not specified, a default of0.0.0.0/0is used. -
Any other parameter accepted by
firewallis also accepted and set for eachfirewallresource created without error-checking.
##Examples
firewall_multi { '100 allow http and https access':
source => [
'10.0.0.10/24',
'10.0.0.12/24',
'10.1.1.128',
],
dport => [80, 443],
proto => tcp,
action => accept,
}
This will cause three rules to be created:
Firewall['100 allow http and https access from 10.0.0.10/24 to 0.0.0.0/0']Firewall['100 allow http and https access from 10.0.0.12/24 to 0.0.0.0/0']Firewall['100 allow http and https access from 10.1.1.128 to 0.0.0.0/0']
##Development
Please read CONTRIBUTING.md before contributing.
###Testing
Make sure you have:
- rake
- bundler
Install the necessary gems:
bundle install
Note that gems are installed in .gems and binaries in .bin. See .bundle/config.
To run the tests from the root of the source code:
bundle exec rake spec
2016-03-07 - Version 1.0.1
- Initial public release
Dependencies
The MIT License (MIT) Copyright (c) 2016 Alex Harvey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.