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

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
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...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Inspec, or how to translate compliance spreadsheets into code