Skip to content

Commit 4f4f07c

Browse files
author
thom
committed
Add SSL support for ISPConfig Apps (#5435) - also in conf folder
1 parent 461f4fe commit 4f4f07c

File tree

1 file changed

+56
-4
lines changed

1 file changed

+56
-4
lines changed

server/conf/apache_apps.vhost.master

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
######################################################
32
# This virtual host contains the configuration
43
# for the ISPConfig apps vhost
@@ -15,6 +14,57 @@
1514
SetHandler None
1615
</FilesMatch>
1716

17+
# SSL Configuration
18+
<tmpl_var name="ssl_comment">SSLEngine On
19+
<tmpl_if name='apache_version' op='>=' value='2.3.16' format='version'>
20+
<tmpl_var name="ssl_comment">SSLProtocol All -SSLv3 -TLSv1 -TLSv1.1
21+
<tmpl_else>
22+
<tmpl_var name="ssl_comment">SSLProtocol All -SSLv2 -SSLv3
23+
</tmpl_if>
24+
<tmpl_var name="ssl_comment">SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
25+
<tmpl_var name="ssl_comment">SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
26+
<tmpl_var name="ssl_bundle_comment">SSLCACertificateFile /usr/local/ispconfig/interface/ssl/ispserver.bundle
27+
28+
<tmpl_var name="ssl_comment">SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
29+
<tmpl_var name="ssl_comment">SSLHonorCipherOrder On
30+
<tmpl_if name='apache_version' op='>=' value='2.4.3' format='version'>
31+
<tmpl_var name="ssl_comment">SSLCompression Off
32+
</tmpl_if>
33+
<tmpl_if name='apache_version' op='>=' value='2.4.11' format='version'>
34+
<tmpl_var name="ssl_comment">SSLSessionTickets Off
35+
</tmpl_if>
36+
37+
<IfModule mod_headers.c>
38+
# ISPConfig 3.1 currently requires unsafe-line for both scripts and styles, as well as unsafe-eval
39+
Header set Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:; object-src 'none'"
40+
<tmpl_var name="ssl_comment">Header set Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:; object-src 'none'; upgrade-insecure-requests"
41+
Header set X-Content-Type-Options: nosniff
42+
Header set X-Frame-Options: SAMEORIGIN
43+
Header set X-XSS-Protection: "1; mode=block"
44+
Header always edit Set-Cookie (.*) "$1; HTTPOnly"
45+
<tmpl_var name="ssl_comment">Header always edit Set-Cookie (.*) "$1; Secure"
46+
<IfVersion >= 2.4.7>
47+
Header setifempty Strict-Transport-Security "max-age=15768000"
48+
</IfVersion>
49+
<IfVersion < 2.4.7>
50+
Header set Strict-Transport-Security "max-age=15768000"
51+
</IfVersion>
52+
RequestHeader unset Proxy early
53+
</IfModule>
54+
55+
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
56+
<tmpl_var name="ssl_comment">SSLUseStapling On
57+
<tmpl_var name="ssl_comment">SSLStaplingResponderTimeout 5
58+
<tmpl_var name="ssl_comment">SSLStaplingReturnResponderErrors Off
59+
</tmpl_if>
60+
</VirtualHost>
61+
62+
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
63+
<IfModule mod_ssl.c>
64+
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
65+
</IfModule>
66+
</tmpl_if>
67+
1868
<IfModule mod_headers.c>
1969
RequestHeader unset Proxy early
2070
</IfModule>
@@ -55,9 +105,9 @@
55105
<Directory {tmpl_var name='apps_vhost_dir'}>
56106
Options +Indexes +FollowSymLinks +MultiViews +ExecCGI
57107
AllowOverride AuthConfig Indexes Limit Options FileInfo
58-
<FilesMatch "\.php$">
59-
SetHandler fcgid-script
60-
</FilesMatch>
108+
<FilesMatch "\.php$">
109+
SetHandler fcgid-script
110+
</FilesMatch>
61111
FCGIWrapper {tmpl_var name='apps_vhost_basedir'}/php-fcgi-scripts/apps/.php-fcgi-starter .php
62112
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
63113
Require all granted
@@ -78,4 +128,6 @@
78128
RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P]
79129
{/tmpl_if}
80130

131+
132+
81133
</VirtualHost>

0 commit comments

Comments
 (0)