Slide 1

Slide 1 text

DevSec: Continuous Patch and Security Assessment with InSpec Christoph Hartmann Lead Engineer Chef Software @chri_hartmann Patrick Münch IT-Security Consultant SVA GmbH @atomiczero111

Slide 2

Slide 2 text

$> whoami • IT-Security Consultant at SVA GmbH • Co-Founded Dev-Sec.io project • Penetration-Testing • Offensive Security Certified Professional • Offensive Security Certified Expert @atomiczero111 Patrick Münch atomic111

Slide 3

Slide 3 text

@chri_hartmann $> whoami Christoph Hartmann • Engineering Lead at Chef Software • Co-Founded Dev-Sec.io project • Co-Founder of VulcanoSec • Acquired by Chef Software • InSpec Creator chris-rock

Slide 4

Slide 4 text

Agenda Compliance DevOps

Slide 5

Slide 5 text

Join github.com/chef/inspec Join github.com/dev-sec

Slide 6

Slide 6 text

Challenges

Slide 7

Slide 7 text

The tip of the iceberg Heartbleed Shellshock WannaCry Cyber-Threat landscape

Slide 8

Slide 8 text

State of Security in 2014 • In 60% of cases, attackers can compromise organizations within minutes. • 99.9% of the exploited vulnerabilities were compromised more than a year after the vulnerability was published. • Ten vulnerabilities account for 97% of the exploits observed. Verizon Data Breach Report

Slide 9

Slide 9 text

OWASP Top 10

Slide 10

Slide 10 text

A5 – Security Misconfiguration Good security requires having a secure configuration defined and deployed for the application, frameworks, application server, web server, database server, platform, etc. Secure settings should be defined, implemented, and maintained, as defaults are often insecure. Additionally, software should be kept up to date. A9 – Using Components with Known Vulnerabilities Components, such as libraries, frameworks, and other software modules, run with the same privileges as the application. If a vulnerable component is exploited, such an attack can facilitate serious data loss or server takeover. Applications and APIs using components with known vulnerabilities may undermine application defenses and enable various attacks and impacts. OWASP Top 10

Slide 11

Slide 11 text

Source: http://content.time.com/time/covers/europe/0,16641,20020708,00.html

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Regulatory Compliance PCI-DSS Gramm-Leach-Bliley Act HIPAA Dodd-Frank ISO Sarbanes-Oxley HITECH Grundschutz European Central Bank Regulations

Slide 15

Slide 15 text

Reporting of compliance activity is extensive EY – A time of evolution for compliance: laying foundations for future success

Slide 16

Slide 16 text

Huge scope remains for tapping into the power of technology EY – A time of evolution for compliance: laying foundations for future success

Slide 17

Slide 17 text

COMPLIANCE AND SECURITY Compliance Security

Slide 18

Slide 18 text

Automation

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

github.com/dev-sec

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Scale

Slide 24

Slide 24 text

Scale

Slide 25

Slide 25 text

Scale

Slide 26

Slide 26 text

DevOps Cloud IoT

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Compliance DevOps

Slide 29

Slide 29 text

Security & Compliance

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

Language Compliance DevOps Security

Slide 33

Slide 33 text

Compliance-Driven Infrastructure

Slide 34

Slide 34 text

Tradeoff: Speed vs Risk DevOps teams focus on faster innovation, potentially increasing risk InfoSec teams focus on mitigating risk, potentially reducing speed

Slide 35

Slide 35 text

Drivers for Compliance Security Reduce risk and protect business Liability Avoid negligence

Slide 36

Slide 36 text

QUALITY/COMPLIANCE RATE OF INNOVATION Scale Speed and Compliance

Slide 37

Slide 37 text

Detect Correct Compliance Continuous

Slide 38

Slide 38 text

Let’s talk about solutions github.com/dev-sec

Slide 39

Slide 39 text

Works with all DevOps tools e.g.

Slide 40

Slide 40 text

InSpec turns infrastructure testing, compliance and security requirements into code

Slide 41

Slide 41 text

Surface check #1: Know your security stance

Slide 42

Slide 42 text

Surface check Deep analysis #1: Know your security stance

Slide 43

Slide 43 text

• Operating Systems • DBs, AppServers • Apps • On-prem, Cloud, Hybrid, Containers Deep analysis #1: Know your security stance

Slide 44

Slide 44 text

Faulty assumptions #1: Know your security stance

Slide 45

Slide 45 text

Faulty assumptions #1: Know your security stance

Slide 46

Slide 46 text

• Prevent insecure production env. • Report and alert continuously • Provide proof Faulty assumptions #1: Know your security stance

Slide 47

Slide 47 text

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

Slide 48

Slide 48 text

Scripting tools

Slide 49

Slide 49 text

The better way TESTING A REQUIREMENT

Slide 50

Slide 50 text

Standalone Usage $ inspec exec test.rb $ inspec exec test.rb -i vagrant.key -t ssh://[email protected]:11022 $ inspec exec test.rb -t winrm://[email protected] --password super $ inspec exec test.rb -t docker://3cc8837bb6a8 describe sshd_config do its('Protocol') { should cmp 2 } end

