devopsdays singapore - continuous auditing with compliance as code

54
Continuous Auditing with Compliance as Code DevOpsDays Singapore October 26, 2017

Upload: matt-ray

Post on 22-Jan-2018

287 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Continuous Auditing with Compliance as Code

DevOpsDays SingaporeOctober 26, 2017

Page 2: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Matt RayManager/Solutions Architect – APJChef [email protected]

@mattraySoftware Defined Talk

Page 3: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 4: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Chef Workflow

Page 5: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 6: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 7: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

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."

Page 8: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

How will I verify this?

Page 9: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Whip up a one-liner!

grep "^Protocol" /etc/ssh/sshd_config | sed 's/Protocol //'

Page 10: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Apache Server Information Leakage

• DescriptionThis 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 TestIn order to test for ServerToken configuration, one should check the Apache configuration file.

• MisconfigurationServerTokens Full

• RemediationConfigure 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 ProdorServerTokens ProductOnly

https://www.owasp.org/index.php/SCG_WS_Apache

Page 11: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

More grep and sed!grep "^ServerTokens" /etc/httpd/conf/httpd.conf | sed 's/ServerTokens //'

Page 12: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 13: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 14: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 15: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Passed the Audit

Page 16: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 17: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 18: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Compliance

Page 19: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 20: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 21: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

“Two-thirds of organizations did not adequately test the security of all in-scope systems”

Page 22: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

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.

Page 23: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Security != Compliance

Security Theater

Page 24: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 25: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Shell Scriptsgrep "^Protocol" /etc/ssh/sshd_config | sed 's/Protocol //'

grep "^ServerTokens" /etc/httpd/conf/httpd.conf | sed 's/ServerTokens //'

Page 26: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Infrastructure Code

package 'httpd' doaction :install

end

service 'httpd' doaction [ :start, :enable ]

end

Page 27: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

We Have A Communications Problem

Page 28: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 29: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 30: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 31: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 32: DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Page 33: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Compliance Language

Page 34: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

One LanguageLinux, Windows

Page 35: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Windows

Page 36: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

One LanguageLinux, Windows, MacOS, Solaris, AIX, ...

Page 37: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Examples of Available Resourcesapache_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

Page 38: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

What is it not?

• IDS / IPS• Firewall• Antivirus• Pentesting tool

Page 39: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

One LanguageLinux, Windows, MacOS, Solaris, AIX, ...

Bare-metal, VMs, Containers

Page 40: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

One LanguageLinux, Windows, MacOS, Solaris, AIX, ...

Bare-metal, VMs, Containers

Nodes, Databases

Page 41: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

DB Testing

Page 42: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

One LanguageLinux, Windows, MacOS, Solaris, AIX, ...

Bare-metal, VMs, Containers

Nodes, Databases, APIs

Page 43: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Cloud Testing

Page 44: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

InSpec

> inspec exec test.rb

Test a machine remotely via SSH

> inspec exec test.rb -i identity.key -t ssh://[email protected]

Test your machine locally

> inspec exec test.rb -t winrm://[email protected] --password super

Test Docker Container

> inspec exec test.rb -t docker://5cc8837bb6a8

Test a machine remotely via WinRM AG

ENTLESS

Page 45: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

One LanguageLinux, Windows, MacOS, Solaris, AIX, ...

Bare-metal, VMs, Containers

Nodes, Databases, APIs, Cloud Platforms, ...

Page 46: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

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

Page 47: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

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!

Page 48: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

55%

Step one: DetectGain 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

? ? ? ?

? ? ? ?

? ? ? ?

? ? ? ?

� � �

� � � �

� � �

� � �

Page 49: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

� � �

� � � �

� � �

� � �

Step two: CorrectRemediate 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%

Page 50: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

59%

Step three: AutomateDeploy 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

Page 51: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

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

Page 52: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

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

Page 53: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

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

Page 54: DevOpsDays Singapore - Continuous Auditing with Compliance as Code

Thanks!

Matt [email protected]@mattray