Skip to content

Commit 1e0940b

Browse files
author
Ciaran McCrisken
committed
Merge remote-tracking branch 'rsynnest/patch-2' into IAC-1186/main/sanitize-log-filename
2 parents 754f843 + 7e562bb commit 1e0940b

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

REFERENCE.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6582,9 +6582,9 @@ Default value: ``false``
65826582
Data type: `Any`
65836583

65846584
Sets the filename of the `*_access.log` placed in `logroot`. Given a virtual host ---for
6585-
instance, example.com--- it defaults to 'example.com_ssl.log' for
6585+
instance, `my example.com` --- it defaults to 'my_example.com_ssl.log' for
65866586
[SSL-encrypted](https://httpd.apache.org/docs/current/ssl/index.html) virtual hosts and
6587-
`example.com_access.log` for unencrypted virtual hosts.
6587+
`my_example.com_access.log` for unencrypted virtual hosts.
65886588

65896589
Default value: ``false``
65906590

@@ -6893,9 +6893,9 @@ Data type: `Any`
68936893

68946894
Points the virtual host's error logs to a `*_error.log` file. If this parameter is
68956895
undefined, Puppet checks for values in `error_log_pipe`, then `error_log_syslog`.<br />
6896-
If none of these parameters is set, given a virtual host `example.com`, Puppet defaults
6897-
to `$logroot/example.com_error_ssl.log` for SSL virtual hosts and
6898-
`$logroot/example.com_error.log` for non-SSL virtual hosts.
6896+
If none of these parameters is set, given a virtual host `my example.com`, Puppet defaults
6897+
to `$logroot/my_example.com_error_ssl.log` for SSL virtual hosts and
6898+
`$logroot/my_example.com_error.log` for non-SSL virtual hosts.
68996899

69006900
Default value: ``undef``
69016901

@@ -6916,8 +6916,8 @@ Data type: `Any`
69166916
Determines whether to send all error log messages to syslog.
69176917
This parameter has no effect if either of the `error_log_file` or `error_log_pipe`
69186918
parameters has a value. If none of these parameters has a value, given a virtual host
6919-
`example.com`, Puppet defaults to `$logroot/example.com_error_ssl.log` for SSL virtual
6920-
hosts and `$logroot/example.com_error.log` for non-SSL virtual hosts.
6919+
`my example.com`, Puppet defaults to `$logroot/my_example.com_error_ssl.log` for SSL virtual
6920+
hosts and `$logroot/my_example.com_error.log` for non-SSL virtual hosts.
69216921

69226922
Default value: ``undef``
69236923

@@ -7567,9 +7567,9 @@ Default value: ``undef``
75677567

75687568
Data type: `Any`
75697569

7570-
If `modsec_audit_log` is `true`, given a virtual host ---for instance, example.com--- it
7571-
defaults to `example.com\_security\_ssl.log` for SSL-encrypted virtual hosts
7572-
and `example.com\_security.log` for unencrypted virtual hosts.<br />
7570+
If `modsec_audit_log` is `true`, given a virtual host ---for instance, `my example.com` --- it
7571+
defaults to `my_example.com\_security\_ssl.log` for SSL-encrypted virtual hosts
7572+
and `my_example.com\_security.log` for unencrypted virtual hosts. <br />
75737573
One of the parameters that determines how to send `mod_security` audit
75747574
log ([SecAuditLog](https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#SecAuditLog)).<br />
75757575
If none of those parameters are set, the global audit log is used

manifests/vhost.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,9 +2096,9 @@
20962096
$error_log_destination = $error_log_syslog
20972097
} else {
20982098
if $ssl {
2099-
$error_log_destination = "${logroot}/${name}_error_ssl.log"
2099+
$error_log_destination = "${logroot}/${filename}_error_ssl.log"
21002100
} else {
2101-
$error_log_destination = "${logroot}/${name}_error.log"
2101+
$error_log_destination = "${logroot}/${filename}_error.log"
21022102
}
21032103
}
21042104

@@ -2117,9 +2117,9 @@
21172117
$modsec_audit_log_destination = $modsec_audit_log_pipe
21182118
} elsif $modsec_audit_log {
21192119
if $ssl {
2120-
$modsec_audit_log_destination = "${logroot}/${name}_security_ssl.log"
2120+
$modsec_audit_log_destination = "${logroot}/${filename}_security_ssl.log"
21212121
} else {
2122-
$modsec_audit_log_destination = "${logroot}/${name}_security.log"
2122+
$modsec_audit_log_destination = "${logroot}/${filename}_security.log"
21232123
}
21242124
} else {
21252125
$modsec_audit_log_destination = undef

templates/vhost/_access_log.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<% elsif log['pipe'] -%>
1515
<% destination = log['pipe'] -%>
1616
<% else -%>
17-
<% destination ||= "#{@logroot}/#{@name}_access_ssl.log" if @ssl -%>
18-
<% destination ||= "#{@logroot}/#{@name}_access.log" -%>
17+
<% destination ||= "#{@logroot}/#{@filename}_access_ssl.log" if @ssl -%>
18+
<% destination ||= "#{@logroot}/#{@filename}_access.log" -%>
1919
<% end -%>
2020
CustomLog "<%= destination %>" <%= format %> <%= env %>
2121
<% end -%>

0 commit comments

Comments
 (0)