Getting Started with Chef InSpec
I recently evaluated Microsoft Security Compliance Toolkit and Chef InSpec—two Windows-friendly baseline scanners. Here are the essentials for Chef InSpec.
Overview
Chef InSpec is a security baseline scanner from Chef. It supports Windows, macOS, Red Hat, Ubuntu, and more.
This walkthrough focuses on Windows Server.
Download
https://downloads.chef.io/inspec/
You can also follow the GitHub README to install via Ruby gems:
For CentOS / Red Hat / Fedora:
yum -y install ruby ruby-devel make gcc gcc-c++
For Ubuntu:
apt-get -y install ruby ruby-dev gcc g++ make
Then install InSpec:
gem install inspec-bin
Usage
1 | $ inspec --help |
To run an existing baseline, use inspec exec
:
inspec exec https://github.com/dev-sec/windows-baseline
You can point it at profiles shared on GitHub, or download them first:
1 | git clone https://github.com/dev-sec/windows-baseline |
Chef hosts Chef Supermarket for sharing profiles. Browse it to find baselines that fit your needs.
Notes
Version support
Each release of Chef InSpec documents the operating systems it supports. For example, versions 1.50.1 and later drop Windows Server 2008. Individual profiles have their own requirements: the sample windows-baseline
targets Windows Server 2012 R2 and newer. In practice I was able to install Chef InSpec 1, 3, and 4 on Windows Server 2008 R2. Version 1 fails to run the windows-baseline
profile, while versions 3 and 4 report errors but still produce many findings—version 4 surfaces the most.