Slide 51

Slide 51 text

Mapping of Compliance Document to InSpec

Slide 52

Slide 52 text

Compliance Language

Slide 53

Slide 53 text

apache apache_conf apt audit_policy auditd_conf auditd_rules bash bond bridge bsd_service command crontab csv dh_params directory docker docker_container docker_image etc_group file gem group groups grub_conf host http iis_site iis_website inetd_conf ini interface iptables json kernel_module kernel_parameter key_rsa launchd_service limits_conf login_defs mount mssql_session mysql mysql_conf mysql_session npm ntp_conf oneget oracledb_session os os_env package packages parse_config parse_config_file passwd pip port postgres postgres_conf postgres_session powershell ppa processes rabbitmq_config registry_key runit_service script security_policy service shadow ssh_config sshd_config ssl sys_info systemd_service sysv_service upstart_service user users vbscript windows_feature windows_registry_key windows_task wmi x509_certificate xinetd_conf yaml yum yumrepo zfs_dataset zfs_pool Built-in resources

Slide 54

Slide 54 text

Supported Operating Systems

Slide 55

Slide 55 text

InSpec Profiles Folder Structure

Slide 56

Slide 56 text

InSpec Profiles inspec.yml

Slide 57

Slide 57 text

$ inspec supermarket profiles == Available profiles: * apache2-compliance-test-tthompson thompsontelmate/apache2-compliance-test-tthompson * Apache DISA STIG som3guy/apache-disa-stig * chef-alfresco-inspec-mysql alfresco/chef-alfresco-inspec-mysql * chef-alfresco-inspec-tomcat alfresco/chef-alfresco-inspec-tomcat * chef-client-hardening sliim/chef-client-hardening * CIS Docker Benchmark dev-sec/cis-docker-benchmark * CVE-2016-5195 ndobson/cve-2016-5195 * DevSec Apache Baseline dev-sec/apache-baseline * DevSec Linux Baseline dev-sec/linux-baseline InSpec Supermarket

Slide 58

Slide 58 text

Demo: Deploy Website to Production Ubuntu Apache WebServer DevSec Static Website

Slide 59

Slide 59 text

github.com/dev-sec

Slide 60

Slide 60 text

DevSec InSpec Profiles Operating Systems DevSec Linux Baseline DevSec Linux Patch Baseline DevSec Windows Baseline DevSec Windows Patch Baseline DevSec SSH Baseline DevSec SSL/TLS Baseline CIS Distribution Independent Applications DevSec Nginx Baseline DevSec MySQL Baseline DevSec PHP baseline DevSec Apache Baseline DevSec PostgreSQL Baseline Application Runtimes DevSec OpenStack Baseline CIS Docker Benchmark CIS Kubernetes Benchmark

Slide 61

Slide 61 text

Linux Patch Benchmark Acme Inc include_controls ’linux-patch baseline’ depends: - name: linux-patch baseline InSpec Profile Management

Slide 62

Slide 62 text

Manage Baselines My CIS L1 (inspec overlay) CIS Lvl1 (xml base profile)

Slide 63

Slide 63 text

Manage Baseline Overlays Dev Production Test My CIS L1 (inspec overlay) CIS Lvl1 (xml base profile)

Slide 64

Slide 64 text

InSpec Profiles github.com/dev-se c DevSec Windows Patch Baseline DevSec Linux Baseline DevSec Windows Baseline DevSec Linux Patch Baseline

Slide 65

Slide 65 text

InSpec Profiles github.com/dev-sec github.com/chris-rock/acme-inspec-profil DevSec Windows Patch Baseline DevSec Linux Baseline DevSec Windows Baseline DevSec Linux Patch Baseline

Slide 66

Slide 66 text

InSpec Profiles DevSec Windows Patch Baseline DevSec Linux Baseline DevSec Windows Baseline DevSec Linux Patch Baseline github.com/dev-sec github.com/chris-rock/acme-inspec-profil

Slide 67

Slide 67 text

InSpec Profiles

Slide 68

Slide 68 text

Continuous Compliance Compliance DevOps

Slide 69

Slide 69 text

Continuous Compliance Scan for Compliance Build & Test Locally Build & Test CI/CD Remediate Verify

Slide 70

Slide 70 text

Further Resources inspec.io • Hands on tutorials • Extensive documentation • Code examples dev-sec.io • Security Baselines • Ansible, Chef & Puppet Hardening Modules • Documentation

Slide 71

Slide 71 text

Further Resources Compliance- und Sicherheitsanforderungen automatisieren und effizienter managen https://youtu.be/0aEYp15VP_M BSI-Compliance - SVA Experten-Tipp https://youtu.be/DTvtACNzLro

Slide 72

Slide 72 text

Join github.com/chef/inspec Join github.com/dev-sec

Slide 73

Slide 73 text

Contact Details Christoph Hartmann Engineering Lead Compliance eMail: [email protected] Twitter: @chri_hartmann Patrick Münch IT-Security Consultant eMail: [email protected] Twitter: @atomiczero111