SlideShare a Scribd company logo
1 of 22
Download to read offline
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

Viewers also liked

Collection development policy and procedures
Collection development policy and proceduresCollection development policy and procedures
Collection development policy and procedures
wholkesvig
 
Security as Code
Security as CodeSecurity as Code
Security as Code
Ed Bellis
 

Viewers also liked (20)

Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4
 
Validation driven change
Validation driven changeValidation driven change
Validation driven change
 
Introduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateIntroduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release update
 
Compliance Automation Workshop
Compliance Automation WorkshopCompliance Automation Workshop
Compliance Automation Workshop
 
Intermediate/Compliance training Guide
Intermediate/Compliance training GuideIntermediate/Compliance training Guide
Intermediate/Compliance training Guide
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Managing Complexity at Velocity
Managing Complexity at VelocityManaging Complexity at Velocity
Managing Complexity at Velocity
 
Devops Done Us Wrong
Devops Done Us WrongDevops Done Us Wrong
Devops Done Us Wrong
 
OpenStack Deployments with Chef
OpenStack Deployments with ChefOpenStack Deployments with Chef
OpenStack Deployments with Chef
 
Vagrant and chef
Vagrant and chefVagrant and chef
Vagrant and chef
 
Compliance as Code with InSpec - DevOps Melbourne 2017
Compliance as Code with InSpec - DevOps Melbourne 2017Compliance as Code with InSpec - DevOps Melbourne 2017
Compliance as Code with InSpec - DevOps Melbourne 2017
 
Successful Practices for Continuous Delivery CodeCPH
Successful Practices for Continuous Delivery CodeCPHSuccessful Practices for Continuous Delivery CodeCPH
Successful Practices for Continuous Delivery CodeCPH
 
Our DevOps Journey - An Exercise in Cultural Change
Our DevOps Journey - An Exercise in Cultural ChangeOur DevOps Journey - An Exercise in Cultural Change
Our DevOps Journey - An Exercise in Cultural Change
 
Nike popup compliance workshop
Nike popup compliance workshopNike popup compliance workshop
Nike popup compliance workshop
 
London Community Summit - Chef at SkyBet
London Community Summit - Chef at SkyBetLondon Community Summit - Chef at SkyBet
London Community Summit - Chef at SkyBet
 
Collection development policy and procedures
Collection development policy and proceduresCollection development policy and procedures
Collection development policy and procedures
 
Inspec
InspecInspec
Inspec
 
Inspec2
Inspec2Inspec2
Inspec2
 
Security as Code
Security as CodeSecurity as Code
Security as Code
 
4 Essential Elements of a Collection Policy
4 Essential Elements of a Collection Policy4 Essential Elements of a Collection Policy
4 Essential Elements of a Collection Policy
 

Similar to Inspec, or how to translate compliance spreadsheets into code

NIST CSD Cybersecurity Publications 20160417
NIST CSD Cybersecurity Publications 20160417NIST CSD Cybersecurity Publications 20160417
NIST CSD Cybersecurity Publications 20160417
James W. De Rienzo
 
Build and enforce defense in depth - an algo sec-cisco tetration webinar
Build and enforce defense in depth - an algo sec-cisco tetration webinarBuild and enforce defense in depth - an algo sec-cisco tetration webinar
Build and enforce defense in depth - an algo sec-cisco tetration webinar
AlgoSec
 
gss_windows7_migration_whitepapers
gss_windows7_migration_whitepapersgss_windows7_migration_whitepapers
gss_windows7_migration_whitepapers
Bonani Bhattacharjee
 
Howard Cohen Hampton Roads Incose Chapter Meeting 2010
Howard Cohen Hampton Roads Incose Chapter Meeting 2010Howard Cohen Hampton Roads Incose Chapter Meeting 2010
Howard Cohen Hampton Roads Incose Chapter Meeting 2010
Howard (Howie) Cohen
 

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

NIST_Ignyte_OSCALWorkshop_2022.pdf
NIST_Ignyte_OSCALWorkshop_2022.pdfNIST_Ignyte_OSCALWorkshop_2022.pdf
NIST_Ignyte_OSCALWorkshop_2022.pdf
 
Lock it Down with Nutanix Security
Lock it Down with Nutanix SecurityLock it Down with Nutanix Security
Lock it Down with Nutanix Security
 
