Chef Compliance
Chef Compliance assesses your systems against CIS Benchmarks and DISA STIGs, and corrects the configuration behind what fails. It does this the Chef Way: every compliance requirement becomes code that you can run, review, and repeat.
The Chef Way
The Chef Way treats a compliance requirement as code, so you don’t check by hand or track results in a spreadsheet:
- A control states one requirement.
- A profile groups the controls for a benchmark or a system.
- A run produces a result that you can act on.
Every requirement then follows the same path:
- Audit: Run a Chef InSpec profile, which reports a pass, fail, or skip for each requirement.
- Correct: Fix what fails with Chef remediation content or your own change, or record a waiver if you accept the failure.
- Confirm: Run the same profile again to prove the result.
- Repeat: Schedule the assessment, so drift shows up as a control that starts failing.
Follow the Chef Way
Choose the path that matches what you need to do:
| If you want to | Start with |
|---|---|
| Learn Chef InSpec with a working example | The Chef Way of SSH compliance |
| Assess the configuration of an AWS account | The Chef Way of AWS compliance |
| Check a requirement that no benchmark covers | The Chef Way of custom compliance checks |
| Use a published CIS Benchmark or DISA STIG | Find your platform |
| Solve a specific fleet problem | Common compliance scenarios |
Published audit profiles and remediation cookbooks are part of Chef Premium Content. Licensed users get them through a monthly delivery email and Chef Automate. For details, see get the profiles and cookbooks.
Compliance audit
An audit shows whether your systems meet a benchmark’s requirements and identifies settings that need attention. Chef InSpec can also inspect data in a database and the configuration of virtual resources through their APIs, so assessment isn’t limited to systems you can sign in to.
How you run an assessment
You can use more than one approach in the same fleet:
| Approach | Fits | How it runs |
|---|---|---|
| Compliance Phase | Nodes already managed by Chef Infra Client | As part of a Chef Infra Client run |
| Scan jobs in Chef Automate | Nodes and cloud accounts, including systems without an agent | Now, at a scheduled time, once, or on a recurring interval |
| Chef InSpec directly | Ad hoc checks, local development, and pipeline stages | Locally, or over SSH or WinRM |
Results and evidence
Compliance reporting in Chef Automate shows results by node, profile, and control. You can filter the results and download them as dated JSON or CSV. If you accept a failing control, record it as a waiver so it doesn’t remain an unexplained failure.
Compliance remediation
Remediation content is delivered as Chef Infra cookbooks that correct the configuration behind a failed requirement. Chef Infra Client changes only what differs from the desired state, so re-running a cookbook on a correctly configured system changes nothing.
Audit and remediation content are built from the same published benchmark, but Chef tracks coverage for them separately. A benchmark may have audit content, remediation content, or both, and the available versions may differ. An audit version doesn’t guarantee that a matching remediation version is available.
Before you use remediation content
Check the following before you run remediation content:
- Coverage: Remediation coverage is narrower than audit coverage, so confirm that your benchmark version is covered on its platform page.
- Entitlement: Remediation content is part of Chef Premium Content.
- Updates: Benchmarks are revised, and remediation content changes to follow them.
- Testing: Remediation content changes system configuration, so test it as you would any cookbook, using Chef Workstation.
Common compliance scenarios
Each of the following scenarios describes a problem and the Chef Way to solve it. If you haven’t run Chef InSpec before, start with The Chef Way of SSH compliance, because the same mechanics apply to each scenario.
Assess a Linux fleet against CIS Benchmarks
The problem: You run many Linux systems across several distributions and releases, and you need to show that they meet CIS Benchmark requirements.
The Chef Way:
- Confirm that the benchmark versions you need are covered in Operating Systems.
- Get the profiles from Chef Automate or your monthly delivery email.
- Run one assessment by hand, so you can read the output and recognize a real finding.
- Turn on the Compliance Phase, so assessment runs with each Chef Infra Client run.
- Review results by node, profile, and control in compliance reporting.
Assess Windows environments against security baselines
The problem: Your fleet spans several Windows Server releases and client builds, and each one has a different security baseline.
The Chef Way:
- Find your releases on the Windows Server and Windows pages, and check each one separately.
- Get the matching profiles from Chef Automate or your monthly delivery email.
- For nodes running Chef Infra Client, turn on the Compliance Phase.
- For nodes without an agent, add node credentials for WinRM, and then create a scan job.
- Filter reporting by platform, so you can review each release separately.
To run a profile directly, follow The Chef Way of SSH compliance with a winrm:// target instead of ssh://.
See the Chef InSpec CLI reference.
Find compliance gaps in databases
The problem: Database configuration is in scope for your compliance requirements, but another team manages it with different tooling.
The Chef Way:
- Check which benchmarks are covered in Databases.
- Get the matching profiles from Chef Automate or your monthly delivery email.
- Where a requirement depends on data, query the running instance with a resource such as
postgres_session,mysql_session, ororacledb_session. These resources need a database account with permission to run the query. - For requirements that no benchmark covers, see The Chef Way of custom compliance checks.
- Use deep filtering in compliance reporting to report on one database profile or control.
Assess the configuration of a cloud account
The problem: Your cloud accounts hold storage, networks, and identities that nobody assesses on a schedule.
The Chef Way:
- Work through The Chef Way of AWS compliance, which builds and runs an example profile for S3, IAM, and security groups.
- Check whether a published benchmark covers your requirement in Cloud.
- Extend the profile to other services with the AWS resource pack.
- Add an AWS API node manager in node integrations, and then create a recurring scan job for the account.
- Assess the servers in the account separately, using the benchmarks in Operating Systems.
Address controls that keep failing across your fleet
The problem: The same controls fail on many systems in every assessment, and fixes aren’t applied consistently.
The Chef Way:
- Use the control failure data in compliance reporting to see which requirements fail most often.
- Check whether remediation content covers that benchmark on its platform page.
- Where it’s covered, get the cookbook, and then apply it as you would any cookbook, after you complete the checks in Before you use remediation content.
- Reassess with the same audit content, as shown in Fix the finding and reassess in the SSH compliance page.
- Where you accept a failure, record it as a waiver.
Maintain compliance across a mixed fleet
The problem: Your fleet spans on-premises servers, cloud accounts, desktops, databases, and containers, and each one has its own benchmark and process.
The Chef Way:
- Identify what each class of system needs with find your platform.
- For nodes running Chef Infra Client, turn on the Compliance Phase.
- For cloud accounts and systems without an agent, add node credentials, and then create recurring scan jobs.
- For requirements that need resource packs, such as Kubernetes clusters, see The Chef Way of custom compliance checks.
- Send results from each class of system to compliance reporting.
Prepare for a compliance assessment
The problem: An assessment is scheduled, and you need to show what was checked, against which benchmark, with what result, and which exceptions you accepted.
The Chef Way:
- Record accepted failures as waivers before the assessment, so each one has a justification and expiration date. See Waive an exception you’ve accepted in the SSH compliance page and the waivers reference.
- Filter compliance reporting to the systems and benchmarks in scope, and select the reporting date.
- Export the filtered results as JSON or CSV.
- Check that each failing control in scope is either remediated or waived.
Supported compliance standards and platforms
Chef publishes audit and remediation content built on the CIS Benchmarks and DISA STIGs. Chef Premium Content lists each supported platform, what its benchmarks check, and the audit and remediation versions available for it.