4
Most read
7
Most read
Forget self-signed:
A proper internal CA
infrastructure in five minutes
OSMC 2024
Mattias Schlenker
Technical Writer - Team Knowledge
2
The starting point
⬢ People™ want the easiest way to provide
SSL enabled services
⬢ They want security
⬢ They need to monitor certificates for
validity
This does not go together well.
Solution: In five minutes from zero to CA!
Users are accustomed to self-signed
3
This does not go together!
⬢ How can we trust an SSL certificate if there
is no second channel to verify?
⬢ How can that be secure?
⬢ Why should we monitor such certificates at
all?
⬢ In the end, we monitor certificates of an
attacker!
4
Sometimes we turn back
customers wishes…
⬢ When implementing check_cert, we
refused to add the option “allow
self-signed certificatesˮ
⬢ Either use old check_http to monitor
services where you need it…
⬢ Or skip monitoring those services…
The better solution:
Create an internal CA.
5
This can be done in 5 minutes
By following this slideset.
6
A basic CA infrastructure
consists of…
1. A root certificate safely stored away
2. One or more intermediate certificates for
signing server certificates
3. The plethora of certificates that get
deployed
7
8
Warning!
For simplicity, we
do not use a
certificate
revocation list.
9
Carlaʼs root certificate:
# Some folders:
carla@nb:~$ for d in certs newcerts crl private ; do mkdir -p ~/ca/$d ; done
# Empty files
carla@nb:~$ for f in index.txt serial ; do touch ~/ca/$f ; done
carla@nb:~$ cd ca
# The private key. Use a proper password!
carla@nb:~/ca$ openssl genrsa -aes256 -out private/ca.key.pem 4096
# And finally the root cert
carla@nb:~/ca$ openssl req -config ca.cnf -new 
-key private/ca.key.pem -x509 -days 4398 
-sha256 -extensions v3_ca -out certs/ca.cert.pem
Enter pass phrase for private/ca.key.pem:
10
Bobʼs intermediate certificate:
bob@pc:~$ for d in certs newcerts crl private ; do mkdir -p ~/im/$d ; done
bob@pc:~$ for f in index.txt serial ; do touch ~/im/$f ; done
bob@pc:~$ cd im
bob@pc:~/im$ openssl genrsa -aes256 -out private/im.key.pem 4096
The next step is to create the Certificate Signing Request CSR for this key, the .csr
file name suffix is commonly used here:
bob@pc:~/im$ openssl req -config im.cnf -new -sha256 
-key private/im.key.pem -out certs/imbob.csr
The Common Name here must be different from that of the root certificate. And
here, too, you should use an accessible e-mail address.
11
Carla signs Bobʼs IM certificate:
carla@nb:~$ cd ca
carla@nb:~/ca$ openssl ca -config ca.cnf 
-extensions v3_intermediate_ca 
-days 1476 -rand_serial -notext -md sha256 
-in certs/imbob.csr -out certs/imbob.pem
Now the passphrase for the key will be requested, the contents of the Certificate
Signing Request are displayed and the Intermediate Certificate is created following
confirmation. Carla now gives Bob the two PEM files ca.cert.pem (the PEM-encoded
certificate of the Certificate Authority) and imbob.pem (the Intermediate certificate)
12
Creating a server key and CSR
Alice is the administrator of the internal Checkmk servers at Stark Industries Ltd. To
secure a new Checkmk server, she first creates the server key.
alice@pc:~$ openssl genrsa -out checkmk.starkindustries.test.key 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
This is followed by the creation of the CSR. Again the questions as to the
organization and department must be answered. Important here is the Common
Name, which should correspond to the server's primary host name.
alice@pc:~$ openssl req -new -key checkmk.starkindustries.test.key 
-out checkmk.starkindustries.test.csr
13
Do not forget the extension file!
/home/alice/checkmk.starkindustries.test.ext
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment,
dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = checkmk.starkindustries.test
DNS.2 = monitoring.starkindustries.test
14
Final step: Bob signs Aliceʼ CSR
bob@pc:~$ cd im
bob@pc:~/im$ openssl x509 -CAcreateserial -req 
-in certs/checkmk.starkindustries.test.csr 
-CA certs/imbob.pem -CAkey private/im.key.pem 
-out certs/checkmk.starkindustries.test.crt -days 365 
-sha256 -extfile certs/checkmk.starkindustries.test.ext
Alice can now roll out these three files on the server:
/etc/apache2/sites-enabled/default-ssl.conf
SSLEngine on
SSLCertificateKeyFile /etc/certs/checkmk.starkindustries.test.key
SSLCertificateChainFile /etc/certs/imbob.pem
SSLCertificateFile /etc/certs/checkmk.starkindustries.test.crt
15
Roll out the CA
The ways to import a CA certificate as trusted differ from browser to browser.
Usually it is sufficient to add the ca.cert.pem certificate under Settings > Privacy and
Security > Certificates > Import.
You can integrate the root certificate into the host's local CA database: To do this,
copy the ca.cert.pem file to /usr/local/share/ca-certificates/starkindustries.crt. Then
regenerate the cache:
root@linux# update-ca-certificates
Checkmk GmbH
Kellerstraße 27
81667 München
Germany
Web — checkmk.com
mattias.schlenker@checkmk.com
feedback@checkmk.com
Questions? Get in touch
Thank you!
Background & explanations in CMK blog:
https://checkmk.io/cert-authority

