did you use puppet apply?
# puppet
b
did you use puppet apply?
m
no. But maybe I found the reason. I am using nginx reverse proxy and it uses proxy ssl cert to connect to the puppet backend
b
ah so maybe your puppetserver isn't validating the certificate because nginx terminates it
c
Yep.
$trusted
is populated from the content of the agent's SSL certificate. If SSL is terminated upstream, no certificate is delivered to Puppet Server, and thus no
$trusted
data.
n
Copy code
# Puppet expects the X-Client-Verify, X-Client-DN, and X-Client-Cert
# headers for authentication and trusted facts.
proxy_set_header    X-Client-Verify  $ssl_client_verify;
proxy_set_header    X-Client-DN      $ssl_client_s_dn;
proxy_set_header    X-Client-Cert    $ssl_client_escaped_cert;
Adding these to your Nginx proxy config will allow
$trusted
to work through the proxy.
c
You will have to toggle some settings in the
puppetserver
config for that to work. Also, you will need to run very tight security around port 8140 as having Puppet Server accept those headers means anyone can drop by and just lie about their certificate.
"Hello. Yes, I am production database. Please send configuration with production password."
n
True, thanks for pointing that out Charlie.
c
Puppet really is built around end-to-end TLS. There are ways to shed that requirement, but it does put you firmly off the edge of the map in "here be monsters" territory.
m
So how does puppet server really verify that the TLS connection belongs to a specific node and is valid? He checks that the CA issued its certs and next what?
b
checks if the certificate is signed by the puppet CA, the cert is in the allowed time period, the cert isn't revoked
m
seems this configuration could work(simulating the puppetserver tls verification). Nginx verifies the client and set the headers.
*ssl_verify_client*     optional;
ssl_certificate /etc/puppetlabs/puppet/ssl/certs/puppetserver.pem;
ssl_certificate_key /etc/puppetlabs/puppet/ssl/private_keys/puppetserver.pem;
ssl_client_certificate /etc/puppetlabs/puppet/ssl/certs/ca.pem;
ssl_crl /etc/puppetlabs/puppet/ssl/ca/ca_crl.pem;
b
but do you also have the proxy_set_header?
m
I am just wondering what if the header
X-Client-Verify
will be set to FAILED or NONE. If puppetserver completely relies on this headers,, it should not allow such connection
yes, I do
Seems it is working fine
Error: Could not retrieve catalog from remote server: Error 403 on SERVER: Forbidden request: /puppet/v3/catalog/puppet-agent.com (method :post). Please see the server logs for details.