(Facultatif) Création de certificats racine et serveur de test
Cette section décrit le cas éventuel de création de votre propre certificat racine d'autorité de certification et de votre propre certificat serveur, si nécessaire à des fins de tests. Il est cependant fortement recommandé d'utiliser un certificat serveur émis par une autorité de certification reconnue. Si vous utilisez un certificat serveur émis par une autorité de certification reconnue, vous pouvez ignorer cette section.
Pour créer le certificat racine d'autorité de certification et le certificat serveur, procédez comme suit :
-
Générez une clé privée :
openssl genrsa -des3 -out myCA.key 2048 -
Générez un certificat racine. Pour des raisons pratiques, identifiez le certificat comme étant le certificat racine dans la zone Common Name :
openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pemEnter pass phrase for myCA.key: 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. ----- Country Name (2 letter code) [AU]:US State or Province Name (full name) [Some-State]:Massachusetts Locality Name (eg, city) []:Waltham Organization Name (eg, company) [Internet Widgits Pty Ltd]:Company Name Organizational Unit Name (eg, section) []:PMFA Common Name (e.g. server FQDN or YOUR name) []:PMFA Root Certificate Email Address []:user@company.com -
Créez une clé privée :
openssl genrsa -out test-server.key 2048 -
Créez une demande de signature de certificat. Pour des raisons pratiques, identifiez le certificat comme étant le certificat serveur dans la zone Common Name :
openssl req -new -key test-server.key -out test-server.csrYou 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. ----- Country Name (2 letter code) [AU]:US State or Province Name (full name) [Some-State]:Massachusetts Locality Name (eg, city) []:Waltham Organization Name (eg, company) [Internet Widgits Pty Ltd]:Company Name Organizational Unit Name (eg, section) []:PMFA Common Name (e.g. server FQDN or YOUR name) []:Test Server Certificate Email Address []:user@company.com Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: -
Utilisez un éditeur afin de créer un fichier d'extension pour le certificat serveur. Assurez-vous que vous spécifiez les noms de remplacement, c'est-à-dire tous les noms qui peuvent être entrés dans le navigateur par un utilisateur pour accéder au serveur.
authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment subjectAltName = @alt_names [alt_names] DNS.1 = fully-qualified-host-name DNS.2 = short-name DNS.3 = IP address -
Créez le certificat serveur à l'aide de la demande de signature de certificat, de la clé privée de l'autorité de certification, du certificat d'autorité de certification et du fichier d'extension :
openssl x509 -req -in test-server.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out test-server.pem -days 1825 -sha256 -extfile test-server.extSignature ok subject=/C=US/ST=Massachusetts/L=Waltham/O=Company/OU=PMFA/CN=Test Server Certificate/ emailAddress=user@company.com Getting CA Private Key Enter pass phrase for myCA.key: -
Affichez le certificat serveur. Notez qu'il est émis par la racine de l'autorité de certification, et que les noms de remplacement figurent dans le fichier d'extension.
openssl x509 -in test-server.pem -textCertificate: Data: Version: 3 (0x2) Serial Number: e8:e4:50:85:c4:eb:b5:ba Signature Algorithm: sha256WithRSAEncryption Issuer: C=US, ST=Massachusetts, L=Waltham, O=Compant, OU=PMFA, CN=PMFA Root Certificate/ emailAddress=user@company.com Validity Not Before: Dec 1 19:30:02 2017 GMT Not After : Nov 30 19:30:02 2022 GMT Subject: C=US, ST=Massachusetts, L=Waltham, O=Company, OU=PMFA, CN=Test Server Certificate/ emailAddress=user@company.com Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: 00:ac:ed:13:11:8e:34:dd:98:03:19:1c:03:d9:1e: f1:9b:c6:74:00:ce:36:3a:b1:fc:f7:c8:0c:c6:bf: 33:91:dc:c5:31:d1:2f:07:03:1b:62:9f:aa:64:d9: e2:1e:ae:6c:d2:ab:4d:29:2b:0e:4b:dc:ef:43:b2: 59:14:97:d0:db:ca:fc:d8:67:fa:51:5f:a4:0d:93: d3:ab:b1:e8:cd:24:62:c4:c8:b9:69:f1:f8:e1:8a: 49:72:d9:c7:1f:c4:30:31:f7:c9:0a:65:fe:3c:3a: 54:cf:9e:de:98:64:8d:04:53:09:08:95:67:10:ba: 7e:b6:46:1c:1c:4a:00:75:7c:1c:0d:6e:0e:dd:19: 7d:12:c3:be:f7:9d:04:a0:32:92:9d:f2:5e:58:87: 95:da:8e:5f:6e:5f:d6:f6:22:74:4d:a5:02:4b:d8: 8e:07:98:f9:93:5e:11:67:83:27:dd:3b:90:4c:c1: 25:c5:1f:c9:60:fb:0c:02:5d:a5:ed:87:eb:d5:9e: 14:fe:12:6a:06:52:34:37:b9:73:70:2b:c4:16:cc: cd:ed:21:d5:3a:3b:12:f1:21:6e:01:ab:51:3d:c9: c7:9e:12:62:b3:8f:53:97:f7:2b:57:f0:2a:52:fe: b7:55:54:d7:fa:05:2d:8a:a9:f2:6a:43:d3:8c:c3: 39:31 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Authority Key Identifier: keyid:F5:B2:B7:0E:D7:1A:C3:9B:7B:66:3A:C7:17:1F:42:B5:07:71:FF:94 X509v3 Basic Constraints: CA:FALSE X509v3 Key Usage: Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment X509v3 Subject Alternative Name: DNS:fully-qualified-hostname, DNS:hostname, DNS:IP address Signature Algorithm: sha256WithRSAEncryption 46:25:e4:db:d9:24:93:b7:18:31:c1:96:d0:dd:82:c5:e8:2c: da:c3:79:cd:8a:a4:7e:6d:83:62:cc:07:e2:87:9d:2e:2f:54: 12:9e:a7:47:ce:f3:09:6d:23:6c:8d:4d:b7:19:ca:63:da:92: bc:e5:9f:e3:91:92:a5:10:f3:47:56:ca:1f:ec:fe:5c:b6:d2: 0c:03:a7:49:ee:7d:69:35:44:3d:1b:ce:10:01:d2:0a:5c:51: 3a:e5:97:93:61:b3:6e:ca:6e:63:cd:44:79:7c:d7:4e:2b:cf: 40:d3:25:fb:16:9d:49:8b:a8:11:9e:d0:79:3c:5f:9e:51:eb: 49:6e:62:77:fb:93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M0k YsTIuWnx+OGKSXLZxx/EMDH3yQpl/jw6VM+e3phkjQRTCQiVZxC6frZGHBxKAHV8 HA1uDt0ZfRLDvvedBKAykp3yXliHldqOX25f1vYidE2lAkvYjgeY+ZNeEWeDJ907 kEzBJcUfyWD7DAJdpe2H69WeFP4SagZSNDe5c3ArxBbMze0h1To7EvEhbgGrUT3J x54SYrOPU5f3K1fwKlL+t1VU1/oFLYqp8mpD04zDOTECAwEAAaOBhzCBhDAfBgNV HSMEGDAWgBT1srcO1xrDm3tmOscXH0K1B3H/lDAJBgNVHRMEAjAAMAsGA1UdDwQE AwIE8DBJBgNVHREEQjBAgiF3YWxkZXZwc2NhaXgzOC5yb2NrZXRzb2Z0d2FyZS5j b22CDndhbGRldnBzY2FpeDM4ggsxMC4xNy41Ni44MzANBgkqhkiG9w0BAQsFAAOC AQEARiXk29kkk7cYMcGW0N2Cxegs2sN5zYqkfm2DYswH4oedLi9UEp6nR87zCW0j bI1NtxnKY9qSvOWf45GSpRDzR1bKH+z+XLbSDAOnSe59aTVEPRvOEAHSClxROuWX k2GzbspuY81EeXzXTivPQNMl+xadSYuoEZ7QeTxfnlHrSW5id/uT/C2hsud3IKQH TW/Ijv8U/FpKFsCcId4+cosW5w4VANUW2y6M5A3ontjeENiRTN+lSg3CFANG0p6i 9qToYlilhr1/3u3XQbaRxhzMy4W7avOE7ADQRfrdhHM5BBL5narMhTp9f3vtAV8j lTylEV1+lgFkbGaM49eorw4Sag== -----END CERTIFICATE----- -
Convertissez le certificat serveur et la clé privée au format PKCS#12. Entrez un mot de passe de votre choix lorsque vous y êtes invité.
openssl pkcs12 -export -chain -inkey test-server.key -CAfile myCA.pem -in test-server.pem -out test-server.pfxEnter Export Password: Verifying - Enter Export Password: -
Configurez le serveur IBM®
PowerSC MFA de sorte qu'il utilise cette identité et cette phrase passe PKCS#12.
- Utilisez la commande de copie sécurisée (scp) pour copier le fichier obtenu dans le répertoire /etc/security/pmfa/certificates du système serveur IBM PowerSC MFA.
- Placez-vous dans le répertoire (cd) /opt/IBM/powersc/MFA/bin.
-
Créez un fichier d'entrée au format suivant :
# initial trace level for pMFA server INITIAL TRACE LEVEL=0 # location of the P12 identity certificate for the pMFA server P12 LOCATION=/etc/security/pmfa/certificates/test-server.pfx # PKCS11 token used while encrypting P12 password PKCS11 TOKEN NAME=pmfa # directory or PEM file containing CAs that will be trusted by the pMFA server CAS LOCATION=/etc/security/pmfa/certificates/client.pem # port to use for server-authentication SERVER AUTH PORT=6793 # port to use for mutual authentication MUTUAL AUTH PORT=6794 -
Exécutez la commande suivante en tant que superutilisateur :
./pmfa_webserver_config input-filePour plus d'informations sur les paramètres de l'utilitaire pmfa_webserver_config, voir Fin de la configuration du serveur.
-
Utilisez le certificat racine d'autorité de certification (myCA.pem dans les exemples) pour le magasin de clés de confiance client que vous avez créé.
TRUSTEDCAS = /etc/security/pmfa/certificates/myCA.pem