Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
centos:mail_c7:dovecot_4 [25.07.2014 20:00. ] – [manuelle Erstellung unserer eigenen CA] django | centos:mail_c7:dovecot_4 [22.07.2019 14:48. ] (aktuell) – [Links] django | ||
---|---|---|---|
Zeile 141: | Zeile 141: | ||
</ | </ | ||
- | ==== Cipher-Suites und Diffie-Hellmann | + | ==== Cipher-Suites und Diffie-Hellman |
Möchte man in Erfahrung bringen, welche Cipher-Suites((Sammlung von standardisierten kryptographischer Algorithmen)) unser installiertes OpenSSL-Paket mitbringt, können wir wie folgt abfragen((Ausgabe in formatierter Tabelle)). | Möchte man in Erfahrung bringen, welche Cipher-Suites((Sammlung von standardisierten kryptographischer Algorithmen)) unser installiertes OpenSSL-Paket mitbringt, können wir wie folgt abfragen((Ausgabe in formatierter Tabelle)). | ||
# openssl ciphers -v | # openssl ciphers -v | ||
Zeile 682: | Zeile 682: | ||
< | < | ||
- | <font style=" | + | <font style=" |
</ | </ | ||
< | < | ||
Zeile 1072: | Zeile 1072: | ||
Wie schon erwähnt, entfernen wir die Passphrase nun wieder, in dem wir bei der Frage **Enter pass phrase:** einfach die Taste **[ENTER]** drücken. | Wie schon erwähnt, entfernen wir die Passphrase nun wieder, in dem wir bei der Frage **Enter pass phrase:** einfach die Taste **[ENTER]** drücken. | ||
< | < | ||
- | <font style=" | + | <font style=" |
</ | </ | ||
< | < | ||
Zeile 1233: | Zeile 1233: | ||
==== eigene CA: CSR beabeiten - Zertifikat erstellen ==== | ==== eigene CA: CSR beabeiten - Zertifikat erstellen ==== | ||
- | Bevor wir nun unser eigenes | + | Kommen |
- | # vim / | + | |
- | <file bash / | + | |
- | # OpenSSL example configuration file. | + | |
- | # This is mostly being used for generation of certificate requests. | + | |
- | # | + | |
- | # This definition stops the following lines choking if HOME isn' | + | Wie schon bereits bei den anderen Konfigurationsbeispielen, |
- | # defined. | + | |
- | HOME = . | + | |
- | RANDFILE = $ENV::HOME/.rnd | + | |
- | # Extra OBJECT IDENTIFIER info: | + | < |
- | #oid_file = $ENV:: | + | <font style="color: rgb(0, 0, 0)"># </font>< |
- | oid_section = new_oids | + | </pre></ |
- | + | < | |
- | # To use this configuration file with the "-extfile" | + | <font style=" |
- | # " | + | Enter pass phrase for / |
- | # X.509v3 extensions to use: | + | <font style=" |
- | # extensions = | + | |
- | # (Alternatively, | + | |
- | # X.509v3 extensions in its main [= default] section.) | + | |
- | + | ||
- | [ new_oids ] | + | |
- | + | ||
- | # We can add new OIDs in here for use by ' | + | |
- | # Add a simple OID like this: | + | |
- | # testoid1=1.2.3.4 | + | |
- | # Or use config file substitution like this: | + | |
- | # testoid2=${testoid1}.5.6 | + | |
- | + | ||
- | # Policies used by the TSA examples. | + | |
- | tsa_policy1 = 1.2.3.4.1 | + | |
- | tsa_policy2 = 1.2.3.4.5.6 | + | |
- | tsa_policy3 = 1.2.3.4.5.7 | + | |
- | + | ||
- | #################################################################### | + | |
- | [ ca ] | + | |
- | default_ca = CA_default # | + | |
- | + | ||
- | #################################################################### | + | |
- | [ CA_default ] | + | |
- | + | ||
- | dir = / | + | |
- | certs = $dir/ | + | |
- | crl_dir = $dir/crl # Where the issued crl are kept | + | |
- | database = $dir/ | + | |
- | # | + | |
- | # several ctificates with same subject. | + | |
- | new_certs_dir = $dir/ | + | |
- | + | ||
- | certificate = $dir/ | + | |
- | serial = $dir/serial # The current serial number | + | |
- | crlnumber = $dir/ | + | |
- | # must be commented out to leave a V1 CRL | + | |
- | crl = $dir/ | + | |
- | private_key = $dir/ | + | |
- | RANDFILE = $dir/ | + | |
- | + | ||
- | x509_extensions = usr_cert # The extentions to add to the cert | + | |
- | + | ||
- | # Comment out the following two lines for the "traditional" | + | |
- | # (and highly broken) format. | + | |
- | name_opt = ca_default # | + | |
- | cert_opt = ca_default # | + | |
- | + | ||
- | # Extension copying option: use with caution. | + | |
- | # copy_extensions = copy | + | |
- | + | ||
- | # Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs | + | |
- | # so this is commented out by default to leave a V1 CRL. | + | |
- | # crlnumber must also be commented out to leave a V1 CRL. | + | |
- | # crl_extensions = crl_ext | + | |
- | + | ||
- | # Django : 2014-07-23 | + | |
- | # default: default_days | + | |
- | default_days = 730 # how long to certify for (two years) | + | |
- | default_crl_days= 30 # how long before next CRL | + | |
- | default_md = sha256 # use SHA-256 by default | + | |
- | preserve = no # keep passed DN ordering | + | |
- | + | ||
- | # A few difference way of specifying how similar the request should look | + | |
- | # For type CA, the listed attributes must be the same, and the optional | + | |
- | # and supplied fields are just that :-) | + | |
- | policy = policy_match | + | |
- | + | ||
- | # For the CA policy | + | |
- | [ policy_match ] | + | |
- | countryName = match | + | |
- | stateOrProvinceName = match | + | |
- | organizationName = match | + | |
- | organizationalUnitName = optional | + | |
- | commonName = supplied | + | |
- | emailAddress = optional | + | |
- | + | ||
- | # For the ' | + | |
- | # At this point in time, you must list all acceptable ' | + | |
- | # types. | + | |
- | [ policy_anything ] | + | |
- | countryName = optional | + | |
- | stateOrProvinceName = optional | + | |
- | localityName = optional | + | |
- | organizationName = optional | + | |
- | organizationalUnitName = optional | + | |
- | commonName = supplied | + | |
- | emailAddress = optional | + | |
- | + | ||
- | #################################################################### | + | |
- | [ req ] | + | |
- | default_bits = 2048 | + | |
- | default_md = sha256 | + | |
- | default_keyfile = privkey.pem | + | |
- | distinguished_name = req_distinguished_name | + | |
- | attributes = req_attributes | + | |
- | x509_extensions = v3_ca # The extentions to add to the self signed cert | + | |
- | + | ||
- | # Passwords for private keys if not present they will be prompted for | + | |
- | # input_password = secret | + | |
- | # output_password = secret | + | |
- | + | ||
- | # This sets a mask for permitted string types. There are several options. | + | |
- | # default: PrintableString, | + | |
- | # pkix : PrintableString, | + | |
- | # utf8only: only UTF8Strings (PKIX recommendation after 2004). | + | |
- | # nombstr : PrintableString, | + | |
- | # MASK:XXXX a literal mask value. | + | |
- | # WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings. | + | |
- | string_mask = utf8only | + | |
- | + | ||
- | # req_extensions = v3_req # The extensions to add to a certificate request | + | |
- | + | ||
- | [ req_distinguished_name ] | + | |
- | countryName = Country Name (2 letter code) | + | |
- | countryName_default = XX | + | |
- | countryName_min = 2 | + | |
- | countryName_max = 2 | + | |
- | + | ||
- | stateOrProvinceName = State or Province Name (full name) | + | |
- | # | + | |
- | + | ||
- | localityName = Locality Name (eg, city) | + | |
- | localityName_default = Default City | + | |
- | + | ||
- | 0.organizationName = Organization Name (eg, company) | + | |
- | 0.organizationName_default = Default Company Ltd | + | |
- | + | ||
- | # we can do this but it is not needed normally :-) | + | |
- | # | + | |
- | # | + | |
- | + | ||
- | organizationalUnitName = Organizational Unit Name (eg, section) | + | |
- | # | + | |
- | + | ||
- | commonName = Common Name (eg, your name or your server\' | + | |
- | commonName_max = 64 | + | |
- | + | ||
- | emailAddress = Email Address | + | |
- | emailAddress_max = 64 | + | |
- | + | ||
- | # SET-ex3 = SET extension number 3 | + | |
- | + | ||
- | [ req_attributes ] | + | |
- | challengePassword = A challenge password | + | |
- | challengePassword_min = 4 | + | |
- | challengePassword_max = 20 | + | |
- | + | ||
- | unstructuredName = An optional company name | + | |
- | + | ||
- | [ usr_cert ] | + | |
- | + | ||
- | # These extensions are added when ' | + | |
- | + | ||
- | # This goes against PKIX guidelines but some CAs do it and some software | + | |
- | # requires this to avoid interpreting an end user certificate as a CA. | + | |
- | + | ||
- | basicConstraints=CA: | + | |
- | + | ||
- | # Here are some examples of the usage of nsCertType. If it is omitted | + | |
- | # the certificate can be used for anything *except* object signing. | + | |
- | + | ||
- | # This is OK for an SSL server. | + | |
- | # nsCertType = server | + | |
- | + | ||
- | # For an object signing certificate this would be used. | + | |
- | # nsCertType = objsign | + | |
- | + | ||
- | # For normal client use this is typical | + | |
- | # nsCertType = client, email | + | |
- | + | ||
- | # and for everything including object signing: | + | |
- | # nsCertType = client, email, objsign | + | |
- | + | ||
- | # This is typical in keyUsage for a client certificate. | + | |
- | # keyUsage = nonRepudiation, | + | |
- | + | ||
- | # This will be displayed in Netscape' | + | |
- | nsComment = | + | |
- | + | ||
- | # PKIX recommendations harmless if included in all certificates. | + | |
- | subjectKeyIdentifier=hash | + | |
- | authorityKeyIdentifier=keyid, | + | |
- | + | ||
- | # This stuff is for subjectAltName and issuerAltname. | + | |
- | # Import the email address. | + | |
- | # subjectAltName=email: | + | |
- | # An alternative to produce certificates that aren' | + | |
- | # deprecated according to PKIX. | + | |
- | # subjectAltName=email: | + | |
- | + | ||
- | # Copy subject details | + | |
- | # issuerAltName=issuer: | + | |
- | + | ||
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | + | ||
- | # This is required for TSA certificates. | + | |
- | # extendedKeyUsage = critical, | + | |
- | + | ||
- | [ v3_req ] | + | |
- | + | ||
- | # Extensions to add to a certificate request | + | |
- | + | ||
- | basicConstraints = CA:FALSE | + | |
- | keyUsage = nonRepudiation, | + | |
- | + | ||
- | [ v3_ca ] | + | |
- | + | ||
- | + | ||
- | # Extensions for a typical CA | + | |
- | + | ||
- | + | ||
- | # PKIX recommendation. | + | |
- | + | ||
- | subjectKeyIdentifier=hash | + | |
- | + | ||
- | authorityKeyIdentifier=keyid: | + | |
- | + | ||
- | # This is what PKIX recommends but some broken software chokes on critical | + | |
- | # extensions. | + | |
- | # | + | |
- | # So we do this instead. | + | |
- | basicConstraints = CA:true | + | |
- | + | ||
- | # Key usage: this is typical for a CA certificate. However since it will | + | |
- | # prevent it being used as an test self-signed certificate it is best | + | |
- | # left out by default. | + | |
- | # keyUsage = cRLSign, keyCertSign | + | |
- | + | ||
- | # Some might want this also | + | |
- | # nsCertType = sslCA, emailCA | + | |
- | + | ||
- | # Include email address in subject alt name: another PKIX recommendation | + | |
- | # subjectAltName=email: | + | |
- | # Copy issuer details | + | |
- | # issuerAltName=issuer: | + | |
- | + | ||
- | # DER hex encoding of an extension: beware experts only! | + | |
- | # obj=DER: | + | |
- | # Where ' | + | |
- | # You can even override a supported extension: | + | |
- | # basicConstraints= critical, DER: | + | |
- | + | ||
- | [ crl_ext ] | + | |
- | + | ||
- | # CRL extensions. | + | |
- | # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. | + | |
- | + | ||
- | # issuerAltName=issuer: | + | |
- | authorityKeyIdentifier=keyid: | + | |
- | + | ||
- | [ proxy_cert_ext ] | + | |
- | # These extensions should be added when creating a proxy certificate | + | |
- | + | ||
- | # This goes against PKIX guidelines but some CAs do it and some software | + | |
- | # requires this to avoid interpreting an end user certificate as a CA. | + | |
- | + | ||
- | basicConstraints=CA: | + | |
- | + | ||
- | # Here are some examples of the usage of nsCertType. If it is omitted | + | |
- | # the certificate can be used for anything *except* object signing. | + | |
- | + | ||
- | # This is OK for an SSL server. | + | |
- | # nsCertType = server | + | |
- | + | ||
- | # For an object signing certificate this would be used. | + | |
- | # nsCertType = objsign | + | |
- | + | ||
- | # For normal client use this is typical | + | |
- | # nsCertType = client, email | + | |
- | + | ||
- | # and for everything including object signing: | + | |
- | # nsCertType = client, email, objsign | + | |
- | + | ||
- | # This is typical in keyUsage for a client certificate. | + | |
- | # keyUsage = nonRepudiation, | + | |
- | + | ||
- | # This will be displayed in Netscape' | + | |
- | nsComment = " | + | |
- | + | ||
- | # PKIX recommendations harmless if included in all certificates. | + | |
- | subjectKeyIdentifier=hash | + | |
- | authorityKeyIdentifier=keyid, | + | |
- | + | ||
- | # This stuff is for subjectAltName and issuerAltname. | + | |
- | # Import the email address. | + | |
- | # subjectAltName=email: | + | |
- | # An alternative to produce certificates that aren' | + | |
- | # deprecated according to PKIX. | + | |
- | # subjectAltName=email: | + | |
- | + | ||
- | # Copy subject details | + | |
- | # issuerAltName=issuer: | + | |
- | + | ||
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | + | ||
- | # This really needs to be in place for it to be a proxy certificate. | + | |
- | proxyCertInfo=critical, | + | |
- | + | ||
- | #################################################################### | + | |
- | [ tsa ] | + | |
- | + | ||
- | default_tsa = tsa_config1 # | + | |
- | + | ||
- | [ tsa_config1 ] | + | |
- | + | ||
- | # These are used by the TSA reply generation only. | + | |
- | dir = ./demoCA # TSA root directory | + | |
- | serial = $dir/ | + | |
- | crypto_device = builtin # OpenSSL engine to use for signing | + | |
- | signer_cert = $dir/ | + | |
- | # (optional) | + | |
- | certs = $dir/ | + | |
- | # (optional) | + | |
- | signer_key = $dir/ | + | |
- | + | ||
- | default_policy = tsa_policy1 # | + | |
- | # (optional) | + | |
- | other_policies = tsa_policy2, | + | |
- | digests = sha1, sha256, sha384, sha512 # Acceptable message digests (mandatory) | + | |
- | accuracy = secs:1, millisecs: | + | |
- | clock_precision_digits | + | |
- | ordering = yes # Is ordering defined for timestamps? | + | |
- | # (optional, default: no) | + | |
- | tsa_name = yes # Must the TSA name be included in the reply? | + | |
- | # (optional, default: no) | + | |
- | ess_cert_id_chain = no # Must the ESS cert id chain be included? | + | |
- | # (optional, default: no) | + | |
- | </file> | + | |
- | + | ||
- | Außerdem verschieben wir den privaten Schlüssel unserer CA nach **/ | + | |
- | # mv / | + | |
- | + | ||
- | Kommen wir zum krönenden Abschluss - wir signieren nun das Server-Zertifikat durch unsere CA. | + | |
- | + | ||
- | Auch hier sind die Eingaben in der Farbe <html>< | + | |
- | + | ||
- | # openssl ca -in csr.pem -notext -out servercert.pem | + | |
- | <code>Using configuration from / | + | |
- | Enter pass phrase for / | + | |
- | Check that the request matches the signature | + | |
Signature ok | Signature ok | ||
Certificate Details: | Certificate Details: | ||
Zeile 1626: | Zeile 1268: | ||
Certificate is to be certified until Jul 22 13:00:41 2016 GMT (730 days) | Certificate is to be certified until Jul 22 13:00:41 2016 GMT (730 days) | ||
- | Sign the certificate? | + | Sign the certificate? |
+ | <font style=" | ||
+ | 1 out of 1 certificate requests certified, commit? [y/ | ||
+ | <font style=" | ||
+ | Data Base Updated</ | ||
+ | </ | ||
- | 1 out of 1 certificate requests certified, commit? [y/n]y | + | ===== Zertifikat- und Schlüsseldatei ===== |
- | Write out database with 1 new entries | + | ==== Speicherort |
- | Data Base Updated | + | |
- | </ | + | |
- | + | ||
- | ==== Schlüsseldateien ablegen | + | |
Bei der Dovecot-Installation wurde bereits der Unterordner für das Dovecot-Zertifikates und der zugehörigen Schlüssel-Datei unter **/ | Bei der Dovecot-Installation wurde bereits der Unterordner für das Dovecot-Zertifikates und der zugehörigen Schlüssel-Datei unter **/ | ||
< | < | ||
Zeile 1645: | Zeile 1288: | ||
Anschließend legen wir dort die drei benötigten Dateien ab: | Anschließend legen wir dort die drei benötigten Dateien ab: | ||
- | - unseren // | + | - unseren // |
- | - unseren // | + | - unseren // |
- | - das // | + | - das // |
- | und schützen diese Dateien mit den Dateirechten **400**: | + | - und schützen diese Dateien mit den Dateirechten **400**: < |
- | # mv / | + | # chmod 400 / |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
==== Zertifikatsketten ==== | ==== Zertifikatsketten ==== | ||
Handelt es sich bei der CA um eine mehrstufige CA, so hat man nicht nur ein Zertifikatsfile der RootCA, sondern auch weitere, wie z.B. ein Zwischenzertifikat. | Handelt es sich bei der CA um eine mehrstufige CA, so hat man nicht nur ein Zertifikatsfile der RootCA, sondern auch weitere, wie z.B. ein Zwischenzertifikat. | ||
- | Damit Dovecot mit solchen Zertifikaten umgehen kann, ist es notwendig, dass die einzelnen Inhalte der Zertifikats-Dateien in eine gemeinsame Datei kopiert werden. Folgende Reihenfolge ist dringend | + | Damit Dovecot mit solchen Zertifikaten umgehen kann, ist es notwendig, dass die einzelnen Inhalte der Zertifikats-Dateien in eine gemeinsame Datei kopiert werden. Folgende Reihenfolge ist dabei **__dringend__** |
- Dovecot' | - Dovecot' | ||
- TDC SSL Server CA | - TDC SSL Server CA | ||
Zeile 1744: | Zeile 1383: | ||
# vim / | # vim / | ||
- | <file bash / | + | <file bash / |
- | ## SSL settings | + | ## SSL settings |
- | ## | + | ## |
# SSL/TLS support: yes, no, required. < | # SSL/TLS support: yes, no, required. < | ||
# disable plain pop3 and imap, allowed are only pop3+TLS, pop3s, imap+TLS and imaps | # disable plain pop3 and imap, allowed are only pop3+TLS, pop3s, imap+TLS and imaps | ||
- | # plain imap and pop3 are still allowed for local connections | + | # plain imap and pop3 are still allowed for local connections |
- | ssl = required | + | ssl = required |
# PEM encoded X.509 SSL/TLS certificate and private key. They' | # PEM encoded X.509 SSL/TLS certificate and private key. They' | ||
- | # dropping root privileges, so keep the key file unreadable by anyone but | + | # dropping root privileges, so keep the key file unreadable by anyone but |
- | # root. Included doc/ | + | # root. Included doc/ |
- | # certificate, | + | # certificate, |
- | # Django : 2014-04-09 | + | # Django : 2015-06-09 |
- | # old : ssl_cert = </ | + | # old : ssl_cert = </ |
- | # ssl_key = </ | + | # ssl_key = </ |
- | ssl_cert = </ | + | ssl_cert = </ |
- | ssl_key = </ | + | ssl_key = </ |
# If key file is password protected, give the password here. Alternatively | # If key file is password protected, give the password here. Alternatively | ||
# give it when starting dovecot with -p parameter. Since this file is often | # give it when starting dovecot with -p parameter. Since this file is often | ||
# world-readable, | # world-readable, | ||
- | # root owned 0600 file by using ssl_key_password = <path. | + | # root owned 0600 file by using ssl_key_password = < |
- | # | + | # |
# PEM encoded trusted certificate authority. Set this only if you intend to use | # PEM encoded trusted certificate authority. Set this only if you intend to use | ||
# ssl_verify_client_cert=yes. The file should contain the CA certificate(s) | # ssl_verify_client_cert=yes. The file should contain the CA certificate(s) | ||
# followed by the matching CRL(s). (e.g. ssl_ca = </ | # followed by the matching CRL(s). (e.g. ssl_ca = </ | ||
- | #ssl_ca = | + | #ssl_ca = |
# Require that CRL check succeeds for client certificates. | # Require that CRL check succeeds for client certificates. | ||
Zeile 1794: | Zeile 1433: | ||
# DH parameters length to use. | # DH parameters length to use. | ||
- | # | + | # Django : 2015-05-21 |
+ | # default: | ||
+ | ssl_dh_parameters_length=4096 | ||
+ | |||
+ | # Weekly regeneration of the ssl-parameters | ||
+ | # Django : 2015-06-10 | ||
+ | # default: ssl_parameters_regenerate = 0 | ||
+ | # ssl_parameters_regenerate = 2 hours | ||
+ | # Won't work since dovecot 2.2! | ||
+ | # Update ssl_dh_parameters_length with script dh-params | ||
+ | # https:// | ||
# SSL protocols to use | # SSL protocols to use | ||
- | # | + | # Django : 2014-10-16 |
+ | # default: | ||
+ | ssl_protocols = !SSLv2 !SSLv3 | ||
# SSL ciphers to use | # SSL ciphers to use | ||
- | # | + | # Django : 2014-10-16 |
+ | # default: | ||
+ | ssl_cipher_list = EECDH+ECDSA+AESGCM: | ||
# Prefer the server' | # Prefer the server' | ||
- | # | + | # Django : 2015-05-20 |
+ | # default: | ||
+ | ssl_prefer_server_ciphers = yes | ||
# SSL crypto device to use, for valid values run " | # SSL crypto device to use, for valid values run " | ||
Zeile 1809: | Zeile 1464: | ||
</ | </ | ||
+ | Über den Paramter **ssl** kann man steuern, ob **SSL/TLS** nun verwendet werden kann, oder ob es verwendet werden muss, oder eben nicht. Wir lassen den Default-Wert // | ||
+ | |||
+ | === Diffie-Hellman-Verfahren und Perfect Forward Secrecy | ||
+ | Wie am Anfang des Artikels bereits angeschnitten, | ||
+ | |||
+ | Dovecot stellt das normale **[[http:// | ||
+ | |||
+ | <WRAP center round important 85%> | ||
+ | **Wichtig**: | ||
+ | Die **Diffie-Hellman-Parameter** werden beim ersten Start des Dovecot-Daemon erzeugt und in der Datei **// / | ||
+ | |||
+ | Entgegen den Angaben im Abschnitt **SSL security settings** im [[http:// | ||
+ | |||
+ | Die Hintergründe und die Lösung zu diesem Problem, basieren auf den Hinweisen von **// | ||
+ | </ | ||
+ | |||
+ | Wir werden also das Wechseln der **Diffie-Hellman-Parameter** werden wir also selbst in die Hand nehmen. Dies erfolgt in zwei Schritten. | ||
+ | - **Parameterdatei erstellen** und | ||
+ | - **Dovecot die neuen Parameter bekanntgeben** | ||
+ | |||
+ | Die Erzeugung der **DH-Parameter-Datei** erfolgt mit Hilfe des Programms **ssl-params** aus dem Verzeichnis // | ||
+ | # vim / | ||
+ | |||
+ | <file bash / | ||
+ | # Länge der Diffie-Hellman-Parameter, | ||
+ | ssl_dh_parameters_length = 4096 | ||
+ | # | ||
+ | # Speicherort der Diffie-Hellman-Parameter-Datei ssl-parameters.dat | ||
+ | state_dir = / | ||
+ | </ | ||
+ | |||
+ | Als nächstes erzeugen wir noch das temporäre Verzeichnis, | ||
+ | # mkdir / | ||
+ | |||
+ | Das Erzeugen erfolgt nun mit Hilfe des folgenden Aufrufs. | ||
+ | # / | ||
+ | |||
+ | Dovecot können wir nun leider nicht anweisen, direkt diese Parameterdatei zu laden. Wir werden daher unsere neu generierte Datei an Ort und Stelle verschieben, | ||
+ | # /usr/bin/mv / | ||
+ | |||
+ | Anschließend führen wir einen Reload des Dovecot-Daemon durch, damit dieser diese DH-Parameter neu einliest. | ||
+ | # systemctl reload dovecot | ||
+ | |||
+ | Da wir in regelmäßigen Abständen die Diffie-Hellman Parameter neu generieren wollen, verpacken wir die gerade gezeigten Schritte in ein Script verlagern. | ||
+ | # vim / | ||
+ | |||
+ | <file bash / | ||
+ | # Diffie-Hellman Parameter Datei erzeugen | ||
+ | / | ||
+ | |||
+ | # Hostname und Datum holen | ||
+ | NAME=`hostname -s` | ||
+ | DATUM=`date +'%b %e %H: | ||
+ | |||
+ | # Parameterdatei für Dovecot bereitstellen | ||
+ | /usr/bin/mv / | ||
+ | |||
+ | # Informationen zur neuen Parameterdatei im Maillog vermerken | ||
+ | echo " | ||
+ | |||
+ | # Dovecot die neuen DH-Parameter bekannt geben | ||
+ | / | ||
+ | |||
+ | # Temporäres Verzeichnis leeren | ||
+ | /usr/bin/rm / | ||
+ | </ | ||
+ | |||
+ | Damit das Script nun auch ausgeführt werden kann, versehen wir es noch mit den **x**-Ausführungsrechten. | ||
+ | # chmod +x / | ||
+ | |||
+ | Das regelmäßige Erneuern der DH-Parameter erfolgt nun regelmäßig und wir im Maillog entsprechend dokumentiert. | ||
+ | |||
+ | # less / | ||
+ | |||
+ | Jun 9 20:08:31 vml000077 dovecot: ssl-params(4526): | ||
+ | Jun 9 20:08:31 vml000077 dovecot: master: Warning: SIGHUP received - reloading configuration | ||
Zeile 1995: | Zeile 1726: | ||
===== Dovecot Verbindungstest ===== | ===== Dovecot Verbindungstest ===== | ||
+ | ==== openssl ==== | ||
Zum Testen der kompletten Konfigurationsänderungen greifen wir auf die Bibliothek **openssl** zurück. Im nachfolgendem Beispiel bauen wir eine Verbindung von einem entferneten Linux-Host im eigenen Netz auf. Somit haben wir auch gleich noch den Test, ob es ggf. nicht eine Firewall gibt, die unseren Verbindungsaufbauwunsch unter Umständen blockiert. | Zum Testen der kompletten Konfigurationsänderungen greifen wir auf die Bibliothek **openssl** zurück. Im nachfolgendem Beispiel bauen wir eine Verbindung von einem entferneten Linux-Host im eigenen Netz auf. Somit haben wir auch gleich noch den Test, ob es ggf. nicht eine Firewall gibt, die unseren Verbindungsaufbauwunsch unter Umständen blockiert. | ||
- | Nach Herstellen der Verbindung loggen wir uns einfach wieder vom System ab, in dem wir die Zeichenfolge **42 logout** | + | Nach Herstellen der Verbindung loggen wir uns einfach wieder vom System ab, in dem wir die Zeichenfolge **42 logout** |
$ openssl s_client -starttls imap -connect 10.0.0.70: | $ openssl s_client -starttls imap -connect 10.0.0.70: | ||
< | < | ||
Zeile 2123: | Zeile 1856: | ||
Jul 23 16:39:08 vml000070 dovecot: imap-login: Aborted login (no auth attempts in 5 secs): user=<>, | Jul 23 16:39:08 vml000070 dovecot: imap-login: Aborted login (no auth attempts in 5 secs): user=<>, | ||
+ | |||
+ | |||
+ | Wollen wir unser Produktiv-System überprüfen, | ||
+ | * **IMAP** und **START/ | ||
+ | * **IMAP** und **SSL**: < | ||
+ | * **POP3** und **SSL**: < | ||
+ | |||
+ | Finden wir in der Ausgabe eine der nachfolgenden Angaben, ist alles bestens, der IMAP-Server unterstützt **//Perfect Forward Secrecy//** | ||
+ | |||
+ | * **Protocol** : \\ TLSv1.2 \\ < | ||
+ | * **Cipher** : \\ ECDHE-RSA-AES256-GCM-SHA384 \\ DHE-RSA-AES256-GCM-SHA384 | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Wichtig: | ||
+ | </ | ||
+ | |||
+ | ==== cipherscan ==== | ||
+ | Zum Überprüfen welche Chiffren vom Server angeboten und unterstützt werden, greifen wir auf das Tool **[[https:// | ||
+ | |||
+ | Mit nachfolgendem Aufruf kann überprüft werden, welche Ciphers angeboten werden. | ||
+ | # / | ||
+ | |||
+ | < | ||
+ | Target: imap.nausch.org: | ||
+ | |||
+ | prio ciphersuite | ||
+ | 1 | ||
+ | 2 | ||
+ | 3 | ||
+ | 4 | ||
+ | 5 | ||
+ | 6 | ||
+ | 7 | ||
+ | 8 | ||
+ | 9 | ||
+ | 10 DHE-RSA-CAMELLIA256-SHA | ||
+ | 11 DHE-RSA-AES128-GCM-SHA256 | ||
+ | 12 DHE-RSA-AES128-SHA256 | ||
+ | 13 DHE-RSA-AES128-SHA | ||
+ | 14 DHE-RSA-SEED-SHA | ||
+ | 15 DHE-RSA-CAMELLIA128-SHA | ||
+ | |||
+ | Certificate: | ||
+ | TLS ticket lifetime hint: 300 | ||
+ | OCSP stapling: not supported | ||
+ | Cipher ordering: server | ||
+ | Curves ordering: server | ||
+ | Curves fallback: False | ||
+ | </ | ||
+ | |||
+ | Die Bewertung der einzelnen Chiffren müssen wir hier immer noch selbst vornehmen; hilfreiche Informationen hierzu findet man z.B. im Buch **// | ||
+ | |||
+ | |||
====== Links ====== | ====== Links ====== | ||
Zeile 2128: | Zeile 1914: | ||
* **[[wiki: | * **[[wiki: | ||
* **[[http:// | * **[[http:// | ||
- | |||
- | ~~DISCUSSION~~ | ||
- | |||