Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.

Major update of module from asasfu #30

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
50e0dd9
Changed reload from complete-reload to reload
asasfu Jun 26, 2015
cdb85e6
Changed zone target and short to be property rather than param
asasfu Jun 26, 2015
23d5309
Patched up holes in rich_rules management via firewalld_zone
asasfu Jun 26, 2015
0830ee0
Added support for zone ensure => absent
asasfu Jun 26, 2015
be69355
Needed quotes around false in the invert rules of zoneprovider
asasfu Jun 30, 2015
b4fac9b
Added ability to set zoneprovider target to ''
asasfu Jul 2, 2015
ec244e6
Added insync method overloads to all values that are arrays
asasfu Jul 2, 2015
9338209
Fixed target's sync check
asasfu Jul 4, 2015
02000b5
Added support for Ubuntu 15.x to replace UFW
asasfu Jul 20, 2015
6cdeff8
Minor version bump for fixes to module.
asasfu Jul 20, 2015
565badf
Fixed the ability to turn on logging
asasfu Aug 31, 2015
9b74b41
Added consistency checking for firewalld to IPTables
asasfu Sep 2, 2015
7115aa3
Upgraded cleanup of nils in instances to support all nils
asasfu Sep 2, 2015
c9f7473
Cleanup comments from development process
xbezdick Sep 20, 2015
58f91e2
Fix for broken notify metaparam
asasfu Sep 13, 2015
81d435c
Enable travis tests
xbezdick Sep 18, 2015
f682038
Reload the service rather than restart the service
cvtienhoven Jun 8, 2015
66b83f5
Add spec acceptance
xbezdick Sep 21, 2015
8f8c256
Resolve notify issue
xbezdick Sep 21, 2015
439fac7
Workaround consistent? issue in zonefile
xbezdick Sep 21, 2015
4a4609f
Add hack for firewalld reload with missing zone file
xbezdick Sep 22, 2015
89f0460
The repository is unmaintained.
xbezdick Jan 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -ev
rake lint
rake syntax
# we can't ssh to localhost
#rspec spec/acceptance
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: ruby
install:
script: "./.travis.sh"
rvm:
- 2.0.0
matrix:
fast_finish: true
env:
matrix:
notifications:
email: false
irc:
template:
- "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}"
- "Change view : %{compare_url}"
- "Build details : %{build_url}"
channels:
- "chat.freenode.net#rdo-puppet"
on_success: always
on_failure: always
use_notice: true
skip_join: true
29 changes: 29 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
source 'https://rubygems.org'

group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', '~> 2.1.0', :require => false

gem 'metadata-json-lint'
gem 'puppet-lint-param-docs'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-absolute_template_path'
gem 'puppet-lint-trailing_newline-check'

# Puppet 4.x related lint checks
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-numericvariable'

gem 'rspec', :require => false
gem 'beaker-rspec', :require => false
gem 'beaker-puppet_install_helper', :require => false
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end

22 changes: 1 addition & 21 deletions README
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
This is puppet-firewalld a puppet module for firewalld.

You have several ways how to install it:

a) Install module from Puppet Forge
# puppet module install jpopelka-firewalld

b) If you run Fedora/EPEL7, use
# yum install puppet-firewalld

c) If you want to keep up with upstream git repo, you can do:
$ cd ~; mkdir git; cd git
$ git clone https://github.com/jpopelka/puppet-firewalld.git
$ su -c 'ln -s /home/user/git/puppet-firewalld /etc/puppet/modules/firewalld'


Look in the examples/ folder for usage.

See http://jpopelka.fedorapeople.org/puppet-firewalld/doc
for documentation, or generate it yourself:
puppet doc --mode rdoc --outputdir ./moduledocs --modulepath /etc/puppet/modules/
EOL - Use https://github.com/crayfishx/puppet-firewalld
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'

PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_parameter_defaults')
35 changes: 18 additions & 17 deletions examples/direct.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@

# this can be run with 'puppet apply direct.pp'