More Related Content

PDF
Certificate Management on pfSense 2.4 - pfSense Hangout September 2017
PDF
320.1-Cryptography
PDF
Building basic public key infrastucture (PKI)
PPTX
Certificates, PKI, and SSL/TLS for infrastructure builders and operators
DOC
3 level cert tomcat
PDF
SSL Certificates and Operations
PPTX
Public Key Infrastructures
Certificate Management on pfSense 2.4 - pfSense Hangout September 2017
320.1-Cryptography
Building basic public key infrastucture (PKI)
Certificates, PKI, and SSL/TLS for infrastructure builders and operators
3 level cert tomcat
SSL Certificates and Operations
Public Key Infrastructures

Similar to OSCM 2024 | Ignite: Monitoring and maintaining self-signed certificates is dangerous by Mattias Schlenker.pdf (20)

PDF
PKI in DevOps: How to Deploy Certificate Automation within CI/CD
PPT
SSL Implementation - IBM MQ - Secure Communications
PDF
5.[29 38]a practical approach for implementation of public key infrastructure...
PDF
5.[29 38]a practical approach for implementation of public key infrastructure...
PDF
Dr. Omar Ali Alibrahim - Ssl talk
PDF
When Securing Access to Data is About Life and Death
PPTX
Types of ssl commands and keytool
PDF
Cisco iso based CA (certificate authority)
PPTX
[Cluj] Turn SSL ON
PDF
PDF
Steam Learn: HTTPS and certificates explained
PPTX
SSL/TLS Introduction with Practical Examples Including Wireshark Captures
PPT
PDF
Information about the SSL Certificate
PDF
Fun With SHA2 Certificates
PPTX
Secure socket layer
 
PDF
Hardening cassandra for compliance or paranoia
PDF
The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).
PDF
Rfc3280
PDF
TLS and Certificates
PKI in DevOps: How to Deploy Certificate Automation within CI/CD
SSL Implementation - IBM MQ - Secure Communications
5.[29 38]a practical approach for implementation of public key infrastructure...
5.[29 38]a practical approach for implementation of public key infrastructure...
Dr. Omar Ali Alibrahim - Ssl talk
When Securing Access to Data is About Life and Death
Types of ssl commands and keytool
Cisco iso based CA (certificate authority)
[Cluj] Turn SSL ON
Steam Learn: HTTPS and certificates explained
SSL/TLS Introduction with Practical Examples Including Wireshark Captures
Information about the SSL Certificate
Fun With SHA2 Certificates
Secure socket layer
 
Hardening cassandra for compliance or paranoia
The Last Pickle: Hardening Apache Cassandra for Compliance (or Paranoia).
Rfc3280
TLS and Certificates
Ad

Recently uploaded (20)

