Continuous Auditing with
Compliance as Code
DevOpsDays Singapore
October 26, 2017
Matt Ray
Manager/Solutions Architect – APJ
Chef Software
matt@chef.io
@mattray
Software Defined Talk
Chef Workflow
SSH Control
"SSH supports two different protocol versions. The
original version, SSHv1, was subject to a number of
security issues. Please use SSHv2 instead to avoid these."
How will I verify this?
Whip up a one-liner!
grep "^Protocol" /etc/ssh/sshd_config | sed 's/Protocol //'
Apache Server Information Leakage
• Description
This Directive Controls wheather Server response field is sent back to clients includes a description of Generic OS
Type of the Server.
This allows attackers to identify web servers details greatly and increases the efficiency of any attack,as security
vulnerabilities are dependent upon specific software versions.
• How to Test
In order to test for ServerToken configuration, one should check the Apache configuration file.
• Misconfiguration
ServerTokens Full
• Remediation
Configure the ServerTokens directive in the Apache configuration to value of Prod or ProductOnly. This tells
Apache to only return "Apache" in the Server header, returned on every page request.
ServerTokens Prod
or
ServerTokens ProductOnly
https://www.owasp.org/index.php/SCG_WS_Apache
More grep and sed!
grep "^ServerTokens" /etc/httpd/conf/httpd.conf | sed 's/ServerTokens //'
Passed the Audit
C
o
m
p
l
i
a
n
c
e
“Two-thirds of organizations did
not adequately test the security
of all in-scope systems”
Key Trends
• While individual rule
compliance is up, testing of
security systems is down
• Sustainability is low. Fewer
than a third of companies
were found to be still fully
compliant less than a year
after successful validation.
Security != Compliance
Security Theater
Shell Scripts
grep "^Protocol" /etc/ssh/sshd_config | sed 's/Protocol //'
grep "^ServerTokens" /etc/httpd/conf/httpd.conf | sed 's/ServerTokens //'
Infrastructure Code
package 'httpd' do
action :install
end
service 'httpd' do
action [ :start, :enable ]
end
We Have A Communications Problem
Compliance Language
One Language
Linux, Windows
Windows
One Language
Linux, Windows, MacOS, Solaris, AIX, ...
Examples of Available Resources
apache_conf
apt
audit_policy
auditd_conf
auditd_rules
bond
bridge
command
crontab
directory
etc_group
file
gem
group
host
inetd_conf
interface
iptables
kernel_module
kernel_parameter
limits_conf
login_defs
mount
mysql_conf
mysql_session
npm
ntp_conf
oneget
os
os_env
package
parse_config
parse_config_file
passwd
pip
port
postgres_conf
postgres_session
powershell
processes
registry_key
security_policy
service
ssh_config
sshd_config
user
windows_feature
yum
What is it not?
• IDS / IPS
• Firewall
• Antivirus
• Pentesting tool
One Language
Linux, Windows, MacOS, Solaris, AIX, ...
Bare-metal, VMs, Containers
One Language
Linux, Windows, MacOS, Solaris, AIX, ...
Bare-metal, VMs, Containers
Nodes, Databases
DB Testing
One Language
Linux, Windows, MacOS, Solaris, AIX, ...
Bare-metal, VMs, Containers
Nodes, Databases, APIs
Cloud Testing
InSpec
> inspec exec test.rb
Test a machine remotely via SSH
> inspec exec test.rb -i identity.key -t ssh://root@172.17.0.1
Test your machine locally
> inspec exec test.rb -t winrm://Admin@192.168.1.2 --password super
Test Docker Container
> inspec exec test.rb -t docker://5cc8837bb6a8
Test a machine remotely via WinRM
AGENTLESS
One Language
Linux, Windows, MacOS, Solaris, AIX, ...
Bare-metal, VMs, Containers
Nodes, Databases, APIs, Cloud Platforms, ...
Open Source Community
•https://inspec.io
•https://github.com/chef/inspec
•https://supermarket.chef.io
•https://learn.chef.io
•#inspec in https://chefcommunity.slack.com
This Year
•408 Pull Requests
•116 from non-Chef employees!
•89 PR contributors
•61 non-Chef employees!
•23 new core resources added
•12 from non-Chef employees!
55%
Step one: Detect
Gain visibility into current status to satisfy audits and drive decision-making
of organizations do compliance assessments inconsistently or not at all.
Apply policies and gain a
complete view across the fleet
▪ Accurately assess risk
▪ Prioritize remediation actions
▪ Maintain audit readiness
▪ Create and adjust policies
”
Continuous visibility means that you enter into audits knowing the outcome.
Jon Williams, NIU
? ? ? ?
? ? ? ?
? ? ? ?
? ? ? ?
Step two: Correct
Remediate issues to improve performance and security
▪ Prioritize actions based on impact
▪ Improve application performance
▪ Close security holes
▪ Prove policy compliance
Web &
Media Giant
Can patch 250,000 nodes within 6 hours of a patch being made available
Develop, test, and deploy remediation
to address issues across the fleet
of organizations need days or longer to remediate issues.58%
59%
Step three: Automate
Deploy applications faster and manage risk continuously
▪ Increase speed while reducing
risk
▪ Improve software change
efficiency
▪ Maintain security and compliance
▪ Align DevOps and InfoSec
Every resource and app in HPC environment automatically qualified as
compliant with FDA standards before deployment
of organizations do not assess for compliance until code is running in production.
Deploy applications with
confidence
The journey to continuous compliance
Detect
Correct
Automate
1. Detect
Gain visibility and develop baselines
2. Correct
Remediate priority issues
3. Automate
Continuously detect & correct
Chef Automate enables the entire journey
Detect
▪ Test against industry benchmarks
▪ Report and address audit needs
Correct
▪ Close detect/correct loop in one platform
▪ Develop baselines for automation
Automate
▪ Detect and correct before production
▪ Single language across DevOps, InfoSec
Chef Automate is a single platform to support the entire journey
Dig into the new way of learning about
Chef, Automation, and DevOps.
Self-paced training on Linux and Windows and much more!
learn.chef.io
Thanks!
Matt Ray
matt@chef.io
@mattray