NIST CSD Cybersecurity Publications 20160417
NIST CSD Cybersecurity Publications 20160417NIST CSD Cybersecurity Publications 20160417
NIST CSD Cybersecurity Publications 20160417
 
Shahriar nouriresume
Shahriar nouriresumeShahriar nouriresume
Shahriar nouriresume
 
Maintaining Data Privacy with Ashish Kirtikar
Maintaining Data Privacy with Ashish KirtikarMaintaining Data Privacy with Ashish Kirtikar
Maintaining Data Privacy with Ashish Kirtikar
 
Build and enforce defense in depth - an algo sec-cisco tetration webinar
Build and enforce defense in depth - an algo sec-cisco tetration webinarBuild and enforce defense in depth - an algo sec-cisco tetration webinar
Build and enforce defense in depth - an algo sec-cisco tetration webinar
 
CHRISTOPHER HADDON3
CHRISTOPHER HADDON3CHRISTOPHER HADDON3
CHRISTOPHER HADDON3
 
Compliance in the cloud using sb d toronto-summit-v1.0
Compliance in the cloud using sb d toronto-summit-v1.0Compliance in the cloud using sb d toronto-summit-v1.0
Compliance in the cloud using sb d toronto-summit-v1.0
 
2022-Q3-Webinar-PPT-DataProtectionByDesign.pdf
2022-Q3-Webinar-PPT-DataProtectionByDesign.pdf2022-Q3-Webinar-PPT-DataProtectionByDesign.pdf
2022-Q3-Webinar-PPT-DataProtectionByDesign.pdf
 
Painless DevSecOps: Building Security Into Your DevOps Pipeline
Painless DevSecOps: Building Security Into Your DevOps PipelinePainless DevSecOps: Building Security Into Your DevOps Pipeline
Painless DevSecOps: Building Security Into Your DevOps Pipeline
 
Breaking silos between DevOps and SecOps with Elastic
Breaking silos between DevOps and SecOps with ElasticBreaking silos between DevOps and SecOps with Elastic
Breaking silos between DevOps and SecOps with Elastic
 
Evaluating Caching Strategies for Cloud Data Access using an Enterprise Serv...
Evaluating Caching Strategies for Cloud Data Access using an Enterprise Serv...Evaluating Caching Strategies for Cloud Data Access using an Enterprise Serv...
Evaluating Caching Strategies for Cloud Data Access using an Enterprise Serv...
 
gss_windows7_migration_whitepapers
gss_windows7_migration_whitepapersgss_windows7_migration_whitepapers
gss_windows7_migration_whitepapers
 
Har du en DevOps i ditt team?
Har du en DevOps i ditt team?Har du en DevOps i ditt team?
Har du en DevOps i ditt team?
 
Question 6The IT department of a company has just rolled out a vir.pdf
Question 6The IT department of a company has just rolled out a vir.pdfQuestion 6The IT department of a company has just rolled out a vir.pdf
Question 6The IT department of a company has just rolled out a vir.pdf
 
5 principles-securing-devops-veracode-whitepaper
5 principles-securing-devops-veracode-whitepaper5 principles-securing-devops-veracode-whitepaper
5 principles-securing-devops-veracode-whitepaper
 
Redington Value Journal - September 2016
Redington Value Journal - September 2016Redington Value Journal - September 2016
Redington Value Journal - September 2016
 
Howard Cohen Hampton Roads Incose Chapter Meeting 2010
Howard Cohen Hampton Roads Incose Chapter Meeting 2010Howard Cohen Hampton Roads Incose Chapter Meeting 2010
Howard Cohen Hampton Roads Incose Chapter Meeting 2010
 
ATA meetup - Feb 2020 - DevSecOps
ATA meetup - Feb 2020 - DevSecOpsATA meetup - Feb 2020 - DevSecOps
ATA meetup - Feb 2020 - DevSecOps
 
Aws keynote oil and gas calgary industry day - jon guidroz
Aws keynote oil and gas calgary industry day -  jon guidrozAws keynote oil and gas calgary industry day -  jon guidroz
Aws keynote oil and gas calgary industry day - jon guidroz
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Inspec, or how to translate compliance spreadsheets into code