PPTX
CASEWORK Power Point Presentation - pointers
PPTX
Religious Thinkers Presentationof subcontinent
PPTX
ANICK 6 BIRTHDAY....................................................
PPTX
INDIGENOUS-LANGUAGES-AND-LITERATURE.pptx
PPTX
Lesson 1 (Digital Media) - Multimedia.pptx
PPTX
WEB_DEVELOPMENTGJMFGHJMGJMFJM FGJMFGHMNF
PDF
MODULE 3 BASIC SECURITY DUTIES AND ROLES.pdf
PPTX
Kompem Part Untuk MK Komunikasi Pembangunan 5.pptx
PDF
Module 7 guard mounting of security pers
PPTX
Bob Difficult Questions 08 17 2025.pptx
PDF
_Nature and dynamics of communities and community development .pdf
PPT
Comm.-100W-Writing-a-Convincing-Editorial-slides.ppt
PPTX
Phylogeny and disease transmission of Dipteran Fly (ppt).pptx
PPTX
Pharmaceutical industry and drugdevelopment.pptx
PPTX
2025-08-17 Joseph 03 (shared slides).pptx
PPTX
Public Speaking Is Easy . Start Now . It's now or never.
DOCX
CLASS XII bbbbbnjhcvfyfhfyfyhPROJECT.docx
PPTX
power point presentation ofDracena species.pptx
PPTX
CASEWORK Pointers presentation Field instruction I
PPTX
Phrases and phrasal verb for a small step.
CASEWORK Power Point Presentation - pointers
Religious Thinkers Presentationof subcontinent
ANICK 6 BIRTHDAY....................................................
INDIGENOUS-LANGUAGES-AND-LITERATURE.pptx
Lesson 1 (Digital Media) - Multimedia.pptx
WEB_DEVELOPMENTGJMFGHJMGJMFJM FGJMFGHMNF
MODULE 3 BASIC SECURITY DUTIES AND ROLES.pdf
Kompem Part Untuk MK Komunikasi Pembangunan 5.pptx
Module 7 guard mounting of security pers
Bob Difficult Questions 08 17 2025.pptx
_Nature and dynamics of communities and community development .pdf
Comm.-100W-Writing-a-Convincing-Editorial-slides.ppt
Phylogeny and disease transmission of Dipteran Fly (ppt).pptx
Pharmaceutical industry and drugdevelopment.pptx
2025-08-17 Joseph 03 (shared slides).pptx
Public Speaking Is Easy . Start Now . It's now or never.
CLASS XII bbbbbnjhcvfyfhfyfyhPROJECT.docx
power point presentation ofDracena species.pptx
CASEWORK Pointers presentation Field instruction I
Phrases and phrasal verb for a small step.
Ad