class {'firewalld::direct':
chains => [{
ipv => 'ipv4',
#table => 'filter',
chain => 'mine',},],

rules => [{
ipv => 'ipv4',
#table => 'filter',
chain => 'mine',
#priority => '1',
args => "-j LOG --log-prefix 'my prefix'",},
{
ipv => 'ipv4',
table => 'mangle',
chain => 'PREROUTING',
args => "-p tcp -m tcp --dport 123 -j MARK --set-mark 1' -j DROP",},],
class { '::firewalld::direct':
chains => [{
ipv => 'ipv4',
#table => 'filter',
chain => 'mine',}
,],
rules => [{
ipv => 'ipv4',
#table => 'filter',
chain => 'mine',
#priority => '1',
args => "-j LOG --log-prefix 'my prefix'",
}, {
ipv => 'ipv4',
table => 'mangle',
chain => 'PREROUTING',
args => "-p tcp -m tcp --dport 123 -j MARK --set-mark 1' -j DROP",
},],
}
23 changes: 15 additions & 8 deletions examples/lockdown_whitelist.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@

# this can be run with 'puppet apply lockdown-whitelist.pp'

class {'firewalld::configuration':
lockdown => 'yes',}
class { '::firewalld::configuration':
lockdown => 'yes',
}

class {'firewalld::lockdown_whitelist':
selinux_contexts => ['system_u:system_r:NetworkManager_t:s0',
'system_u:system_r:virtd_t:s0-s0:c0.c1023'],
commands => ['/usr/bin/python -Es /usr/bin/firewall-config'],
users => [{username => 'me'},
{userid => '1020'},],}
class { '::firewalld::lockdown_whitelist':
selinux_contexts => [
'system_u:system_r:NetworkManager_t:s0',
'system_u:system_r:virtd_t:s0-s0:c0.c1023'
],
commands => ['/usr/bin/python -Es /usr/bin/firewall-config'],
users => [{
username => 'me'
}, {
userid => '1020'
}],
}
14 changes: 10 additions & 4 deletions examples/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@

# define a service
firewalld::service { 'dummy':
description => 'My dummy service',
ports => [{port => '1234', protocol => 'tcp',},],
modules => ['some_module_to_load'],
destination => {ipv4 => '224.0.0.251', ipv6 => 'ff02::fb'},
description => 'My dummy service',
ports => [{
port => '1234',
protocol => 'tcp',
},],
modules => ['some_module_to_load'],
destination => {
ipv4 => '224.0.0.251',
ipv6 => 'ff02::fb'
},
}
87 changes: 42 additions & 45 deletions examples/zone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,50 @@
#
# run this with 'puppet apply zone.pp'

class {'firewalld::configuration':
default_zone => 'custom',
class { '::firewalld::configuration':
default_zone => 'custom',
}

# define a zone
firewalld::zone { 'custom':
description => 'This is an example zone',
services => ['ssh', 'dhcpv6-client'],
ports => [{
port => '1234',
protocol => 'tcp',},],
masquerade => true,
forward_ports => [{
port => '123',
protocol => 'tcp',
to_port => '321',
to_addr => '1.2.3.4',},],
rich_rules => [{
family => 'ipv4',
source => {
address => '1.1.1.1',
invert => true,},
destination => {
address => '2.2.2.2/24',},
# service => 'ssh',
port => {
portid => '123-321',
protocol => 'udp',},
# these are commented out because you can specify only one of
# {service, port, protocol, icmp_block, masquerade, forward_port}
# protocol => 'ah',
# icmp_block => 'router-solicitation',
# masquerade => true,
# forward_port => {
# portid => '555',
# protocol => 'udp',
# to_port => '666',
# to_addr => '6.6.6.6',},
log => {
prefix => 'testing',
level => 'notice',
limit => '3/s',},
audit => {
limit => '2/h',},
action => {
action_type => 'reject',
reject_type => 'icmp-host-prohibited',
limit => '2/m',},
},],
description => 'This is an example zone',
services => ['ssh', 'dhcpv6-client'],
masquerade => true,
ports => [{
port => '1234',
protocol => 'tcp',
},],
forward_ports => [{
port => '123',
protocol => 'tcp',
to_port => '321',
to_addr => '1.2.3.4',
},],
rich_rules => [{
family => 'ipv4',
source => {
address => '1.1.1.1',
invert => true,
},
destination => {
address => '2.2.2.2/24',
},
port => {
portid => '123-321',
protocol => 'udp',
},
log => {
prefix => 'testing',
level => 'notice',
limit => '3/s',
},
audit => {
limit => '2/h',
},
action => {
action_type => 'reject',
reject_type => 'icmp-host-prohibited',
limit => '2/m',
},
},],
}
Loading