Slackbot
10/27/2022, 5:41 PMJeremy Mill
10/27/2022, 5:44 PMbastelfreak
10/27/2022, 5:48 PMbastelfreak
10/27/2022, 5:48 PMbastelfreak
10/27/2022, 5:50 PMkelvin
10/27/2022, 5:51 PMJeremy Mill
10/27/2022, 5:53 PMkelvin
10/27/2022, 5:53 PMbastelfreak
10/27/2022, 5:55 PMkelvin
10/27/2022, 5:55 PMbastelfreak
10/27/2022, 5:55 PMkelvin
10/27/2022, 5:55 PMbastelfreak
10/27/2022, 5:56 PMkelvin
10/27/2022, 5:57 PMupdate-ca-trust won’t extract your certificate file to the ca-bundle.crt unless this succeeds:
openssl x509 -noout -text -in <cert_file> | grep --after-context=2 "X509v3 Basic Constraints" | grep "CA:TRUE"
Because the puppetserver certificate served on 8140 does not match CA:TRUE (it’s FALSE) Linux update-ca-trust fails to copy/extract to the tls-ca-bundle used by cURL on linux.bastelfreak
10/27/2022, 5:58 PMbastelfreak
10/27/2022, 5:58 PM# openssl x509 -noout -text -in /etc/puppetlabs/puppetserver/ca/ca_crt.pem | grep CA
Issuer: CN = Puppet Root CA: 7cf5d98cdb92bc
Subject: CN = "Puppet Enterprise CA generated at +2022-10-22 17:42:42 +0000"
CA:TRUEkelvin
10/27/2022, 5:58 PMkelvin
10/27/2022, 5:59 PMkelvin
10/27/2022, 5:59 PMkelvin
10/27/2022, 5:59 PMbastelfreak
10/27/2022, 5:59 PMbastelfreak
10/27/2022, 5:59 PMJeremy Mill
10/27/2022, 6:01 PMkelvin
10/27/2022, 6:39 PMkelvin
10/27/2022, 6:39 PMX509v3 Subject Key Identifier:
49:92:A6:FB:5A:67:BF:C3:84:26:A6:CE:B1:04:D5:AC:C1:57:7B:70
Netscape Comment:
Puppet Server Internal Certificate
X509v3 Authority Key Identifier:
keyid:49:92:A6:FB:5A:67:BF:C3:84:26:A6:CE:B1:04:D5:AC:C1:57:7B:70kelvin
10/27/2022, 6:39 PMkelvin
10/27/2022, 6:42 PMcurl --cacert /etc/pki/ca-trust/source/anchors/puppetserver.crtcsharpsteen
10/27/2022, 6:45 PMpuppetserver defaults to using the end-entity certificate of the puppet agent service on port 8140 which is signed by the Puppet CA certificate.
puppetserver never has used or presented the Puppet CA certificate directly.bastelfreak
10/27/2022, 6:56 PMkelvin
10/27/2022, 6:56 PMbastelfreak
10/27/2022, 6:57 PMbastelfreak
10/27/2022, 6:58 PMkelvin
10/27/2022, 6:59 PMbastelfreak
10/27/2022, 7:01 PMcsharpsteen
10/27/2022, 7:03 PMDiscovered something that I’m trying to determine if its a feature or a bug. The certificate that puppet enterprise (2021.7) uses on 8140 (separate cert for 443) is not a CA certificateThat is the expected behavior and the default configuration going all the way back to PE 3.7.
csharpsteen
10/27/2022, 7:04 PMCA:TRUE to the TLS handshake, that's something someone would had to have gone out of their way to configure.csharpsteen
10/27/2022, 7:09 PMpuppet daemon, are expected to use the certificate bundle returned by puppet config print localcacert to validate the Puppet Server certificate.
That bundle could be added to the system trust store, but we don't recommend it as it gives the Puppet CA more privilege than needed for puppet operations.kelvin
10/27/2022, 7:09 PMsubject=CN = Puppet Root CAkelvin
10/27/2022, 7:11 PMcsharpsteen
10/27/2022, 7:12 PMpuppet daemon on client systems needs to trust the Puppet CA. That is not true of all HTTP/TLS clients that may be running on the system.bastelfreak
10/27/2022, 7:14 PMbastelfreak
10/27/2022, 7:14 PMkelvin
10/27/2022, 7:14 PMbastelfreak
10/27/2022, 7:15 PMkelvin
10/27/2022, 7:16 PMkelvin
10/27/2022, 7:34 PMcsharpsteen
10/27/2022, 8:03 PM--cacert still works with the server providing just the leaf when the bundle has a full chain:
# curl -v --cacert $(puppet config print localcacert) https://$(puppet config print server):8140/status/v1/simple
* About to connect() to clspetst-928bbc-0.us-west1-c.c.customer-support-scratchpad.internal port 8140 (#0)
* Trying 10.253.3.252...
* Connected to clspetst-928bbc-0.us-west1-c.c.customer-support-scratchpad.internal (10.253.3.252) port 8140 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/puppetlabs/puppet/ssl/certs/ca.pem
CApath: none
* NSS: client certificate not found (nickname not specified)
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* subject: CN=clspetst-928bbc-0.us-west1-c.c.customer-support-scratchpad.internal
* start date: Oct 25 18:40:37 2022 GMT
* expire date: Oct 22 18:40:39 2037 GMT
* common name: clspetst-928bbc-0.us-west1-c.c.customer-support-scratchpad.internal
* issuer: CN="Puppet Enterprise CA generated at +2022-10-26 18:39:34 +0000"
> GET /status/v1/simple HTTP/1.1
> User-Agent: curl/7.29.0
> Host: clspetst-928bbc-0.us-west1-c.c.customer-support-scratchpad.internal:8140
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 27 Oct 2022 20:03:21 GMT
< Content-Type: text/plain;charset=utf-8
< Vary: Accept-Encoding, User-Agent
< Content-Length: 7
<
* Connection #0 to host clspetst-928bbc-0.us-west1-c.c.customer-support-scratchpad.internal left intactkelvin
10/27/2022, 9:35 PM