User Tools

Site Tools


it_best_practise:apache:ssl_settings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
it_best_practise:apache:ssl_settings [2017/03/03 10:35] – created Stephan Krinetzkiit_best_practise:apache:ssl_settings [2024/02/27 11:41] (current) – external edit 127.0.0.1
Line 16: Line 16:
 #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
 #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
 +
 SSLProtocol All -SSLv2 -SSLv3 SSLProtocol All -SSLv2 -SSLv3
 SSLHonorCipherOrder On SSLHonorCipherOrder On
 SSLCompression off SSLCompression off
 +
 # Add six earth month HSTS header for all users... # Add six earth month HSTS header for all users...
 Header always set Strict-Transport-Security "max-age=15768000" Header always set Strict-Transport-Security "max-age=15768000"
 +
 # If you want to protect all subdomains, use the following header # If you want to protect all subdomains, use the following header
 # ALL subdomains HAVE TO support HTTPS if you use this! # ALL subdomains HAVE TO support HTTPS if you use this!
Line 26: Line 29:
 # HTTP Public Key Pinning (HPKP) for 90 days (60*60*24*90=7776000) # HTTP Public Key Pinning (HPKP) for 90 days (60*60*24*90=7776000)
 # At least use one Backup-Key and/or add whole CA, think of Cert-Updates! # At least use one Backup-Key and/or add whole CA, think of Cert-Updates!
 +
 Header always set Public-Key-Pins "pin-sha256=\"YOUR_HASH=\"; pin-sha256=\"\ Header always set Public-Key-Pins "pin-sha256=\"YOUR_HASH=\"; pin-sha256=\"\
 \YOUR_BACKUP_HASH=\"; max-age=7776000; report-uri=\"https://YOUR.REPORT.URL\"" \YOUR_BACKUP_HASH=\"; max-age=7776000; report-uri=\"https://YOUR.REPORT.URL\""
 +
 SSLCipherSuite 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH\ SSLCipherSuite 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH\
 \:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!\ \:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!\
Line 34: Line 39:
  
 Damit entspricht man den aktuellen SSL Einstellungen. Diese Einstellungen werden pro VHost vorgenommen. Damit entspricht man den aktuellen SSL Einstellungen. Diese Einstellungen werden pro VHost vorgenommen.
 +
 +==== Eigene Diffie-Hellman Parameter erstellen ====
 +Ausgehend von der Schwachstellt [[https://en.wikipedia.org/wiki/Logjam_(computer_security)|Logjam]] sollte man für sein System dafür sorgen, dass der genutzte Satz an DH Parametern ausreichend stark ist. Wer die Default Einstellung höher setzen will kann mit OpenSSL und dem Folgenden Befehl ein passendes File generieren:
 +<code>
 +openssl dhparam -out dhparams.pem 4096
 +</code>
 +anschließend kann man das File im Apache (Version 2.4.8 und neuer und OpenSSL 1.0.2) einbinden mit:
 +<code>
 +SSLOpenSSLConfCmd DHParameters "{path to dhparams.pem}"
 +</code>
 +
 +Weitere Details dazu sind [[https://weakdh.org/sysadmin.html|hier]] zu finden.
 +
 +**Achtung**: CentOS läuft mit Apache 2.4.6 [[https://crosp.net/blog/administration/install-latest-apache-server-centos-7/|hier]] gibt es eine Anleitung für das Update.
 +
 +==== Schlüsselaustausch via Diffie Hellman Elliptic Curve ====
 +Apache kann schon per default ausgehend von einem RSA-Schlüssel den Schlüsselaustausch mit dem Client per Elliptischen Kurven durchführen. Dabei wird (auf meinen Systemen immer) eine Schlüssellänge von 256 Bit genutzt. Diese lässt sich hochstellen.
 +
 +Dazu muss man zuerst herausfinden welche Kurven auf einem System zur verfügung stehen:
 +<code>
 +openssl ecparam -list_curves
 +</code>
 +
 +Anschließend kann man in der Apache (Version 2.4.8 oder höher) Config für den vHost festlegen, was man wirklich haben will. Dabei darf man natürlich nur Kurven auswählen, die das System auch kann...
 +
 +<code>
 +SSLOpenSSLConfCmd ECDHParameters Automatic
 +SSLOpenSSLConfCmd Curves secp521r1:secp384r1
 +</code>
 +
 +Weitere Details dazu sind [[https://community.letsencrypt.org/t/making-the-key-exchange-stronger/8116|hier]] zu finden.
 +
 +**Achtung**: CentOS läuft mit Apache 2.4.6 [[https://crosp.net/blog/administration/install-latest-apache-server-centos-7/|hier]] gibt es eine Anleitung für das Update.
  
 ==== Weitere Versionsinformationen ==== ==== Weitere Versionsinformationen ====
it_best_practise/apache/ssl_settings.1488537307.txt.gz · Last modified: 2024/02/27 11:40 (external edit)