Skip to content

Commit 7ef99e9

Browse files
committed
use hardening alias.conf ( Options -Indexes +MultiViews -FollowSymLinks )
TelekomLabs-DCO-1.1-Signed-off-by: Edmund Haselwanter <me@ehaselwanter.com> (github: ehaselwanter)
1 parent d820faf commit 7ef99e9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

manifests/puppetlabs.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
$apache_version = $apache::apache_version
3131
$confd_dir = $apache::confd_dir
3232
$conf_dir = $apache::conf_dir
33+
$mod_dir = $apache::mod_dir
3334

3435
file { "${confd_dir}/90.hardening.conf":
3536
ensure => file,
@@ -50,4 +51,10 @@
5051
path => ['/bin','/usr/bin', '/usr/sbin'],
5152
unless => "find ${conf_dir} -perm -o+r -type f -o -perm -o+w -type f | wc -l | egrep '^0$'"
5253
}
54+
55+
File['alias.conf'] {
56+
content => template('apache_hardening/mod/alias.conf.erb'),
57+
mode => '0640',
58+
}
59+
5360
}

templates/mod/alias.conf.erb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<IfModule alias_module>
2+
Alias /icons/ "<%= @icons_path %>/"
3+
<Directory "<%= @icons_path %>">
4+
Options -Indexes +MultiViews -FollowSymLinks
5+
AllowOverride None
6+
<%- if scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
7+
Require all granted
8+
<%- else -%>
9+
Order allow,deny
10+
Allow from all
11+
<%- end -%>
12+
</Directory>
13+
</IfModule>

0 commit comments

Comments
 (0)