A configuration management tool runs privileged code on every node it manages, so its control node, its agent trust, its encrypted variables and its run logs are worth more to an attacker than any single server it configures. This guide is about running that tool safely day to day once it is in production. It covers the people and roles that operate it, the control node or server, the credentials it uses to reach nodes, the certificate authority that pull agents trust, the secrets it decrypts at run time, the logs and reports it produces, and how to keep all of that healthy through upgrades and retirement. It is written for infrastructure and platform engineers, security architects and the service owner. It is vendor-neutral and applies to agentless tools that push changes over SSH or WinRM and to agent-based tools whose agents pull from a server: confirm exact setting names in your own product's documentation.
Design and first rollout are covered in the Configuration management tool rollout playbook, and response to a breach in If your configuration management tool is compromised. To measure the controls on this page every quarter, use the Configuration management tool health check.
Key takeaways
- Treat the tool as a deployment system an attacker would love to own. MITRE ATT&CK T1072 Software Deployment Tools records adversaries using exactly this class of software for execution and lateral movement across an estate.
- Restrict what each node credential can do, not only who holds it. Source restrictions, scoped privilege escalation and per-zone accounts turn a stolen controller key into a contained incident.
- The agent certificate authority is a root of trust. Protect its private key like a PKI root, keep enrolment tied to the asset inventory and prove that revocation actually stops a node from receiving configuration.
- Decryption keys must never sit beside the ciphertext. Encrypted variables are only as strong as the place their key lives; keep keys per environment and prefer run-time lookups from a secrets manager.
- Run output is sensitive data. Reports, logs and node facts often contain secrets and configuration detail, so redact at source, restrict who reads them and ship the audit trail off the control node.
Why the tool itself is the target
Every configuration management tool, whatever its architecture, concentrates four things in one place: the authority to change any managed node, credentials that are accepted as privileged on those nodes, a store of encrypted secrets that the tool can decrypt, and a complete description of how the estate is built. ATT&CK T1072 notes that access to deployment and configuration software can give an adversary remote code execution on every connected system. The same tool also exposes the credentials adversaries look for under T1552.001 Credentials In Files and T1552.004 Private Keys, and its push channel is a ready-made path for T1021.004 SSH.
The NSA and CISA Defending CI/CD Environments guidance applies directly, because a configuration repository with an automated apply step is a pipeline: minimise long-term credentials, separate duties, require two-person review, sign and verify what is deployed, and keep audit logs that record who committed, reviewed and deployed what. The OWASP Top 10 CI/CD Security Risks name the same weaknesses: CICD-SEC-2 Inadequate Identity and Access Management, CICD-SEC-6 Insufficient Credential Hygiene, CICD-SEC-7 Insecure System Configuration and CICD-SEC-10 Insufficient Logging and Visibility.
| Component | What it holds | What an attacker gains | Primary control on this page |
|---|---|---|---|
| Control node or server | Node credentials, decryption keys, inventory, job history | Code execution on every node in scope | Dedicated hardened host, admin separation, no shared logins |
| Web console and API | Job templates, stored credentials, schedules, tokens | Ability to launch runs or ad hoc commands at scale | Single sign-on, role scoping per inventory, short-lived tokens |
| Node credentials (push) | SSH private keys or certificates, WinRM accounts, escalation rights | Direct privileged logins that bypass the tool | Source and command restrictions, scoped escalation, rotation |
| Agent certificate authority (pull) | CA private key, signed node certificates, revocation list | Rogue nodes that receive configuration, or impersonation of the server | Key protection, enrolment policy, tested revocation |
| Encrypted variables and lookups | Ciphertext, decryption keys, secrets manager identity | Every secret the tool deploys | Per-environment keys, run-time lookup, redaction |
| Reports, facts and logs | Run output, node facts, change history | Secrets leaked in output, a map of the estate, a way to hide changes | Redaction, access control, off-host shipping |
Admin roles and separation of duties
Most consoles let you scope permissions by organisation, team, inventory, credential and job template. Use that scoping so that no everyday role can change what the tool trusts. NIST SP 800-53 CM-5 Access Restrictions for Change and AC-6(5) Privileged Accounts are the controls to cite.
| Role | Should be able to | Should not be able to |
|---|---|---|
| Platform administrator (two to four named people) | Upgrade the tool, manage authentication settings, manage the CA and encryption keys | Merge their own changes to production code; use these accounts for daily work |
| Credential custodian | Create and rotate stored node and cloud credentials | Read secret values back from the console once stored; launch production runs |
| Code author | Change roles, modules and variables through pull requests | Edit job templates, schedules, credentials or runner settings |
| Production operator | Launch approved job templates against production inventories | Run ad hoc commands against production, edit the template being launched |
| Auditor | Read job history, configuration and audit logs | Read secret values or launch anything |
- Disable ad hoc command execution in production: one-off commands run as the privileged account bypass code review entirely. Where the feature is needed for incidents, gate it behind a separate role and alert on every use.
- Separate administrator accounts: platform administrators use dedicated admin accounts from privileged access workstations, with phishing-resistant MFA through single sign-on. Keep one vaulted local break-glass account and test it; see the Break-Glass Account Guide.
- API tokens: issue tokens to named machine identities, scope them to one team or inventory, set an expiry, and review them with the same cadence as admin accounts. A personal token used by a pipeline leaves with its owner.
The control node: hardening and isolation
The control node, whether a single controller, a cluster or a set of execution nodes, should be a dedicated host built from your own baseline with nothing else on it. Treat it as a tier zero system in the same class as directory servers. The day-two controls that matter most:
- One control plane per trust zone: separate controllers, or at least separate execution nodes and credentials, for production, non-production and regulated segments. A run from the development controller should not be able to reach a payment or OT node.
- Inbound access: the console and API reachable only from the management network and privileged access workstations; never expose them to the internet. Agents reach only the server's agent port.
- Outbound access: allow only managed node ranges, the code repository, the secrets manager, package mirrors and the log pipeline. An egress allow list stops a malicious role from sending decrypted secrets to the internet.
- No shared interactive logins: engineers should not log on to the control node to run the tool from a shell with the service account's keys. Runs go through the console or the pipeline, so they are attributed and logged.
- Execution isolation: where the tool supports isolated execution environments or containers per job, use them, so one job cannot read another team's credentials from disk or memory.
- Patching: apply the vendor's security updates to the server, the agents and the execution environments on a defined cycle, and keep agent versions in the asset inventory. Defending CI/CD Environments calls for updating CI/CD tools on a regular schedule and removing applications that are not needed.
- Backups: back up configuration, the CA and encryption keys offline and separately from job history, encrypt the backup, and test a restore to an isolated host (CP-9 System Backup).
Where identity fits: node credentials for push tools
The controller's node credentials are one of the most powerful non-human identities in the estate. NIST IR 7966, Security of Interactive and Automated Access Management Using Secure Shell (SSH), gives the clearest guidance for the SSH case, and most of it applies to WinRM accounts too.
- Restrict where the key can be used from: IR 7966 recommends source restrictions on automated keys, illustrated by the
from=option in the authorized keys file, so a copied private key fails from anywhere except the controller's addresses. - Lock down authorized keys: IR 7966 recommends moving authorized keys to root-owned locations and configuring the SSH server to read only from there, so a compromised account cannot add its own key (the persistence pattern in ATT&CK T1098.004 SSH Authorized Keys). Your configuration management code can enforce this setting.
- Do not copy the identity key: IR 7966 advises avoiding duplication of identity keys between systems. The controller's private key should exist on the controller and in its offline backup only, never on engineers' laptops.
- Rotate on schedule and on staff change: IR 7966 recommends a maximum lifetime for automated keys and replacing them when compromise is suspected or when the administrator who manages them leaves.
- Log the fingerprint: configure SSH servers to log the key fingerprint for key-based logins, then alert when the controller's key is used from any other source.
- Scope privilege escalation: a management account with unrestricted passwordless sudo, or a domain administrator used over WinRM, turns a controller compromise into a full domain compromise. Use a dedicated account per zone with escalation scoped and logged, and never a domain administrator. See How to find service accounts with Domain Admin rights.
- Certificates where they fit: SSH certificates with short validity remove standing keys from every node, but IR 7966 cautions that without a hardened CA and a record of issued certificates it becomes hard to say who can reach a host. Pick one model per zone and document it. See the SSH Protocol and Certificate Authority Guide and the SSH Key Management Guide.
Agent certificates and the enrolment trust
Pull-based tools run a private certificate authority. Each agent generates a key pair, submits a signing request, and once signed uses its certificate to authenticate to the server and receive its catalogue of configuration. Two failures matter: anyone can get a certificate, or a certificate keeps working after it should not.
| Control | Day-two practice |
|---|---|
| CA private key | Restrict file access to the server process, encrypt backups, consider a hardware security module or an intermediate CA so the root stays offline |
| Enrolment policy | No blanket automatic signing; approve against the asset inventory, or use policy-based signing that checks a pre-shared attribute embedded in the request |
| Node identity | Certificate name matches the inventory name; reject requests with unexpected alternative names |
| Revocation | Revoke and clean the certificate when a node is retired or rebuilt; confirm the server enforces the revocation list |
| Lifetimes and renewal | Set node and CA certificate lifetimes deliberately and plan CA renewal before expiry, since an expired CA stops every agent |
| Server identity | Agents verify the server certificate; never disable verification to fix a connection problem |
Key protection and cryptoperiods follow NIST SP 800-57 Part 1 Rev. 5 and SC-12 Cryptographic Key Establishment and Management. If the agent CA key is ever exposed, every node must be re-enrolled; the steps are in the compromise playbook. Many of the same operational practices apply to an enterprise PKI; see the Internal PKI and certificate authority health check.
Secrets: encrypted variables, keys and run-time lookups
Configuration code needs database passwords, API keys and certificates. Defending CI/CD Environments says never pass secrets in plaintext anywhere in the pipeline and reference them indirectly from a secrets store. There are two common patterns, and both have a weak point.
| Pattern | Weak point | How to run it safely |
|---|---|---|
| Encrypted variables in the repository | The decryption key, often a shared password or key file on the controller and on engineers' machines | One key per environment, held only by the controller and custodians, rotated when a holder leaves; re-encrypt and rotate the secrets themselves after a key exposure |
| Run-time lookup from a secrets manager | The controller's identity to the secrets manager, which can read everything its policy allows | Authenticate with a workload identity or short-lived token, scope read paths per environment and job, alert on reads outside runs |
- Keep secrets out of output: mark tasks that handle secrets so the tool suppresses their values in logs and reports. Without that, a failed task can print a password into job history that dozens of people can read.
- Watch node facts and reports: facts gathered from nodes and stored reports can include environment variables, connection strings and file contents. Limit which facts are collected and stored, and set retention.
- Scan the repository: run secret scanning on every change and on history, so a plaintext key committed and later removed is still found and rotated.
See the Secrets Management Guide and Securing the secrets manager itself.
The tool's own logs
Log the tool as a privileged system, not only as a source of change records. Ship logs off the control node in near real time, so someone who gains admin rights cannot remove the trail (AU-9 Protection of Audit Information). NIST SP 800-92 covers the log management infrastructure itself.
| Event | Alert when |
|---|---|
| Console and API sign-ins, token creation | New admin or token, sign-in from outside the management network |
| Job launches with trigger source | Production run with no linked approved change, run outside a window |
| Ad hoc command execution | Any use against production |
| Credential, template, schedule and role edits | Any change by a non-administrator, or self-approved |
| Certificate requests, signings and revocations | Signing of a name absent from the inventory |
| Secrets manager reads by the controller | Reads with no matching run, or new paths |
| Node-side SSH or WinRM logins by the management account | Source is not the controller |
Retain run output long enough to investigate a slow intrusion, after redaction. See the CIS Control 8 Audit Log Management Guide.
Hardening an existing tool: a phased approach
- Inventory: list controllers, execution nodes, admin and API accounts, stored credentials, encryption keys, the CA, integrations and every node in scope. Reconcile node lists to the asset inventory (CM-8).
- Quick wins: remove internet exposure, turn off blanket automatic signing, remove unused admin accounts and tokens, and disable ad hoc commands for non-administrators. Each of these is reversible by configuration if it breaks a workflow.
- Credentials: add source restrictions to the controller's keys, replace domain administrator accounts, scope escalation and rotate keys. Test on a pilot group in check or dry-run mode first, and keep the old key valid for a short overlap so you can roll back.
- Secrets: split encryption keys per environment, move high-value secrets to run-time lookup, turn on output suppression and purge stored reports that contain secrets.
- Logging: ship all events in the table above to the SIEM and build the alerts. Confirm each alert fires using a test run.
- Prove recovery: restore the controller and CA from backup to an isolated host and confirm a node can converge against it. Record the time taken.
Decision guidance
- Push or pull: push concentrates reusable credentials on the controller, so invest in key restrictions and controller isolation. Pull concentrates trust in the CA and enrolment policy, so invest there. Mixed estates need both sets of controls.
- Encrypted variables or a secrets manager: encrypted variables suit small estates with few secrets and one team. Once several teams, environments or audit requirements exist, run-time lookup gives per-secret access control and an audit trail.
- Small or large: a small estate can run one hardened controller with a vaulted key and a two-person merge rule. A large estate needs controllers per zone, certificates or short-lived credentials, scoped tokens and a dedicated service owner.
Detection and measurement
Use these to show the controls are working; the health check gives formulas and thresholds for a quarterly review.
- Key containment: percentage of node authorized keys for the management account that carry source restrictions.
- Enrolment hygiene: signed agent certificates with no matching inventory record (target zero).
- Revocation lag: median days from node retirement to certificate revocation.
- Secret leakage: job outputs or stored reports found to contain a secret value per quarter (target zero).
- Bypass rate: management account logins on nodes whose source is not the controller (target zero).
- Restore time: hours to restore the controller and CA from backup in the last test.
Framework mapping
| Area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | ATT&CK |
|---|---|---|---|
| Admin roles and change restriction | AC-2, AC-6(5), CM-5 | PR.AA-05 | T1072, T1078 |
| Node credentials | IA-5, IA-5(2), AC-6 | PR.AA-01 | T1552.004, T1098.004, T1021.004 |
| Agent CA and keys | SC-12, IA-5(2) | PR.AA-01 | T1552.004 |
| Secrets and encrypted variables | SC-28, IA-5 | PR.DS-01 | T1552.001 |
| Integrity of applied code | CM-3, CM-14, SI-7(6) | PR.PS-01 | T1072 |
| Logging the tool | AU-2, AU-6, AU-9, AU-12 | PR.PS-04, DE.CM-09 | T1098.004 |
| Inventory, backup and lifecycle | CM-8, CP-9 | ID.AM-08 | None |
In CIS Controls v8.1 the tool sits mainly under Control 4 (Secure Configuration of Enterprise Assets and Software), Control 5 (Account Management), Control 6 (Access Control Management) and Control 8 (Audit Log Management).
Common failure patterns
- The key that works from anywhere: the controller's private key has no source restriction and a copy lives on an engineer's laptop, so a stolen laptop is root on the fleet.
- Automatic signing left on after rollout: enrolment was opened for a migration and never closed, so any host that can reach the server can join and receive configuration.
- The decryption key in the same repository: encrypted variables are committed alongside the key file or a shared password in a README.
- Secrets in job history: a failed task prints a password, and job history is readable by every operator.
- Logs only on the controller: the only record of who ran what sits on the host an attacker now controls.
- Retired tool, live keys: the old tool's keys stay in authorized keys files across the estate years after it was replaced.
Practitioner checklist
- Scope console roles so authors, operators, custodians and administrators are separate, and disable ad hoc commands in production.
- Run a dedicated, isolated control plane per trust zone with ingress and egress allow lists.
- Add source restrictions to the management keys, lock authorized keys to root-owned paths and log fingerprints.
- Replace domain administrator run accounts and scope privilege escalation per zone.
- Protect the agent CA key, turn off blanket automatic signing and test revocation every quarter.
- Use one encryption key per environment, move high-value secrets to run-time lookup and suppress secrets in output.
- Ship console, job, enrolment and secrets manager events off the control node and alert on bypasses.
- Back up the controller, CA and keys offline and test a restore.
- On node or tool retirement, revoke certificates and remove keys everywhere.
Standards and references
- NIST: IR 7966, Security of Interactive and Automated Access Management Using Secure Shell (SSH)
- NSA and CISA: Defending Continuous Integration/Continuous Delivery (CI/CD) Environments
- MITRE ATT&CK: T1072 Software Deployment Tools
- NIST: SP 800-57 Part 1 Rev. 5, Recommendation for Key Management
- NIST: SP 800-92, Guide to Computer Security Log Management
- NIST: SP 800-53 Rev. 5, Security and Privacy Controls
- OWASP: Top 10 CI/CD Security Risks
- CIS: Control 4, Secure Configuration of Enterprise Assets and Software
Related NHI Mgmt Group resources: Configuration management tool health check · Ansible and AWX Security Guide · Puppet and Chef Security · NIST SP 800-128 Security-Focused Configuration Management Guide · How to Find ssh authorized keys across a server fleet