This message was deleted.
# puppet-enterprise
s
This message was deleted.
j
hey Kelvin, fairly positive this is a feature since the UI cert usually comes from a "normal" trusted CA
b
by default, the console certificate comes from the Puppetserver CA
but you can provide your own certificate
@kelvin you need to import the puppetserver CA cert (and the intermediate) into your truststores
k
I have instructions (and have implemented) custom certificate on 443, but that doesn’t seem to get installed on TCP8140.
j
that's the intended behavior, the cert on 8140 should be from the Puppet CA
k
Well, then clients will not trust it without bypassing trust, which we would prefer not to do
b
you have a few options: • import the CA • use the official Puppet mirrors instead • create your own mirror • setup a proxy on your primary
k
I can certainly supply that certificate to curl, but was hoping to simply add the certificate to the OS trust store on Linux, but Linux processes ignore non-CA certificates. Took me a while to figure it out, because our older puppetserver did not have this issue.
b
you can still import the puppetserver CA
k
Not using linux update-ca-trust processes.
b
which file did you import?
TL;DR The
update-ca-trust
won’t extract your certificate file to the
ca-bundle.crt
unless this succeeds:
Copy code
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.
b
again, you need to import the puppetserver CA cert, not the server certificate from port 8140 🙂
Copy code
# 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:TRUE
k
Yeah, I was shooting toward using a one-time setup.
Hrm. Let me check out the ca_crt.pem file.
That would work hopefully
brb
b
That will work 😄
I do that on a regular basis
j
the default for puppet is to trust at time of first use (ToFU) but you're welcome to distribute the CA ahead of time and manage how you trust the puppet CA
k
The certificate served on TCP8140 is self-signed; it is not issued by any other root ca.
Copy code
X509v3 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:70
Subject Key and Authority Key identifiers are identical.
Essentially the certificate installed on 8140 is a self-signed, non-CA certificate, which Linux will not trust by default (not even sure if I can hack it in, but even so, that’s another hack I don’t want to do). So my only choice at this point is to tell curl to fetch the RPMs from the puppetserver on TCP8140 passing --cacert option for trust:
curl --cacert /etc/pki/ca-trust/source/anchors/puppetserver.crt
c
puppetserver
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.
b
it's technical impossible for Puppet to ship a TLS certificate that matches your configured FQDN and is signed by a trusted CA. Puppetserver by default will create its own CA + intermediate. you can add that to your truststore, or tell curl to trust the certificate, or provide your own intermediate CA to puppetserver
k
This is not the behavior I see on 2021.7
b
which part is different in your environment?
I still have the impression that you mix up a random server certificate, as used on port 8140, with the CA cert that's used to sign server/agent certs
k
I’m doublechecking my sanity here…
b
As I posted above, the ca_crt.pem is indeed a CA. And that's the default setup in PE 2021.7
c
Backing up to the original question:
Discovered 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 certificate
That is the expected behavior and the default configuration going all the way back to PE 3.7.
If port 8140 was returning a certificate with
CA:TRUE
to the TLS handshake, that's something someone would had to have gone out of their way to configure.
It's also expected for the Puppet CA to be missing from the system trust store. Clients that need to communicate with the Puppet API, like the
puppet
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.
k
Ok, I got it figured out I grabbed the wrong certificate out of the /etc/puppetlabs/puppetserver/ca/ca_crt.pem, and yes the cert served on TCP8140 is a leaf certificate signed by the Puppet Root CA:
subject=CN = Puppet Root CA
Trusting the Puppet Root CA on client systems is a bad thing???
c
No, it's a least privilege thing. The
puppet
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.
b
I would say it depends on who trusts it. The Puppet Agent needs to trust the CA. The rest of the Linux system usually doesn't have such a requirement. you can use the install script/repos from the primary. For that usecase, your curl/wget statement needs to trust the CA once. you can add the Puppetserver CA to the local truststore for that, but you don't have to
If you want to download the agent from a location that has a certificate from a known CA, use https://apt.puppet.com/ / https://yum.puppet.com/
k
Ok, then I’ll opt to perform a one-time “use the puppet root CA certificate” to fetch the client RPMs from the puppetserver.
b
The open source and enterprise rpm/debs are the same
k
we are using the puppetserver to source our RPMs for now, matching the version of the server, which gets patched monthly or quarterly (I forget puppet’s patch cadence)
Technically, the cert served on 8140 is a leaf certificate, signed by intermediate “Puppet Enterprise CA” signed by Puppet Root CA. The service on TCP8140 should be serving both the leaf and the intermediate certificate, up to, but not including the Puppet Root CA certificate. This permits me to use curl with --cacert with just the Root CA certificate.
c
--cacert
still works with the server providing just the leaf when the bundle has a full chain:
Copy code
# 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 intact
k
yeah, I guess I’m really just thinking narrowly ala CAB forum that you really only anchor your roots, and TLS services serve the full chain upto, but not including the root.