7 "ps_apache2": script => "ps_";
11 "apache2": ensure => installed;
17 "php5-suhosin": ensure => installed;
20 file { "/etc/php5/conf.d/suhosin.ini":
21 source => [ "puppet:///modules/apache2/per-host/$fqdn/etc/php5/conf.d/suhosin.ini",
22 "puppet:///modules/apache2/common/etc/php5/conf.d/suhosin.ini" ],
23 require => Package["apache2", "php5-suhosin"],
24 notify => Exec["force-reload-apache2"];
29 define activate_apache_site($ensure=present, $site=$name) {
32 default: { $base = $site }
37 file { "/etc/apache2/sites-enabled/$name":
38 ensure => "/etc/apache2/sites-available/$base",
39 require => Package["apache2"],
40 notify => Exec["reload-apache2"];
44 file { "/etc/apache2/sites-enabled/$name":
46 notify => Exec["reload-apache2"];
49 default: { err ( "Unknown ensure value: '$ensure'" ) }
53 define enable_module($ensure=present) {
57 "/usr/sbin/a2enmod $name":
58 unless => "/bin/sh -c '[ -L /etc/apache2/mods-enabled/${name}.load ]'",
59 notify => Exec["force-reload-apache2"],
64 "/usr/sbin/a2dismod $name":
65 onlyif => "/bin/sh -c '[ -L /etc/apache2/mods-enabled/${name}.load ]'",
66 notify => Exec["force-reload-apache2"],
69 default: { err ( "Unknown ensure value: '$ensure'" ) }
78 activate_apache_site {
79 "00-default": site => "default-debian.org";
80 "000-default": ensure => absent;
84 "/etc/apache2/conf.d/ressource-limits":
85 content => template("apache2/ressource-limits.erb"),
86 require => Package["apache2"],
87 notify => Exec["reload-apache2"];
88 "/etc/apache2/conf.d/security":
89 source => [ "puppet:///modules/apache2/per-host/$fqdn/etc/apache2/conf.d/security",
90 "puppet:///modules/apache2/common/etc/apache2/conf.d/security" ],
91 require => Package["apache2"],
92 notify => Exec["reload-apache2"];
93 "/etc/apache2/conf.d/local-serverinfo":
94 source => [ "puppet:///modules/apache2/per-host/$fqdn/etc/apache2/conf.d/local-serverinfo",
95 "puppet:///modules/apache2/common/etc/apache2/conf.d/local-serverinfo" ],
96 require => Package["apache2"],
97 notify => Exec["reload-apache2"];
98 "/etc/apache2/conf.d/server-status":
99 source => [ "puppet:///modules/apache2/per-host/$fqdn/etc/apache2/conf.d/server-status",
100 "puppet:///modules/apache2/common/etc/apache2/conf.d/server-status" ],
101 require => Package["apache2"],
102 notify => Exec["reload-apache2"];
104 "/etc/apache2/sites-available/default-debian.org":
105 content => template("apache2/default-debian.org.erb"),
106 require => Package["apache2"],
107 notify => Exec["reload-apache2"];
109 "/etc/logrotate.d/apache2":
110 source => [ "puppet:///modules/apache2/per-host/$fqdn/etc/logrotate.d/apache2",
111 "puppet:///modules/apache2/common/etc/logrotate.d/apache2" ];
116 "/srv/www/default.debian.org":
119 "/srv/www/default.debian.org/htdocs":
122 "/srv/www/default.debian.org/htdocs/index.html":
123 content => template("apache2/default-index.html");
125 # sometimes this is a symlink
128 # ensure => directory;
133 command => "/etc/init.d/apache2 reload",
135 "force-reload-apache2":
136 command => "/etc/init.d/apache2 force-reload",
140 chopin,franck,morricone: {
142 "libapache2-mod-macro": ensure => installed;
148 "/etc/apache2/conf.d/puppet-builddlist":
149 content => template("apache2/conf-builddlist.erb"),
150 require => Package["apache2"],
151 notify => Exec["reload-apache2"];
157 busoni,duarte,holter,lindberg,master,powell,rore: {
158 @ferm::rule { "dsa-http-limit":
160 description => "limit HTTP DOS",
161 chain => 'http_limit',
163 mod limit limit-burst 60 limit 15/minute jump ACCEPT;
166 @ferm::rule { "dsa-http-soso":
168 description => "slow soso spider",
169 chain => 'limit_sosospider',
171 mod connlimit connlimit-above 2 connlimit-mask 21 jump DROP;
174 @ferm::rule { "dsa-http-yahoo":
176 description => "slow yahoo spider",
177 chain => 'limit_yahoo',
179 mod connlimit connlimit-above 2 connlimit-mask 16 jump DROP;
182 @ferm::rule { "dsa-http-google":
184 description => "slow google spider",
185 chain => 'limit_google',
187 mod connlimit connlimit-above 2 connlimit-mask 19 jump DROP;
190 @ferm::rule { "dsa-http-bing":
192 description => "slow bing spider",
193 chain => 'limit_bing',
195 mod connlimit connlimit-above 2 connlimit-mask 16 jump DROP;
198 @ferm::rule { "dsa-http-baidu":
200 description => "slow baidu spider",
201 chain => 'limit_baidu',
203 mod connlimit connlimit-above 2 connlimit-mask 16 jump DROP;
206 @ferm::rule { "dsa-http-rules":
208 description => "http subchain",
211 saddr ( 74.6.22.182 74.6.18.240 67.195.0.0/16 ) jump limit_yahoo;
212 saddr 124.115.0.0/21 jump limit_sosospider;
213 saddr (65.52.0.0/14 207.46.0.0/16) jump limit_bing;
214 saddr (66.249.64.0/19) jump limit_google;
215 saddr (119.63.192.0/21 180.76.0.0/16) jump limit_baidu;
217 mod recent name HTTPDOS update seconds 1800 jump log_or_drop;
218 mod hashlimit hashlimit-name HTTPDOS hashlimit-mode srcip hashlimit-burst 600 hashlimit 30/minute jump ACCEPT;
219 mod recent name HTTPDOS set jump log_or_drop'
221 @ferm::rule { "dsa-http":
223 description => "Allow web access",
224 rule => "proto tcp dport (http https) jump http"
228 @ferm::rule { "dsa-http":
230 description => "Allow web access",
231 rule => "&SERVICE(tcp, (http https))"
235 @ferm::rule { "dsa-http-v6":
238 description => "Allow web access",
239 rule => "&SERVICE(tcp, (http https))"
243 # vim:set sts=4 ts=4:
244 # vim:set shiftwidth=4: