The Puppet Server Is a Powerful Target
Puppet runs as root on every node. Whoever controls the Puppet code or the Puppet server can run commands as root on all servers. So protect it like your most sensitive system.
| Asset | What an attacker gains |
|---|---|
| CA private key | Can create valid certificates and impersonate any node or server |
| Puppet code repository | Can change what runs as root everywhere |
| Puppet Server host | Can read all data in Hiera, decrypt eyaml, change catalogs |
| r10k or CI credentials | Can deploy any code to production |
| PuppetDB | Reads facts, inventory and report data about the whole estate |
1. Harden the Server Host
- Run only Puppet Server and its dependencies on that machine
- Keep the OS patched and use the same hardening profile you apply to others
- Limit SSH access to a few administrators, using keys and MFA or a bastion
- Enable disk encryption, because the CA key and eyaml keys are on disk
- Allow network access to port 8140 only from your server networks, and port 8081 (PuppetDB) only from the Puppet servers
- Keep Puppet Server and its Java runtime on supported, updated versions
2. Protect the CA
- Back up the CA directory (
/etc/puppetlabs/puppetserver/ca) encrypted and offline - Use an intermediate CA signed by a corporate root so you can replace the Puppet CA if needed (
puppetserver ca import) - Do not use
autosign = true. Use policy-based autosign with a secret - Revoke certificates of decommissioned or compromised nodes:
puppetserver ca revoke - Watch for unexpected certificate requests
3. Access Control: auth.conf
Puppet Server decides who may call each API using **auth.conf** rules. The defaults are safe. Be careful if you widen them, for example to allow remote catalog compile or CA operations.
The line allow: "$1" means a node can fetch only the catalog with its own name. This stops one compromised node from reading another node's catalog (and the data in it).
4. Trust the Certificate, Not the Fact
- Use
$trusted['certname']and$trusted['extensions']for security decisions, not self-reported facts like$facts['hostname'] - Do not put secrets in catalogs that go to nodes that should not see them. Remember that everything compiled into a node's catalog is readable by that node (and its root user)
- Use per-environment and per-role data so a web server cannot get database passwords
5. Protect the Code Supply Chain
| Risk | Control |
|---|---|
Someone pushes bad code to production | Protected branches, required pull request reviews, at least one reviewer, status checks (lint, tests, noop diff) |
| Stolen developer account | MFA on Git, signed commits or tags, short-lived tokens |
| Malicious or broken Forge module update | Pin exact versions in the Puppetfile, review changes on upgrade, prefer Supported and Approved modules and trusted maintainers |
| Typosquatted module name | Check the author prefix and download counts, copy names from official docs |
| Secrets committed to Git | Pre-commit and CI secret scanning (gitleaks, trufflehog), use eyaml or a vault |
| CI/CD system compromise | Least-privilege deploy tokens, separate deploy credentials per environment, audit logs |
Unreviewed exec or shell code | Review rules: any exec, curl | sh, or download resource needs a checksum and a reason |
6. Least Privilege on Agents
- Do not run the agent as a normal user unless needed. It needs root to change the system
- Do not give application teams permission to edit
productiondirectly. Let them submit pull requests - For tasks that need broad rights, use Bolt with sudo rules and an audit log
- Keep agent data readable only by root (
/etc/puppetlabs/puppet/ssl/private_keys)
7. Logging and Detection
- Ship
puppetserver.logand the access log to your log system - Alert on: new certificate requests,
ca revoke/signactions, changes inauth.conf, many failed catalog requests, a node requesting another node's catalog - Watch corrective changes in reports. They show manual tampering
- Alert if a node has not reported for many intervals
8. Backup and Recovery
Write down and test a rebuild procedure: new server, restore CA and keys, deploy code with r10k, agents reconnect. Practise it before you need it.
9. If You Suspect a Compromise
- Isolate the Puppet server from the network if it is affected, and alert your security team
- Disable Puppet agent runs on affected nodes:
puppet agent --disable 'incident'(via Bolt or SSH) - Review recent Git commits, deploy logs and CI jobs for unexpected changes
- Revoke affected certificates and rotate the CA if its key may have leaked
- Rotate all secrets stored in Hiera, eyaml keys, and credentials used by Puppet
- Rebuild the server from a clean image and restore from known good backups
- Re-enable agents in waves after verification
Security Checklist
| Item | Done? |
|---|---|
Policy autosign (not true) | |
| Branch protection and reviews on the control repo | |
| Exact version pins for all modules | |
| Secrets in eyaml or vault, none in plain text | |
| Port 8140 limited by firewall | |
| CA and eyaml keys backed up encrypted offline | |
| Decommissioning removes certificates | |
| Server log monitoring and alerts | |
| Regular patching of server, PuppetDB and Java | |
| Rebuild procedure tested |
Practice Tasks
- Limit port 8140 in your lab firewall to the agent network and test an agent outside it
- Review your
auth.confand explain what one rule does - Add branch protection and a required review to your lab Git repository
- Add a secret scanning job to your CI pipeline and test it with a fake password
- Write a one-page recovery plan for a lost Puppet server
Conclusion
The Puppet server and repository are root-level control points. Protect the CA, limit network access, review all code, pin modules, keep secrets encrypted, trust certificates for decisions, and rehearse backup and recovery.

