-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpuppetlabs.pp
62 lines (50 loc) · 1.5 KB
/
puppetlabs.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# === Copyright
#
# Copyright 2014, Deutsche Telekom AG
# Licensed under the Apache License, Version 2.0 (the "License");
# http://www.apache.org/licenses/LICENSE-2.0
#
# == Class: apache_hardening::puppetlabs
#
# Overlay provider for puppetlabs/apache
#
# === Parameters
#
# none
#
class apache_hardening::puppetlabs(
$allowed_http_methods = [
'GET',
'POST',
]
) {
# make sure our options are written to the config file
class{'apache_hardening::puppetlabs_override': }
# additional configuration
# add hardening parameters
$apache_version = $apache::apache_version
$confd_dir = $apache::confd_dir
$conf_dir = $apache::conf_dir
$mod_dir = $apache::mod_dir
$icons_path = $apache::mod::alias::icons_path
$icons_options = '-Indexes +MultiViews -FollowSymLinks' # overwrites $apache::mod::alias::icons_options
file { "${confd_dir}/90.hardening.conf":
ensure => file,
content => template('apache_hardening/hardening.conf.erb'),
mode => '0640',
}
File <| notify == Service['httpd'] or require == Package['httpd'] |> {
mode => 0640
}
Concat <| require == Package['httpd'] |> {
mode => 0640
} -> Exec["chmod -R o-rw ${conf_dir}"] ~> Service['httpd']
exec { "chmod -R o-rw ${conf_dir}":
path => ['/bin','/usr/bin', '/usr/sbin'],
unless => "find ${conf_dir} -perm -o+r -type f -o -perm -o+w -type f | wc -l | egrep '^0$'"
}
File <| title == 'alias.conf' |> {
content => template('apache/mod/alias.conf.erb'),
mode => '0640',
}
}