From 8c16d3cf95e74977287dbb2b5f28b308aa320451 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 17 Feb 2008 17:34:18 +0000 Subject: moved some for better overview git-svn-id: https://svn/ipuppet/trunk/modules/shorewall@817 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- files/shorewall.conf.Default | 180 +++++++++++++++++++++++++++++++++++++++++++ files/shorewall.conf.Gentoo. | 180 ------------------------------------------- manifests/init.pp | 36 ++++++--- 3 files changed, 207 insertions(+), 189 deletions(-) create mode 100644 files/shorewall.conf.Default delete mode 100644 files/shorewall.conf.Gentoo. diff --git a/files/shorewall.conf.Default b/files/shorewall.conf.Default new file mode 100644 index 0000000..411d7dd --- /dev/null +++ b/files/shorewall.conf.Default @@ -0,0 +1,180 @@ +#### +#### Managed by puppet, modify only on the puppetmaster +#### +############################################################################### +# /etc/shorewall/shorewall.conf V3.4 - Change the following variables to +# match your setup +# +# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm] +# +# This file should be placed in /etc/shorewall +# +# (c) 1999,2000,2001,2002,2003,2004,2005 - Tom Eastep (teastep@shorewall.net) +# +# For information about the settings in this file, type "man shorewall.conf" +# +# Additional information is available at +# http://www.shorewall.net/Documentation.htm#Conf +############################################################################### +# S T A R T U P E N A B L E D +############################################################################### + +STARTUP_ENABLED=Yes + +############################################################################### +# V E R B O S I T Y +############################################################################### + +VERBOSITY=1 + +############################################################################### +# C O M P I L E R +# (setting this to 'perl' requires installation of Shorewall-perl) +############################################################################### + +SHOREWALL_COMPILER=shell + +############################################################################### +# L O G G I N G +############################################################################### + +LOGFILE=/var/log/messages + +LOGFORMAT="Shorewall:%s:%s:" + +LOGTAGONLY=No + +LOGRATE= + +LOGBURST= + +LOGALLNEW= + +BLACKLIST_LOGLEVEL= + +MACLIST_LOG_LEVEL=info + +TCP_FLAGS_LOG_LEVEL=info + +RFC1918_LOG_LEVEL=info + +SMURF_LOG_LEVEL=info + +LOG_MARTIANS=No + +############################################################################### +# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S +############################################################################### + +IPTABLES= + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin + +SHOREWALL_SHELL=/bin/sh + +SUBSYSLOCK="" + +MODULESDIR= + +# add puppet delivered files in front +CONFIG_PATH=/var/lib/puppet/modules/shorewall:/etc/shorewall:/usr/share/shorewall + +RESTOREFILE= + +IPSECFILE=zones + +LOCKFILE= + +############################################################################### +# D E F A U L T A C T I O N S / M A C R O S +############################################################################### + +DROP_DEFAULT="Drop" +REJECT_DEFAULT="Reject" +ACCEPT_DEFAULT="none" +QUEUE_DEFAULT="none" + +############################################################################### +# R S H / R C P C O M M A N D S +############################################################################### + +RSH_COMMAND='ssh ${root}@${system} ${command}' +RCP_COMMAND='scp ${files} ${root}@${system}:${destination}' + +############################################################################### +# F I R E W A L L O P T I O N S +############################################################################### + +IP_FORWARDING=On + +ADD_IP_ALIASES=No + +ADD_SNAT_ALIASES=No + +RETAIN_ALIASES=No + +TC_ENABLED=Internal + +TC_EXPERT=No + +CLEAR_TC=Yes + +MARK_IN_FORWARD_CHAIN=Yes + +CLAMPMSS=Yes + +ROUTE_FILTER=No + +DETECT_DNAT_IPADDRS=Yes + +MUTEX_TIMEOUT=60 + +ADMINISABSENTMINDED=Yes + +BLACKLISTNEWONLY=Yes + +DELAYBLACKLISTLOAD=No + +MODULE_SUFFIX= + +DISABLE_IPV6=Yes + +BRIDGING=No + +DYNAMIC_ZONES=No + +PKTTYPE=No + +RFC1918_STRICT=No + +MACLIST_TABLE=mangle + +MACLIST_TTL= + +SAVE_IPSETS=No + +MAPOLDACTIONS=No + +FASTACCEPT=Yes + +IMPLICIT_CONTINUE=Yes + +HIGH_ROUTE_MARKS=No + +USE_ACTIONS=Yes + +OPTIMIZE=0 + +EXPORTPARAMS=Yes + +############################################################################### +# P A C K E T D I S P O S I T I O N +############################################################################### + +BLACKLIST_DISPOSITION=DROP + +MACLIST_DISPOSITION=DROP + +TCP_FLAGS_DISPOSITION=DROP + +#LAST LINE -- DO NOT REMOVE diff --git a/files/shorewall.conf.Gentoo. b/files/shorewall.conf.Gentoo. deleted file mode 100644 index 411d7dd..0000000 --- a/files/shorewall.conf.Gentoo. +++ /dev/null @@ -1,180 +0,0 @@ -#### -#### Managed by puppet, modify only on the puppetmaster -#### -############################################################################### -# /etc/shorewall/shorewall.conf V3.4 - Change the following variables to -# match your setup -# -# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm] -# -# This file should be placed in /etc/shorewall -# -# (c) 1999,2000,2001,2002,2003,2004,2005 - Tom Eastep (teastep@shorewall.net) -# -# For information about the settings in this file, type "man shorewall.conf" -# -# Additional information is available at -# http://www.shorewall.net/Documentation.htm#Conf -############################################################################### -# S T A R T U P E N A B L E D -############################################################################### - -STARTUP_ENABLED=Yes - -############################################################################### -# V E R B O S I T Y -############################################################################### - -VERBOSITY=1 - -############################################################################### -# C O M P I L E R -# (setting this to 'perl' requires installation of Shorewall-perl) -############################################################################### - -SHOREWALL_COMPILER=shell - -############################################################################### -# L O G G I N G -############################################################################### - -LOGFILE=/var/log/messages - -LOGFORMAT="Shorewall:%s:%s:" - -LOGTAGONLY=No - -LOGRATE= - -LOGBURST= - -LOGALLNEW= - -BLACKLIST_LOGLEVEL= - -MACLIST_LOG_LEVEL=info - -TCP_FLAGS_LOG_LEVEL=info - -RFC1918_LOG_LEVEL=info - -SMURF_LOG_LEVEL=info - -LOG_MARTIANS=No - -############################################################################### -# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S -############################################################################### - -IPTABLES= - -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin - -SHOREWALL_SHELL=/bin/sh - -SUBSYSLOCK="" - -MODULESDIR= - -# add puppet delivered files in front -CONFIG_PATH=/var/lib/puppet/modules/shorewall:/etc/shorewall:/usr/share/shorewall - -RESTOREFILE= - -IPSECFILE=zones - -LOCKFILE= - -############################################################################### -# D E F A U L T A C T I O N S / M A C R O S -############################################################################### - -DROP_DEFAULT="Drop" -REJECT_DEFAULT="Reject" -ACCEPT_DEFAULT="none" -QUEUE_DEFAULT="none" - -############################################################################### -# R S H / R C P C O M M A N D S -############################################################################### - -RSH_COMMAND='ssh ${root}@${system} ${command}' -RCP_COMMAND='scp ${files} ${root}@${system}:${destination}' - -############################################################################### -# F I R E W A L L O P T I O N S -############################################################################### - -IP_FORWARDING=On - -ADD_IP_ALIASES=No - -ADD_SNAT_ALIASES=No - -RETAIN_ALIASES=No - -TC_ENABLED=Internal - -TC_EXPERT=No - -CLEAR_TC=Yes - -MARK_IN_FORWARD_CHAIN=Yes - -CLAMPMSS=Yes - -ROUTE_FILTER=No - -DETECT_DNAT_IPADDRS=Yes - -MUTEX_TIMEOUT=60 - -ADMINISABSENTMINDED=Yes - -BLACKLISTNEWONLY=Yes - -DELAYBLACKLISTLOAD=No - -MODULE_SUFFIX= - -DISABLE_IPV6=Yes - -BRIDGING=No - -DYNAMIC_ZONES=No - -PKTTYPE=No - -RFC1918_STRICT=No - -MACLIST_TABLE=mangle - -MACLIST_TTL= - -SAVE_IPSETS=No - -MAPOLDACTIONS=No - -FASTACCEPT=Yes - -IMPLICIT_CONTINUE=Yes - -HIGH_ROUTE_MARKS=No - -USE_ACTIONS=Yes - -OPTIMIZE=0 - -EXPORTPARAMS=Yes - -############################################################################### -# P A C K E T D I S P O S I T I O N -############################################################################### - -BLACKLIST_DISPOSITION=DROP - -MACLIST_DISPOSITION=DROP - -TCP_FLAGS_DISPOSITION=DROP - -#LAST LINE -- DO NOT REMOVE diff --git a/manifests/init.pp b/manifests/init.pp index a766b23..0ec363b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -29,13 +29,29 @@ class shorewall { } - service { shorewall: ensure => running, enable => true, } + service { shorewall: + ensure => running, + enable => true, + subscribe => [ + Exec[concat_zones], + Exec[concat_interfaces], + Exec[concat_hosts], + Exec[concat_policy], + Exec[concat_rules], + Exec[concat_masq], + Exec[concat_proxyarp], + Exec[concat_nat], + Exec[concat_blacklist], + Exec[concat_rfc1918], + Exec[concat_routestopped], + ], + } file { "/var/lib/puppet/modules/shorewall": ensure => directory, force => true, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; } # private @@ -46,7 +62,7 @@ class shorewall { "${dir}": ensure => directory, force => true, - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => 0; } @@ -57,11 +73,11 @@ class shorewall { file { "${dir}/000-header": source => "puppet://$servername/shorewall/boilerplate/${name}.header", - mode => 0600, owner => root, group => root, + mode => 0600, owner => root, group => 0, notify => Exec["concat_${dir}"]; "${dir}/999-footer": source => "puppet://$servername/shorewall/boilerplate/${name}.footer", - mode => 0600, owner => root, group => root, + mode => 0600, owner => root, group => 0, notify => Exec["concat_${dir}"]; } } @@ -72,19 +88,21 @@ class shorewall { $dir = dirname($target) file { $target: content => "${line}\n", - mode => 0600, owner => root, group => root, + mode => 0600, owner => root, group => 0, notify => Exec["concat_${dir}"], } } # This file has to be managed in place, so shorewall can find it file { "/etc/shorewall/shorewall.conf": - # use OS specific defaults, but use gentoo if no other is found + # use OS specific defaults, but use Default if no other is found source => [ "puppet://$servername/shorewall/shorewall.conf.$operatingsystem.$lsbdistcodename", "puppet://$servername/shorewall/shorewall.conf.$operatingsystem", - "puppet://$servername/shorewall/shorewall.conf.Gentoo." ], - mode => 0644, owner => root, group => root, + "puppet://$servername/shorewall/shorewall.conf.Default", + ], + mode => 0644, owner => root, group => 0, + notify => Service[shorewall], } # See http://www.shorewall.net/3.0/Documentation.htm#Zones -- cgit v1.2.3