SlideShare a Scribd company logo
INSPEC
OR HOW TO TRANSLATE COMPLIANCE
SPREADSHEETS INTO CODE
Created by   /   / Michael Goetz mpgoetz@chef.io @michaelpgoetz
WHO AM I?
Michael Goetz
Solutions Engineering Manager @ Chef
mpgoetz@chef.io
@michaelpgoetz
WHAT IS INSPEC?
WHY NOT SERVERSPEC?
Additional metadata (impact, title, description)
make it easier to describe & share controls
Focusing on multi-platform support (Windows,
Docker, Linux)
A command line interface (CLI) is required for
faster iteration of test code.
COMPLIANCE IS EVERYWHERE
DoD Security
Technical
Implementation
Guides (STIG)
Payment Card
Industry Data
Security
Standards (PCI)
Sarbanes-
Oxley
(SOX)
Health Information
Technology for
Economic and
Clinical Health
(HITECH)
Health Insurance
Portability and
Accountability
Act of 1996
(HIPAA)
Center
for
Internet
Security
(CIS)
SPREADSHEET
PDF
XML
<Rule id="usgcb-rhel5desktop-rule-2.2.2.5.d" selected="false" weight="10.0"
<status date="2011-09-30">accepted</status>
<version update="1"/>
<title override="0">CCE-15087-0:Disable Mounting of hfs</title>
<description override="0"> Using the install command inside /etc/modprobe.conf
the kernel module loading system to run the command speciï¬​ed (here,
/bin/true) instead of inserting the module in the kernel as normal. This
effectively prevents usage of these uncommon ï¬​lesystems.</description
<ident system="http://cce.mitre.org">CCE-15087-0</ident>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" selector
<check-content-ref href="usgcb-rhel5desktop-oval.xml" name="oval:gov.nist.usg
</check>
</Rule>
ANATOMY OF A CONTROL
describe sshd_config do
its('Port') { should eq('22') }
end
describe is a block that contains at least one test
sshd_config is an InSpec resource
ANATOMY OF A CONTROL
control 'sshd-8' do
impact 0.6
title 'Server: Configure the service port'
desc '
Always specify which port the SSH server should listen to.
Prevent unexpected settings.
'
describe sshd_config do
its('Port') { should eq('22') }
end
end
'sshd-8' is the name of the control
control must contain at least one describe block
impact, title, and desc define metadata to
describe the control
PROFILES
inspec.yml - the profile description (required)
controls - contains all tests (required)
libraries - contains InSpec resource extensions
(optional)
PROFILE MANIFEST
name: profile
title: InSpec Example Profile
maintainer: Chef Software, Inc.
copyright: Chef Software, Inc.
copyright_email: support@chef.io
license: Apache 2 license
summary: Demonstrates the use of InSpec Compliance Profile
version: 1.0.0
supports:
- os-family: linux
name - Identifier of the profile (required)
Profiles can also be included in other profiles by
referring to the name.
PROFILE OS SUPPORT
supports:
// Runs on any version of Debian Linux
- os-name: debian
// Only runs on Ubuntu 14.04
- os-name: ubuntu
release: 14.04
// Targets RedHat, CentOS, Oracle Linux ...
- os-family: redhat
Restrict your profiles to only support targeted
operating systems.
PROFILE INHERITANCE
include_controls 'cis-level-1' do
skip_control "cis-fs-2.1"
skip_control "cis-fs-2.2"
control "cis-fs-2.7" do
impact 1.0
...
end
Include all controls from external profiles and skip
specific controls if necessary.
PROFILE CONTROL INCLUSION
require_controls 'cis-level-1' do
control "cis-fs-2.1"
control "cis-fs-2.2"
end
If you just need a few controls from a profile, you
can require just specific controls.
PROFILE VALIDATION &
DISTRIBUTION
$ inspec check examples/profile
Check your profile syntax with the inspec check
command.
# will generate a example-profile.tar.gz
$ inspec archive examples/profile
# will generate a example-profile.zip
$ inspec archive examples/profile --zip
Package and redistribute using gzip, bzip2, or xz
CUSTOM RESOURCES
Just like Chef, you can define your own custom
InSpec resources if you need them.
require 'yaml'
class GordonConfig < Inspec.resource(1)
name 'gordon_config'
def initialize
@path = '/etc/gordon/config.yaml'
@file = inspec.file(@path)
return skip_resource "Can't find file "#{@path}"" if !@file.file?
@params = YAML.load(@file.content)
end
def method_missing(name)
@params[name.to_s]
end
end
Include them in libraries folder in your profiles.
RUNNING INSPEC TESTS
Local
Remote via SSH
Remote via WinRM
Docker, Docker, Docker
inspec exec test.rb
inspec exec test.rb -t ssh://user@hostname
inspec exec test.rb -t winrm://Administrator@windowshost --password 'password'
inspec exec test.rb -t docker://container_id
VISUALIZE RESULTS WITH CHEF
COMPLIANCE
DEMO
MORE INFORMATION
The Road to InSpec -
InSpec - 
InSpec Reference -
https://www.chef.io/blog/2015/11/04/the-road-
to-inspec/
https://github.com/chef/inspec
https://docs.chef.io/inspec_reference.html
THANK YOU!
What questions do you have?