OSCM 2024 | Ignite: Monitoring and maintaining self-signed certificates is dangerous by Mattias Schlenker.pdf

  • 1. Forget self-signed: A proper internal CA infrastructure in five minutes OSMC 2024 Mattias Schlenker Technical Writer - Team Knowledge
  • 2. 2 The starting point ⬢ People™ want the easiest way to provide SSL enabled services ⬢ They want security ⬢ They need to monitor certificates for validity This does not go together well. Solution: In five minutes from zero to CA! Users are accustomed to self-signed
  • 3. 3 This does not go together! ⬢ How can we trust an SSL certificate if there is no second channel to verify? ⬢ How can that be secure? ⬢ Why should we monitor such certificates at all? ⬢ In the end, we monitor certificates of an attacker!
  • 4. 4 Sometimes we turn back customers wishes… ⬢ When implementing check_cert, we refused to add the option “allow self-signed certificatesˮ ⬢ Either use old check_http to monitor services where you need it… ⬢ Or skip monitoring those services…
  • 5. The better solution: Create an internal CA. 5
  • 6. This can be done in 5 minutes By following this slideset. 6
  • 7. A basic CA infrastructure consists of… 1. A root certificate safely stored away 2. One or more intermediate certificates for signing server certificates 3. The plethora of certificates that get deployed 7
  • 8. 8 Warning! For simplicity, we do not use a certificate revocation list.
  • 9. 9 Carlaʼs root certificate: # Some folders: carla@nb:~$ for d in certs newcerts crl private ; do mkdir -p ~/ca/$d ; done # Empty files carla@nb:~$ for f in index.txt serial ; do touch ~/ca/$f ; done carla@nb:~$ cd ca # The private key. Use a proper password! carla@nb:~/ca$ openssl genrsa -aes256 -out private/ca.key.pem 4096 # And finally the root cert carla@nb:~/ca$ openssl req -config ca.cnf -new -key private/ca.key.pem -x509 -days 4398 -sha256 -extensions v3_ca -out certs/ca.cert.pem Enter pass phrase for private/ca.key.pem:
  • 10. 10 Bobʼs intermediate certificate: bob@pc:~$ for d in certs newcerts crl private ; do mkdir -p ~/im/$d ; done bob@pc:~$ for f in index.txt serial ; do touch ~/im/$f ; done bob@pc:~$ cd im bob@pc:~/im$ openssl genrsa -aes256 -out private/im.key.pem 4096 The next step is to create the Certificate Signing Request CSR for this key, the .csr file name suffix is commonly used here: bob@pc:~/im$ openssl req -config im.cnf -new -sha256 -key private/im.key.pem -out certs/imbob.csr The Common Name here must be different from that of the root certificate. And here, too, you should use an accessible e-mail address.
  • 11. 11 Carla signs Bobʼs IM certificate: carla@nb:~$ cd ca carla@nb:~/ca$ openssl ca -config ca.cnf -extensions v3_intermediate_ca -days 1476 -rand_serial -notext -md sha256 -in certs/imbob.csr -out certs/imbob.pem Now the passphrase for the key will be requested, the contents of the Certificate Signing Request are displayed and the Intermediate Certificate is created following confirmation. Carla now gives Bob the two PEM files ca.cert.pem (the PEM-encoded certificate of the Certificate Authority) and imbob.pem (the Intermediate certificate)
  • 12. 12 Creating a server key and CSR Alice is the administrator of the internal Checkmk servers at Stark Industries Ltd. To secure a new Checkmk server, she first creates the server key. alice@pc:~$ openssl genrsa -out checkmk.starkindustries.test.key 2048 Generating RSA private key, 2048 bit long modulus (2 primes) This is followed by the creation of the CSR. Again the questions as to the organization and department must be answered. Important here is the Common Name, which should correspond to the server's primary host name. alice@pc:~$ openssl req -new -key checkmk.starkindustries.test.key -out checkmk.starkindustries.test.csr
  • 13. 13 Do not forget the extension file! /home/alice/checkmk.starkindustries.test.ext authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment subjectAltName = @alt_names [alt_names] DNS.1 = checkmk.starkindustries.test DNS.2 = monitoring.starkindustries.test
  • 14. 14 Final step: Bob signs Aliceʼ CSR bob@pc:~$ cd im bob@pc:~/im$ openssl x509 -CAcreateserial -req -in certs/checkmk.starkindustries.test.csr -CA certs/imbob.pem -CAkey private/im.key.pem -out certs/checkmk.starkindustries.test.crt -days 365 -sha256 -extfile certs/checkmk.starkindustries.test.ext Alice can now roll out these three files on the server: /etc/apache2/sites-enabled/default-ssl.conf SSLEngine on SSLCertificateKeyFile /etc/certs/checkmk.starkindustries.test.key SSLCertificateChainFile /etc/certs/imbob.pem SSLCertificateFile /etc/certs/checkmk.starkindustries.test.crt
  • 15. 15 Roll out the CA The ways to import a CA certificate as trusted differ from browser to browser. Usually it is sufficient to add the ca.cert.pem certificate under Settings > Privacy and Security > Certificates > Import. You can integrate the root certificate into the host's local CA database: To do this, copy the ca.cert.pem file to /usr/local/share/ca-certificates/starkindustries.crt. Then regenerate the cache: root@linux# update-ca-certificates
  • 16. Checkmk GmbH Kellerstraße 27 81667 München Germany Web — checkmk.com mattias.schlenker@checkmk.com feedback@checkmk.com Questions? Get in touch Thank you! Background & explanations in CMK blog: https://checkmk.io/cert-authority