DevOpsDays Singapore - Continuous Auditing with Compliance as Code

  • 1.
    Continuous Auditing with Complianceas Code DevOpsDays Singapore October 26, 2017
  • 2.
    Matt Ray Manager/Solutions Architect– APJ Chef Software matt@chef.io @mattray Software Defined Talk
  • 4.
  • 7.
    SSH Control "SSH supportstwo different protocol versions. The original version, SSHv1, was subject to a number of security issues. Please use SSHv2 instead to avoid these."
  • 8.
    How will Iverify this?
  • 9.
    Whip up aone-liner! grep "^Protocol" /etc/ssh/sshd_config | sed 's/Protocol //'
  • 10.
    Apache Server InformationLeakage • Description This Directive Controls wheather Server response field is sent back to clients includes a description of Generic OS Type of the Server. This allows attackers to identify web servers details greatly and increases the efficiency of any attack,as security vulnerabilities are dependent upon specific software versions. • How to Test In order to test for ServerToken configuration, one should check the Apache configuration file. • Misconfiguration ServerTokens Full • Remediation Configure the ServerTokens directive in the Apache configuration to value of Prod or ProductOnly. This tells Apache to only return "Apache" in the Server header, returned on every page request. ServerTokens Prod or ServerTokens ProductOnly https://www.owasp.org/index.php/SCG_WS_Apache
  • 11.
    More grep andsed! grep "^ServerTokens" /etc/httpd/conf/httpd.conf | sed 's/ServerTokens //'
  • 15.
  • 18.
  • 21.
    “Two-thirds of organizationsdid not adequately test the security of all in-scope systems”
  • 22.
    Key Trends • Whileindividual rule compliance is up, testing of security systems is down • Sustainability is low. Fewer than a third of companies were found to be still fully compliant less than a year after successful validation.
  • 23.
  • 25.
    Shell Scripts grep "^Protocol"/etc/ssh/sshd_config | sed 's/Protocol //' grep "^ServerTokens" /etc/httpd/conf/httpd.conf | sed 's/ServerTokens //'
  • 26.
    Infrastructure Code package 'httpd'do action :install end service 'httpd' do action [ :start, :enable ] end
  • 27.
    We Have ACommunications Problem
  • 33.
  • 34.
  • 35.
  • 36.
    One Language Linux, Windows,MacOS, Solaris, AIX, ...
  • 37.
    Examples of AvailableResources apache_conf apt audit_policy auditd_conf auditd_rules bond bridge command crontab directory etc_group file gem group host inetd_conf interface iptables kernel_module kernel_parameter limits_conf login_defs mount mysql_conf mysql_session npm ntp_conf oneget os os_env package parse_config parse_config_file passwd pip port postgres_conf postgres_session powershell processes registry_key security_policy service ssh_config sshd_config user windows_feature yum
  • 38.
    What is itnot? • IDS / IPS • Firewall • Antivirus • Pentesting tool
  • 39.
    One Language Linux, Windows,MacOS, Solaris, AIX, ... Bare-metal, VMs, Containers
  • 40.
    One Language Linux, Windows,MacOS, Solaris, AIX, ... Bare-metal, VMs, Containers Nodes, Databases
  • 41.
  • 42.
    One Language Linux, Windows,MacOS, Solaris, AIX, ... Bare-metal, VMs, Containers Nodes, Databases, APIs
  • 43.
  • 44.
    InSpec > inspec exectest.rb Test a machine remotely via SSH > inspec exec test.rb -i identity.key -t ssh://root@172.17.0.1 Test your machine locally > inspec exec test.rb -t winrm://Admin@192.168.1.2 --password super Test Docker Container > inspec exec test.rb -t docker://5cc8837bb6a8 Test a machine remotely via WinRM AGENTLESS
  • 45.
    One Language Linux, Windows,MacOS, Solaris, AIX, ... Bare-metal, VMs, Containers Nodes, Databases, APIs, Cloud Platforms, ...
  • 46.
  • 47.
    This Year •408 PullRequests •116 from non-Chef employees! •89 PR contributors •61 non-Chef employees! •23 new core resources added •12 from non-Chef employees!
  • 48.
    55% Step one: Detect Gainvisibility into current status to satisfy audits and drive decision-making of organizations do compliance assessments inconsistently or not at all. Apply policies and gain a complete view across the fleet ▪ Accurately assess risk ▪ Prioritize remediation actions ▪ Maintain audit readiness ▪ Create and adjust policies ” Continuous visibility means that you enter into audits knowing the outcome. Jon Williams, NIU ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • 49.
    Step two: Correct Remediateissues to improve performance and security ▪ Prioritize actions based on impact ▪ Improve application performance ▪ Close security holes ▪ Prove policy compliance Web & Media Giant Can patch 250,000 nodes within 6 hours of a patch being made available Develop, test, and deploy remediation to address issues across the fleet of organizations need days or longer to remediate issues.58%
  • 50.
    59% Step three: Automate Deployapplications faster and manage risk continuously ▪ Increase speed while reducing risk ▪ Improve software change efficiency ▪ Maintain security and compliance ▪ Align DevOps and InfoSec Every resource and app in HPC environment automatically qualified as compliant with FDA standards before deployment of organizations do not assess for compliance until code is running in production. Deploy applications with confidence
  • 51.
    The journey tocontinuous compliance Detect Correct Automate 1. Detect Gain visibility and develop baselines 2. Correct Remediate priority issues 3. Automate Continuously detect & correct
  • 52.
    Chef Automate enablesthe entire journey Detect ▪ Test against industry benchmarks ▪ Report and address audit needs Correct ▪ Close detect/correct loop in one platform ▪ Develop baselines for automation Automate ▪ Detect and correct before production ▪ Single language across DevOps, InfoSec Chef Automate is a single platform to support the entire journey
  • 53.
    Dig into thenew way of learning about Chef, Automation, and DevOps. Self-paced training on Linux and Windows and much more! learn.chef.io
  • 54.