====== Erstellen eines DFN-signierten Zertifikates ====== Das Rechenzentrum kann Zitate ausstellen, die gegen die DFN-CA signiert sind und daher bspw. von Browsern ohne Nachfrage akzeptiert werden. Anschprechpartner ist [[schwarz@rz.uni-kiel.de|Ulrich Schwarz]]. ====== Zertifikatsantrag (.csr) erstellen ====== Folgende OpenSSL Konfiguration erstellen (als ''openssl-web.cnf''): # OpenSSL configuration. # HOME = RANDFILE = /.rnd [ ca ] default_ca = CA_default [ CA_default ] dir = /home/_admin_/ssl/ssl_spd.ltsh.de serial = $dir/serial database = $dir/index.txt new_certs_dir = $dir/newcerts certs = $dir/certs certificate = $certs/cacert.pem private_key = $dir/private/cakey.pem default_days = 365 default_md = md5 preserve = no email_in_dn = no nameopt = default_ca certopt = default_ca policy = policy_match copy_extensions = copy [ policy_match ] countryName = match stateOrProvinceName = match organizationName = match organizationalUnitName = optional commonName = supplied emailAddress = optional [ req ] default_bits = 4096 # Size of keys default_keyfile = key.pem # name of generated keys default_md = sha256 # message digest algorithm string_mask = nombstr # permitted characters distinguished_name = req_distinguished_name req_extensions = v3_req x509_extensions = v3_req [ req_distinguished_name ] # Variable name Prompt string #---------------------- ---------------------------------- 0.organizationName = Organization Name (company) organizationalUnitName = Organizational Unit Name (department, division) emailAddress = Email Address emailAddress_max = 40 localityName = Locality Name (city, district) stateOrProvinceName = State or Province Name (full name) countryName = Country Name (2 letter code) countryName_min = 2 countryName_max = 2 commonName = Common Name (hostname, IP, or your name) commonName_max = 64 # Default values for the above, for consistency and less typing. # Variable name Value #------------------------------ ------------------------------ 0.organizationName_default = Christian-Albrechts-Universitaet zu Kiel localityName_default = Kiel stateOrProvinceName_default = Schleswig-Holstein countryName_default = DE commonName_default = .informatik.uni-kiel.de emailAddress_default = ps-admin@informatik.uni-kiel.de organizationalUnitName_default = Computer Science Institute [ v3_ca ] basicConstraints = CA:TRUE subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer:always [ v3_req ] # Extensions to add to a certificate request basicConstraints = CA:FALSE keyUsage = nonRepudiation, digitalSignature, keyEncipherment, keyEncipherment, dataEncipherment, keyAgreement # Some CAs do not yet support subjectAltName in CSRs. # Instead the additional names are form entries on web # pages where one requests the certificate... subjectAltName = @alt_names [alt_names] ### SARASVATI: ILEARN DNS.1 = sarasvati.informatik.uni-kiel.de DNS.2 = ilearn.informatik.uni-kiel.de ### LYNCH: JENKINS #DNS.1 = lynch.informatik.uni-kiel.de #DNS.2 = jenkins.ps.informatik.uni-kiel.de ### ISSAN: GIT-PS #DNS.1 = issan.informatik.uni-kiel.de #DNS.2 = git-ps.informatik.uni-kiel.de #DNS.3 = git.ps.informatik.uni-kiel.de ### GISCOURS: WWW-PS #DNS.1 = giscours.informatik.uni-kiel.de #DNS.2 = www-ps.informatik.uni-kiel.de #DNS.3 = www.ps.informatik.uni-kiel.de #DNS.4 = wiki.ps.informatik.uni-kiel.de #DNS.5 = ilearn.ps.informatik.uni-kiel.de #DNS.6 = owncloud.ps.informatik.uni-kiel.de #DNS.7 = errbit.ps.informatik.uni-kiel.de #DNS.8 = redmine.ps.informatik.uni-kiel.de #DNS.9 = mdb.ps.informatik.uni-kiel.de #DNS.10 = packages.ps.informatik.uni-kiel.de ### MEDOC #DNS.1 = medoc.informatik.uni-kiel.de #DNS.2 = ldap.ps.informatik.uni-kiel.de #DNS.3 = broker.ps.informatik.uni-kiel.de #DNS.4 = master.ps.informatik.uni-kiel.de ### PESSAC #DNS.1 = pessac.informatik.uni-kiel.de #DNS.2 = mitarbeiter.ps.informatik.uni-kiel.de ### CHEVALBLANC #DNS.1 = chevalblanc.informatik.uni-kiel.de #DNS.2 = jenkins.ps.informatik.uni-kiel.de ### HEPHEISTOS #DNS.1 = hepheistos.informatik.uni-kiel.de #DNS.2 = urlaub.informatik.uni-kiel.de [ server ] # Make a cert with nsCertType set to "server" basicConstraints=CA:FALSE nsCertType = server nsComment = "OpenSSL Generated Server Certificate" subjectKeyIdentifier=hash authorityKeyIdentifier=keyid,issuer:always [ client ] # Make a cert with nsCertType set to "client" basicConstraints=CA:FALSE nsCertType = client nsComment = "OpenSSL Generated Client Certificate" subjectKeyIdentifier=hash authorityKeyIdentifier=keyid,issuer:always Im selben Ordner, das Skript ''web_reqcert.sh'' anlegen und ausführbar machen: #!/bin/bash if [ -z "$1" ]; then echo "usage: $(basename $0) " exit 1 fi FQDN="$1" FQDNunderscores=$(echo $FQDN | sed 's/\./_/g') base="$(pwd)" test -d "$base/private" || mkdir -p "$base/private" if [ -f "$base/private/${FQDNunderscores}.key" ]; then openssl req -config "$base/openssl-web.cnf" \ -nodes -new \ -key "$base/private/${FQDNunderscores}.key" \ -out "$base/${FQDNunderscores}.csr" else openssl req -config "$base/openssl-web.cnf" \ -nodes -new \ -keyout "$base/private/${FQDNunderscores}.key" \ -out "$base/${FQDNunderscores}.csr" fi Das Skript ausführen: $ ./web_certreq Die folgenden Fragen alle bestätigen. Achtung: bei "Common Name" den des Servers von Hand eingeben: You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Organization Name (company) [Christian-Albrechts-Universitaet zu Kiel]: Organizational Unit Name (department, division) [Computer Science Institute]: Email Address [ps-admin@informatik.uni-kiel.de]: Locality Name (city, district) [Kiel]: State or Province Name (full name) [Schleswig-Holstein]: Country Name (2 letter code) [DE]: Common Name (hostname, IP, or your name) [.informatik.uni-kiel.de]: Den entstehenden Key ''./private/.key'' gut aufbewahren (bzw. auf den Webserver kopieren). Der Key wird sich bei Verlängerungsanträgen nicht mehr ändern. Die Datei muss vorm Zugriff dritter geschützt werden. Die entstehende ''.csr'' Datei (Certificate Signing Request) wird im folgenden Schritt benötigt. ====== Zertifikatsantrag (.csr) beim DfN hochladen ====== * Der Anleitung des CAU-RZ folgen: https://www.rz.uni-kiel.de/de/angebote/pki/serverzertifikate-erstellen-und-installieren * Zertifikatsantrag (.csr) beim DFN Hochladen: https://pki.pca.dfn.de/dfn-ca-global-g2/cgi-bin/pub/pki?cmd=getStaticPage&name=index&RA_ID=4540 - Klick auf Server-Zertifikat - Die ''.csr'' Datei auswählen im Feld ''PKCS#10-Zertifikatantrag (PEM-formatierte Datei)'' - Zertifikatprofil: Webserver - unter "Weitere Angaben" alles ausfüllen wir im Formular beschrieben - die PIN notieren in der Datei ''.PIN'' (im gleichen Ordner wie die ''.csr'' Datei) - Klick auf Button [ Weiter ] * Zertifikatsantragsformular nochmals prüfen und dann bestätigen * Zertifikatsantrag anzeigen. Ein PDF öffnet sich. Speichern und drucken. * Gedrucktes PDF unterschreiben und in die Hauspost an Ulrich Schwarz. ====== Warten ====== Nach einigen Tagen erhält man das signierte Zertifikat per e-Mail an die Dienst-Adresse, die beim Zertifikatsantrag verwendet wird. ====== Zertifikat ausrollen ====== Das Zertifikat (.crt) muss dann auf dem Ziel-Server hinterlegt werden. Handelt es sich um eine Zertifikatsverlängerung, muss nur das neue Zertifikat ausgerollt werden. Handelt es sich um einen Neuantrag, dann muss Zertifikat und Key ausgerollt werden. Der Installationsort liegt in der Arbeitsgruppe normalerweise unter /etc//ssl/. Die Key Datei muss mit Rechten ''0600'' ausgerollt werden. Das Zertifikat darf lesbar bleiben. Achtung: da DFN-Zertifikate nicht direkt gegen ein Stammzertifikat signiert wurden, sondern gegen Intermediärzertifikate, muss man die Zertifikatskette an das Server-Zertifikat innerhalb der .crt Datei anhängen. Vergleiche: https://pki.pca.dfn.de/dfn-ca-global-g2/cgi-bin/pub/pki?cmd=getStaticPage;name=index;id=2&RA_ID=4540 (Klick auf "Zertifikatskette anzeigen"). ====== Zertifikat verlängern ====== Das DFN erinnert per Mail an Zertifikate, die zeitnah verlängert werden müssen.