More Related Content

PDF
ISO.IEC_27001-27002-2013 Topology
Jason Rusch - CISSP CGEIT CISM CISA GNSA
 
PPTX
VMware vRealize Operations Management Pack | Nagios
Blue Medora
 
PDF
Qubole on AWS: Security and Compliance - White Paper | Qubole
Vasu S
 
PDF
2016 - Compliance as Code - InSpec
devopsdaysaustin
 
PPTX
Compliance Automation with Inspec Part 2
Chef
 
PPTX
Compliance Automation with Inspec Part 1
Chef
 
PDF
Chef compliance - Intermediate Training
Sarah Hynes Cheney
 
PPTX
Compliance Automation with Inspec Part 3
Chef
 
ISO.IEC_27001-27002-2013 Topology
Jason Rusch - CISSP CGEIT CISM CISA GNSA
 
VMware vRealize Operations Management Pack | Nagios
Blue Medora
 
Qubole on AWS: Security and Compliance - White Paper | Qubole
Vasu S
 
2016 - Compliance as Code - InSpec
devopsdaysaustin
 
Compliance Automation with Inspec Part 2
Chef
 
Compliance Automation with Inspec Part 1
Chef
 
Chef compliance - Intermediate Training
Sarah Hynes Cheney
 
Compliance Automation with Inspec Part 3
Chef
 

Viewers also liked (20)

PPTX
Compliance Automation with Inspec Part 4
Chef
 
PDF
Validation driven change
Michael Goetz
 
PPTX
Introduction to InSpec and 1.0 release update
Alex Pop
 
PDF
Compliance Automation Workshop
Chef
 
PDF
Intermediate/Compliance training Guide
Chef
 
KEY
Infrastructure Automation with Chef
Adam Jacob
 
PDF
Managing Complexity at Velocity
Matt Ray
 
PDF
Devops Done Us Wrong
Shaun Mouton
 
PDF
OpenStack Deployments with Chef
Matt Ray
 
PPTX
Vagrant and chef
Nick Ramirez
 
PDF
Compliance as Code with InSpec - DevOps Melbourne 2017
Matt Ray
 
PPTX
Successful Practices for Continuous Delivery CodeCPH
Mandi Walls
 
PDF
Our DevOps Journey - An Exercise in Cultural Change
Chef
 
PDF
Nike popup compliance workshop
Chef
 
PPTX
London Community Summit - Chef at SkyBet
Chef
 
PPTX
Collection development policy and procedures
wholkesvig
 
PPT
Inspec
Saeid Nezareh
 
PPT
Inspec2
Saeid Nezareh
 
PPTX
Security as Code
Ed Bellis
 
PPT
4 Essential Elements of a Collection Policy
IC System
 
Compliance Automation with Inspec Part 4
Chef
 
Validation driven change
Michael Goetz
 
Introduction to InSpec and 1.0 release update
Alex Pop
 
Compliance Automation Workshop
Chef
 
Intermediate/Compliance training Guide
Chef
 
Infrastructure Automation with Chef
Adam Jacob
 
Managing Complexity at Velocity
Matt Ray
 
Devops Done Us Wrong
Shaun Mouton
 
OpenStack Deployments with Chef
Matt Ray
 
Vagrant and chef
Nick Ramirez
 
Compliance as Code with InSpec - DevOps Melbourne 2017
Matt Ray
 
Successful Practices for Continuous Delivery CodeCPH
Mandi Walls
 
Our DevOps Journey - An Exercise in Cultural Change
Chef
 
Nike popup compliance workshop
Chef
 
London Community Summit - Chef at SkyBet
Chef
 
Collection development policy and procedures
wholkesvig
 
Inspec2
Saeid Nezareh
 
Security as Code
Ed Bellis
 
4 Essential Elements of a Collection Policy
IC System
 
Ad

Similar to Inspec, or how to translate compliance spreadsheets into code (6)

PPTX
Adding Security to Your Workflow With InSpec - SCaLE17x
Mandi Walls
 
PPTX
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
adamleff
 
PDF
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
NETWAYS
 
PPTX
InSpec Workshop at Velocity London 2018
Mandi Walls
 
PPTX
BuildStuff.LT 2018 InSpec Workshop
Mandi Walls
 
PPTX
InSpec For DevOpsDays Amsterdam 2017
Mandi Walls
 
Adding Security to Your Workflow With InSpec - SCaLE17x
Mandi Walls
 
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
adamleff
 
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
NETWAYS
 
InSpec Workshop at Velocity London 2018
Mandi Walls
 
BuildStuff.LT 2018 InSpec Workshop
Mandi Walls
 
InSpec For DevOpsDays Amsterdam 2017
Mandi Walls
 
Ad

Recently uploaded (20)

PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
The Future of AI & Machine Learning.pptx
pritsen4700
 

Inspec, or how to translate compliance spreadsheets into code