inspec
by inspec
Chef InSpec is an open-source framework for auditing and testing infrastructure compliance, security, and policy requirements using a human- and machine-readable language.
InSpec: Auditing and Testing Framework
Primary Use Case
Chef InSpec is primarily used by security professionals, compliance auditors, and DevOps teams to automate compliance auditing and security testing across various infrastructure environments. It enables users to write and execute tests that validate security policies on local, remote, containerized, and Windows hosts, ensuring continuous compliance and risk assessment.
- Human- and machine-readable language for specifying compliance and security requirements
- Supports running tests locally, remotely via SSH, WinRM, and Docker
- Built-in compliance testing integrated into the development lifecycle
- Targeted tests focusing on specific compliance issues
- Includes metadata required by security and compliance professionals
- Command-line interface for easy and quick test execution
- Open-source with active project maintenance and defined SLA for issues and pull requests
Installation
- Ensure Ruby version >= 3.1.0 is installed
- Accept the Chef InSpec EULA before use
- For MacOS, RedHat, Ubuntu, and Windows, download the latest package from Chef InSpec Downloads or use the install script
- Run the install script for RedHat, Ubuntu, and macOS: curl https://chefdownload-commercial.chef.io/install.sh?license_id=<LICENSE_ID> | sudo bash -s -- -P inspec
- Run the install script for Windows: . { iwr -useb https://chefdownload-commercial.chef.io/install.ps1?license_id=<LICENSE_ID> } | iex; install -project inspec
- Replace <LICENSE_ID> with your actual license ID
- To install via RubyGems with build tools, first install build tools using your package manager (e.g., yum or apt-get)
- For CentOS/RedHat/Fedora: yum -y install ruby ruby-devel make gcc gcc-c++
- For Ubuntu: apt-get -y install ruby ruby-dev gcc g++ make
- Install the inspec executable gem with license acceptance: gem install inspec-bin
Usage
>_ inspec exec test.rbRun a test locally on the current machine
>_ inspec exec test.rb -t ssh://user@hostname -i /path/to/keyRun a test on a remote host via SSH using a private key
>_ inspec exec test.rb -t ssh://user@hostnameRun a test on a remote host via SSH using SSH agent private key authentication
>_ inspec exec test.rb -t winrm://Administrator@windowshost --password 'your-password'Run a test on a remote Windows host via WinRM with password authentication
>_ inspec exec test.rb -t winrm://windowshost --user 'UserName@domain' --password 'your-password'Run a test on a remote Windows host via WinRM as a domain user with password authentication
>_ inspec exec test.rb -t docker://container_idRun a test inside a Docker container
- Integrate InSpec tests into CI/CD pipelines to enforce compliance early in the development lifecycle.
- Use InSpec for continuous compliance monitoring across hybrid and cloud environments to reduce audit overhead.
- Leverage InSpec's human- and machine-readable language to create custom compliance profiles tailored to organizational policies.
- Combine InSpec with configuration management tools like Chef or Ansible for automated remediation workflows.
- Utilize InSpec's remote execution capabilities to perform security assessments on ephemeral infrastructure such as containers and cloud instances.
Docs Take 2 Hours. AI Takes 10 Seconds.
Ask anything about inspec. Installation? Config? Troubleshooting? Get answers trained on real docs and GitHub issues—not generic ChatGPT fluff.
3 free chats per tool • Instant responses • No credit card
Related Tools

unleash
Unleash/unleash
Open-source feature management platform
the-practical-linux-hardening-guide
trimstray/the-practical-linux-hardening-guide
This guide details creating a secure Linux production system. OpenSCAP (C2S/CIS, STIG).
how-to-secure-anything
veeral-patel/how-to-secure-anything
How to systematically secure anything: a repository about security engineering
404StarLink
knownsec/404StarLink
404StarLink - 推荐优质、有意义、有趣、坚持维护的安全开源项目
steampipe
turbot/steampipe
Zero-ETL, infinite possibilities. Live query APIs, code & more with SQL. No DB required.
Security-101
microsoft/Security-101
8 Lessons, Kick-start Your Cybersecurity Learning.
