This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| opensearch:generating_certificates [2023/01/31 21:34] – created olaf | opensearch:generating_certificates [2023/02/01 00:06] (current) – ↷ Links adapted because of a move operation olaf | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ==== Creating certificates for OpenSearch ==== | ||
| + | <code bash> | ||
| + | cd / | ||
| + | mkdir certs.old | ||
| + | mkdir certs | ||
| + | chown opensearch: | ||
| + | chmod 600 certs | ||
| + | mv *.pem certs.old/ | ||
| + | cd certs | ||
| + | </ | ||
| + | === Create the CA certificate === | ||
| + | Generate a RSA key with 2048 bit length | ||
| + | <code bash> | ||
| + | Generate a Root CA certificate signed with the gerated key valid for 5 years\\ | ||
| + | At the end, it's only importnant that CN has a value - else possession of the key is important to sign client certificates | ||
| + | <code bash> | ||
| - | Back to [[opensearch: | + | === Create a certificate for the admin user === |
| + | <code bash> | ||
| + | Convert the key to PKCS#8 | ||
| + | <code bash> | ||
| + | #Create a CSR | ||
| + | <code bash> | ||
| + | #Sign the CSR | ||
| + | <code bash> | ||
| + | |||
| + | === Create the certificate for the node === | ||
| + | openssl genrsa -out node-01-key-temp.pem 2048</ | ||
| + | Convert the key format to PKCS#8 | ||
| + | openssl pkcs8 -inform PEM -outform PEM -in node-01-key-temp.pem -topk8 -nocrypt -v1 PBE-SHA1-3DES -out node-01-key.pem</ | ||
| + | Create a CSR | ||
| + | openssl req -new -key node-01-key.pem -subj "/ | ||
| + | |||
| + | Create an extension file containing the Subject Alternate Names (SAN): | ||
| + | <code bash> | ||
| + | cat > node-01.ext | ||
| + | subjectAltName = @SAN | ||
| + | [SAN] | ||
| + | DNS.1 = node-01 | ||
| + | IP.1 = 1.1.1.127 | ||
| + | </ | ||
| + | after the last line press < | ||
| + | |||
| + | Generate the cerificate for the node | ||
| + | <code bash> | ||
| + | |||
| + | change the owner and permissions of the generated certificates and keys | ||
| + | <code bash> | ||
| + | chown opensearch: | ||
| + | chmod 600 *.pem | ||
| + | </ | ||
| + | |||
| + | Back to [[opensearch: | ||