Hey everyone ! Trying to understand how the Puppet...
# puppet
r
Hey everyone ! Trying to understand how the Puppet CA works. When I'm submitting a new CSR as an agent to the Puppet Master, how is the transaction secured ? Most importantly with which certificate ? As far as I'm aware, the certificate exposed by the Puppet Master server is not signed by a trusted CA by the agent (I think) for now. How does this not fail ?
I'm talking about the part that is happening in the video, between 1:54 and 2:06 if it's easier to understand my question šŸ™‚

https://www.youtube.com/watch?v=cC8b7p0K5psā–¾

Maybe, under the hood, before sending the CSR, the Puppet agent is "getting" the CA from the Puppet Server ? That's the only thing I can think of, but that would be quite big MITM attack vector..
I'd say I'm somewhat right about the reasoning, because without signing the certificate, I still have the CA made available on the agent.
Copy code
root@agent:/etc/puppetlabs/puppet/ssl/certs# ls -al
total 12
drwxr-xr-x 2 root root 4096 Nov 17 17:01 .
drwxrwx--x 7 root root 4096 Nov 17 17:02 ..
-rw-r--r-- 1 root root 1895 Nov 17 17:01 ca.pem
c
Without the server signing the cert (either manually by you or by autosigning), the
ca.pem
is not going to cause any harm. You, as the Puppet administrator, hold the power.
b
And that's why you shouldn't just enable naive autosiging
r
Yes you're right! I think I'm missing something tho. Does a self-signed CA can be used for encryption ? With such workflow : • I get the CA from the server (with, I suppose, a kind of verify=false, ie. do not check the certificate of the server) • And then I do all of the request in a "secured" way because I now trust the CA, as I know it ?
And yeah of course we should not enable auto signing !
c
but that would be quite big MITM attack vector
Ehhh, that depends on the network setup. Puppet commonly runs over an internal management network. If someone can pull a MITM there, then they're in a position to cause all sorts of trouble regardless of whether the initial request for the CA bundle is verified.
šŸ‘ 1
If it is a high concern, the standard mitigation is to distribute
ca.pem
to new nodes via another secured channel. SSH, cloud-init, etc.
r
I see ! So my "workflow" is actually what's happening right ? It's such as small window also so a MITM attack, while possible, is somewhat unrealistic.
Maybe if you get hold of the DNS Zone of the domain, and everything is going through the internet etc.. But the MITM attack is not due to Puppet, but to the lack of security on the lack of management network in that case.
c
Yup. The first time the
puppet
agent interacts with the Server, it will download
ca.pem
if it does not have a copy on file. That is a one-time window where an unverified request is made, all API calls afterwards are verified against
ca.pem
. The window can be eliminated by copying
ca.pem
before starting the
puppet
service.
r
Nice to know! Thank you so much
Thanks everyone who answered too šŸ˜‰
šŸ» 1
šŸ™Œ 1
c
I’ve taken a laid back approach normally to the autosigning. I specify at least the domain, but every node gets a role applied to it. So, if some strange request comes in and I don’t know the FQDN that’s asking but has the right domain, they get our base config which dumps all current configuration and applies a base ā€œunsecuredā€ role. In this way, you may have connected and have control of your own system, but when I get done with it, you no longer have a root pass, you no longer have much of any of your existing configuration, and I set it up into what is essentially a ā€œquarantinedā€ state awaiting either my recognizing and classifying the node, or at the very least getting an alert that I have a new unconfigured node in the fleet.