SlideShare une entreprise Scribd logo
1  sur  60
Increase awareness around DevOps
infra security
DevOoops
Gianluca Varisco
@gvarisco
$ whoami
VP	Security	@	Rocket	Internet	SE
Formerly	at	Red	Hat,	Lastminute.com Group,	 PrivateWave
DevOps is about creating a conveyor belt to systematically pull
together all of the pieces that need to go into production using
automation to create a safe and reliable application deployment.
What is DevOps?
Why Security needs DevOps
How vulnerabilities get introduced
Configuration errors Missing patch
Coding mistakeHuman mistake
(bad OPSEC)
We learned (the HARD WAY) that DevOps is more than giving
root to developers….
alias devops=sudo
DevOps Borat
01 GitHub
02 RCS tools
03 CI tools
04 AWS config files
05 Client provisioning tools
06 Elasticsearch
07 In-memory databases
Agenda
08 Docker
GitHub
It does support “advanced” search operators, eg.
• extension:conf ftp server configuration
• extension:pem private
• extension:xls mail
• extension:sql mysql dump
• extension:php “preg_replace(“/(.+)/e” (RCE)
• OSINT (within companies’and employees’repos)
GitHub - Search
Pushing code to GitHub as Linus Torvalds?
GitHub – Impersonating others
People trust
pictures!
• Hey, look! Linus is the main committer of my
github.com:gvarisco/swag.git repo!
• Sad truth! Design flaw or targeted feature? Official response
below..
GitHub – Impersonating others / 2
• Always audit who has access to your repos
• Be suspicious of pull requests with other authors’ code within
the PR.
• Always delete a private fork of a private organization
repository if a member leaves your organization.
• Audit organization members for 2-step verification
GitHub – Learnings / TODOs
RCS tools
Does your website expose the .git/ folder on a webserver out
there?
§ Access to such content lets you downloadthe full source
code
§ tl;dr: NO, Turning DirectoryIndex (Apache)/ autoindex
(nginx)ON/OFF is NOT the fix!
.git exposure
• Source code, config files, credentials,developernames,
public/private keys,SSLcertificates, e-mail addresses,etc.
• Repo HISTORY(security issues fixed,password wrongly
committed and removed later)
• Archives / backups {My,Postgre,XYZ}SQLdumps
• Session generationkeys
.git exposure / What can you get?
• $ mkdir website-source-code
• $ cd website-source-code
• $ wget –mirror –include-directories=/.git
http://www.example.com/.git
• $ cd www.example.com
• $ git reset –hard
HEAD is now at […]
.git exposure / DirectoryIndex ON
• Git-fsck to the rescue!
• Bruteforce: Predictable file names and known object hashes,
etc.
• DVCS-{Pillage,Ripper} do it for you
• Many admins tend to answer either 403 or 404 for .git/ but
.git/configworks just fine.
• Git stores file information withinthe objects folder.
.git exposure / DirectoryIndex OFF
• See the SHA-1 for index.php:
• $ git cat-file –p master^{tree}
• Take the SHA-1 and give it to ‘git cat-file’to print out the file
contents:
Abusing the .git/ Objects folder
• 1.6.x and earlier
• Check for .entriesfiles
• Walk SVN chain to retrieve all files. Metasploit does it
for you (auxiliary/scanner/http/svn_scanner)
Subversion 1.6.x
• 1.7.x uses SQLite.
• Metasploit’s auxiliary/scanner/http/svn_wcdb_scanner
to the rescue! It will retrieve SVN’s wc.db for you
• As we know the file name and the SHA-1 used,
we can map all files.
Subversion 1.7.x
$ sqlite3 wc.db 'select local_relpath, ".svn/pristine/" || substr(checksum,7,2) || "/" ||
substr(checksum,7) || ".svn-base" as alpha from NODES;’
index.php|.svn/pristine/4e/4e6a225331f9ae872db25a8f85ae7be05cea6d51.svn-base
style/style.js|.svn/pristine/2s/2cc5590e0ba024c3db77a13896da09b39ea74799.svn-base
...
$ wget -O -
http://www.example.com/.svn/pristine/4e/4e6a225331f9ae872db25a8f85ae7be05cea6d
51.svn-base
<?php
Subversion 1.7.x
CI tools
• The leading open-source continuous
integrationserver.
• Built in Java, it provides 985 plug-ins to
support buildingand testing virtually
any project.
• Latest and greatest release: 1.633
• A “few” security advisories…
Jenkins
Jenkins – Searches on Shodan
• Metasploit modules:
• auxiliary/scanner/http/jenkins_enum
(It enumerates a remote Jenkins installationin an unauthenticated
manner, includinghost OS and Jenkins installationdetails)
• exploit/multi/http/jenkins_script_console
(It uses the Jenkins Groovy script console to execute OS commands
using Java.)
• If no authenticationis required,it is trivialtogain remote code execution
via script console.
Abusing Jenkins
• Wanna display jenkins’user private SSH key? No problem! It is as simple
as executing:
printlnnew ProcessBuilder('sh','-c','cat
/Users/batman/.ssh/id_rsa').redirectErrorStream(true).start().text
Abusing Jenkins – Script console
• Last, but not least:
• If you have access to /view/All/newJob,create new builds and run
commands.
• Browse WORKSPACEs, read config / folders containingsensitive
data, eg. credentials,API keys
Abusing Jenkins
AWS config files
• ALL credentials are stored in plain-text in “”hidden files””,eg.
/home/gvarisco/.foo/bar
• Typicallyprivilegedaccesses
• Once credentials are found, any of the OSS libraries available out there can
interact withAWS (eg. Nimbostratus,AWS CLI tools)
• OSINT / Informationleakage via GitHub, Pastebins,etc.
AWS config files
Provisioning tools
• If you expose a dashboard (eg. PuppetBoard/PuppetDB) be careful with
your custom FACTS
• Encrypt your sensitive YAML files’information(if you use HIERA, a
key/value lookup tool for config data) with HIERA-EYAML
• It does provide asymmetric encryption of sensitive data
• Store the keys securely when using puppet, as only the puppetmaster
needs access to them in order to perform decryption when the agent
runs on a remote node
Puppet
Puppet – Hiera-EYAML
• Web Interface (Chef Server),Rails powered, uses admin/ p@ssw0rd1 as
default credentials
Chef
• Databags items (eg. MySQL data) can be encrypted
• Use knife – a cli tool that provides an interface between a local chef-repo
and the Chef server
Chef
• Did you change your SSH keys?
• Vagrant 1.7+ embeds vagrant-rekey-ssh plug-in
Vagrant
• Common user/passwords: root/vagrant OR vagrant/vagrant
• NO pass to sudo L
Vagrant
Vagrant – Scans using the default private key
• Vagrant workflows encourage you to edit your code outside the VM.
• That’s why it helpfully shares the project directory as /vagrant/ in the
VM.
“Put evil things in /vagrant/.git/hooks/post-commit and wait for the user to
commit some code. Since the /vagrant/ directory is mounted from the host,
such hook will persist even if the user destroys the VM.”
Vagrant – breaking in!
• Root passwords are either set:
• During installation
• Crypted hash defined in the KS file (rootpw –iscrypted)
• Clear text defined in the KS file (rootpw –plaintext)
Kickstart files (Red Hat, CentOS, …)
Elasticsearch
• A distributed full-text search engine with a RESTful web interface and
schema-free JSON documents
• 9200/TCP (GET request shows version)
• No authentication
• Can search stored data via HTTP API
• Update data with PUT requests
• Join an existing, open cluster and get all the data
• REMOTE CODE EXECUTION prior to 1.2.0
Elasticsearch
• Own a server with a query like this (as the search function allows
dynamic scripts execution):
• 1.3.x adds a sandbox to control what classes and functions can be
executed.
• Add ‘script.disable_dynamic: true’ to your elasticsearch.yml
• Make sure your instance is only binding on localhost
Elasticsearch
Elasticsearch – read inside /etc
In-memory databases
• Default config comes with:
• NO encrypted communication
• NO credentials
• 6379/TCP
• Binds to all interfaces
Redis
Redis – Shodan results
Abusing Redis instances
• FLUSHALL (Remove all keys from all databases)
• SCRIPT LOAD
• EVAL / EVALSHA
Redis – “Funny” commands
• Free & open-source
• High-performance, distributed memory object caching system
• Fun things get put into memcache
• SECURE IT:
• First and always, FIREWALL
• Check your bindings (interfaces)
• If you need it, use SASL
• DO NOT RUNAS ROOT
Memcache
Memcache – interesting findings…
Docker
• It automates the deployment of applications insidesoftware containers
• Docker works as a client that communicates with a daemon process
(dockerd) via a Unix domain socket called /var/run/docker.sock
• Highly privileged, effectivelyhaving root access
Docker
• Error:
# docker run -t -i -v /var/run/docker.sock:/var/run/docker.sock
• PoC:
• The container gets a docker client of its own, pointed at the
/var/run/docker.sock
• The container launches a new container mounting / on /host
(It’s the host root filesystem, not the first container’s)
• The second container chroots to /host, and is now effectively root
on the host..
Don’t expose the Docker socket!
Video
• Add authentication to Jenkins
• Make sure all your tools / systems are only available from/to hosts that
need it
• Change default private keys / credentials EVERYWHERE
• Update to latest versions of all your devops tools
And now what?
• Don’t push DevOps back but rather embrace it.
• Participate in or create cookbooks/modules/scripts for security
• Check for known security items you don’t want going into
production by creating audit scripts
Go forward
THANKS!
Questions?
• Ken Johnson
• Chris Gates
• Laurens Van Houtven
• Rocket Internet’s Security Team
Credits
© 2015 Rocket Internet SE. All rights reserved.

Contenu connexe

Tendances

Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, PowershellRoo7break
 
Getting root with benign app store apps
Getting root with benign app store appsGetting root with benign app store apps
Getting root with benign app store appsCsaba Fitzl
 
Container Security
Container SecurityContainer Security
Container SecuritySalman Baset
 
DockerCon SF 2015: Docker Security
DockerCon SF 2015: Docker SecurityDockerCon SF 2015: Docker Security
DockerCon SF 2015: Docker SecurityDocker, Inc.
 
Veer's Container Security
Veer's Container SecurityVeer's Container Security
Veer's Container SecurityJim Barlow
 
Velocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack WorkshopVelocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack WorkshopChef Software, Inc.
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security OverviewSreenivas Makam
 
DockerCon EU 2015: Persistent, stateful services with docker cluster, namespa...
DockerCon EU 2015: Persistent, stateful services with docker cluster, namespa...DockerCon EU 2015: Persistent, stateful services with docker cluster, namespa...
DockerCon EU 2015: Persistent, stateful services with docker cluster, namespa...Docker, Inc.
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with DockerGeeta Vinnakota
 
Owning computers without shell access 2
Owning computers without shell access 2Owning computers without shell access 2
Owning computers without shell access 2Royce Davis
 
Docker Advanced registry usage
Docker Advanced registry usageDocker Advanced registry usage
Docker Advanced registry usageDocker, Inc.
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016Russel Van Tuyl
 
Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker ContainerJesus Guzman
 
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...Docker, Inc.
 
FreeIPA - Attacking the Active Directory of Linux
FreeIPA - Attacking the Active Directory of LinuxFreeIPA - Attacking the Active Directory of Linux
FreeIPA - Attacking the Active Directory of LinuxJulian Catrambone
 
Container Security
Container SecurityContainer Security
Container SecurityJie Liau
 

Tendances (20)

Power on, Powershell
Power on, PowershellPower on, Powershell
Power on, Powershell
 
Getting root with benign app store apps
Getting root with benign app store appsGetting root with benign app store apps
Getting root with benign app store apps
 
Container Security
Container SecurityContainer Security
Container Security
 
DockerCon SF 2015: Docker Security
DockerCon SF 2015: Docker SecurityDockerCon SF 2015: Docker Security
DockerCon SF 2015: Docker Security
 
Containers and Security for DevOps
Containers and Security for DevOpsContainers and Security for DevOps
Containers and Security for DevOps
 
From P0W3R to SH3LL
From P0W3R to SH3LLFrom P0W3R to SH3LL
From P0W3R to SH3LL
 
Docker & Daily DevOps
Docker & Daily DevOpsDocker & Daily DevOps
Docker & Daily DevOps
 
Veer's Container Security
Veer's Container SecurityVeer's Container Security
Veer's Container Security
 
Velocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack WorkshopVelocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack Workshop
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security Overview
 
DockerCon EU 2015: Persistent, stateful services with docker cluster, namespa...
DockerCon EU 2015: Persistent, stateful services with docker cluster, namespa...DockerCon EU 2015: Persistent, stateful services with docker cluster, namespa...
DockerCon EU 2015: Persistent, stateful services with docker cluster, namespa...
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
Owning computers without shell access 2
Owning computers without shell access 2Owning computers without shell access 2
Owning computers without shell access 2
 
Docker Advanced registry usage
Docker Advanced registry usageDocker Advanced registry usage
Docker Advanced registry usage
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016
 
Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker Container
 
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
 
FreeIPA - Attacking the Active Directory of Linux
FreeIPA - Attacking the Active Directory of LinuxFreeIPA - Attacking the Active Directory of Linux
FreeIPA - Attacking the Active Directory of Linux
 
RSA APJ Velociraptor Lab
RSA APJ Velociraptor LabRSA APJ Velociraptor Lab
RSA APJ Velociraptor Lab
 
Container Security
Container SecurityContainer Security
Container Security
 

En vedette

Ansible Oxford - Cows & Containers
Ansible Oxford - Cows & ContainersAnsible Oxford - Cows & Containers
Ansible Oxford - Cows & Containersjonatanblue
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupGreg DeKoenigsberg
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them AllTim Fairweather
 
Managing Windows Systems with Puppet - PuppetConf 2013
Managing Windows Systems with Puppet - PuppetConf 2013Managing Windows Systems with Puppet - PuppetConf 2013
Managing Windows Systems with Puppet - PuppetConf 2013Puppet
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102APNIC
 
Puppet Fundamentals Talk at DevOps Dubai by Hameedullah Khan
Puppet Fundamentals Talk at DevOps Dubai by Hameedullah KhanPuppet Fundamentals Talk at DevOps Dubai by Hameedullah Khan
Puppet Fundamentals Talk at DevOps Dubai by Hameedullah KhanHameedullah Khan
 
Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)Chu-Siang Lai
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Chu-Siang Lai
 
Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleRobert Reiz
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker, Inc.
 

En vedette (11)

Ansible Oxford - Cows & Containers
Ansible Oxford - Cows & ContainersAnsible Oxford - Cows & Containers
Ansible Oxford - Cows & Containers
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetup
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them All
 
Managing Windows Systems with Puppet - PuppetConf 2013
Managing Windows Systems with Puppet - PuppetConf 2013Managing Windows Systems with Puppet - PuppetConf 2013
Managing Windows Systems with Puppet - PuppetConf 2013
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
Puppet Fundamentals Talk at DevOps Dubai by Hameedullah Khan
Puppet Fundamentals Talk at DevOps Dubai by Hameedullah KhanPuppet Fundamentals Talk at DevOps Dubai by Hameedullah Khan
Puppet Fundamentals Talk at DevOps Dubai by Hameedullah Khan
 
Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)
 
Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & Ansible
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 

Similaire à Road to Opscon (Pisa '15) - DevOoops

DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...Gianluca Varisco
 
WTF my container just spawned a shell!
WTF my container just spawned a shell!WTF my container just spawned a shell!
WTF my container just spawned a shell!Sysdig
 
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Sysdig
 
Intro to Pentesting Jenkins
Intro to Pentesting JenkinsIntro to Pentesting Jenkins
Intro to Pentesting JenkinsBrian Hysell
 
A new model for Docker image distribution
A new model for Docker image distributionA new model for Docker image distribution
A new model for Docker image distributionDocker, Inc.
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...E. Camden Fisher
 
A Survey of Container Security in 2016: A Security Update on Container Platforms
A Survey of Container Security in 2016: A Security Update on Container PlatformsA Survey of Container Security in 2016: A Security Update on Container Platforms
A Survey of Container Security in 2016: A Security Update on Container PlatformsSalman Baset
 
Deploying to Ubuntu on Linode
Deploying to Ubuntu on LinodeDeploying to Ubuntu on Linode
Deploying to Ubuntu on LinodeWO Community
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudSalman Baset
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityPhil Estes
 
Best Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBest Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBlueData, Inc.
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013Docker, Inc.
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime SecuritySysdig
 
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 updateAlex Pop
 
Docker Security
Docker SecurityDocker Security
Docker Securityantitree
 
Owning computers without shell access dark
Owning computers without shell access darkOwning computers without shell access dark
Owning computers without shell access darkRoyce Davis
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and dockerFabio Fumarola
 
Virtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesVirtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesabhishek chawla
 
StorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UK
StorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UKStorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UK
StorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UKStorageOS
 

Similaire à Road to Opscon (Pisa '15) - DevOoops (20)

DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
 
WTF my container just spawned a shell!
WTF my container just spawned a shell!WTF my container just spawned a shell!
WTF my container just spawned a shell!
 
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
 
Intro to Pentesting Jenkins
Intro to Pentesting JenkinsIntro to Pentesting Jenkins
Intro to Pentesting Jenkins
 
A new model for Docker image distribution
A new model for Docker image distributionA new model for Docker image distribution
A new model for Docker image distribution
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 
A Survey of Container Security in 2016: A Security Update on Container Platforms
A Survey of Container Security in 2016: A Security Update on Container PlatformsA Survey of Container Security in 2016: A Security Update on Container Platforms
A Survey of Container Security in 2016: A Security Update on Container Platforms
 
Deploying to Ubuntu on Linode
Deploying to Ubuntu on LinodeDeploying to Ubuntu on Linode
Deploying to Ubuntu on Linode
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production Cloud
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker Security
 
Best Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBest Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker Containers
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime Security
 
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
 
Docker Security
Docker SecurityDocker Security
Docker Security
 
Owning computers without shell access dark
Owning computers without shell access darkOwning computers without shell access dark
Owning computers without shell access dark
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
Virtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesVirtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management services
 
StorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UK
StorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UKStorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UK
StorageOS, Storage for Containers Shouldn't Be Annoying at Container Camp UK
 

Dernier

VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 

Dernier (20)

VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 

Road to Opscon (Pisa '15) - DevOoops

  • 1. Increase awareness around DevOps infra security DevOoops Gianluca Varisco @gvarisco
  • 3. DevOps is about creating a conveyor belt to systematically pull together all of the pieces that need to go into production using automation to create a safe and reliable application deployment. What is DevOps?
  • 5. How vulnerabilities get introduced Configuration errors Missing patch Coding mistakeHuman mistake (bad OPSEC)
  • 6. We learned (the HARD WAY) that DevOps is more than giving root to developers…. alias devops=sudo
  • 8. 01 GitHub 02 RCS tools 03 CI tools 04 AWS config files 05 Client provisioning tools 06 Elasticsearch 07 In-memory databases Agenda 08 Docker
  • 10. It does support “advanced” search operators, eg. • extension:conf ftp server configuration • extension:pem private • extension:xls mail • extension:sql mysql dump • extension:php “preg_replace(“/(.+)/e” (RCE) • OSINT (within companies’and employees’repos) GitHub - Search
  • 11. Pushing code to GitHub as Linus Torvalds? GitHub – Impersonating others People trust pictures!
  • 12. • Hey, look! Linus is the main committer of my github.com:gvarisco/swag.git repo! • Sad truth! Design flaw or targeted feature? Official response below.. GitHub – Impersonating others / 2
  • 13. • Always audit who has access to your repos • Be suspicious of pull requests with other authors’ code within the PR. • Always delete a private fork of a private organization repository if a member leaves your organization. • Audit organization members for 2-step verification GitHub – Learnings / TODOs
  • 15. Does your website expose the .git/ folder on a webserver out there? § Access to such content lets you downloadthe full source code § tl;dr: NO, Turning DirectoryIndex (Apache)/ autoindex (nginx)ON/OFF is NOT the fix! .git exposure
  • 16. • Source code, config files, credentials,developernames, public/private keys,SSLcertificates, e-mail addresses,etc. • Repo HISTORY(security issues fixed,password wrongly committed and removed later) • Archives / backups {My,Postgre,XYZ}SQLdumps • Session generationkeys .git exposure / What can you get?
  • 17. • $ mkdir website-source-code • $ cd website-source-code • $ wget –mirror –include-directories=/.git http://www.example.com/.git • $ cd www.example.com • $ git reset –hard HEAD is now at […] .git exposure / DirectoryIndex ON
  • 18. • Git-fsck to the rescue! • Bruteforce: Predictable file names and known object hashes, etc. • DVCS-{Pillage,Ripper} do it for you • Many admins tend to answer either 403 or 404 for .git/ but .git/configworks just fine. • Git stores file information withinthe objects folder. .git exposure / DirectoryIndex OFF
  • 19. • See the SHA-1 for index.php: • $ git cat-file –p master^{tree} • Take the SHA-1 and give it to ‘git cat-file’to print out the file contents: Abusing the .git/ Objects folder
  • 20. • 1.6.x and earlier • Check for .entriesfiles • Walk SVN chain to retrieve all files. Metasploit does it for you (auxiliary/scanner/http/svn_scanner) Subversion 1.6.x
  • 21. • 1.7.x uses SQLite. • Metasploit’s auxiliary/scanner/http/svn_wcdb_scanner to the rescue! It will retrieve SVN’s wc.db for you • As we know the file name and the SHA-1 used, we can map all files. Subversion 1.7.x
  • 22. $ sqlite3 wc.db 'select local_relpath, ".svn/pristine/" || substr(checksum,7,2) || "/" || substr(checksum,7) || ".svn-base" as alpha from NODES;’ index.php|.svn/pristine/4e/4e6a225331f9ae872db25a8f85ae7be05cea6d51.svn-base style/style.js|.svn/pristine/2s/2cc5590e0ba024c3db77a13896da09b39ea74799.svn-base ... $ wget -O - http://www.example.com/.svn/pristine/4e/4e6a225331f9ae872db25a8f85ae7be05cea6d 51.svn-base <?php Subversion 1.7.x
  • 24. • The leading open-source continuous integrationserver. • Built in Java, it provides 985 plug-ins to support buildingand testing virtually any project. • Latest and greatest release: 1.633 • A “few” security advisories… Jenkins
  • 25. Jenkins – Searches on Shodan
  • 26. • Metasploit modules: • auxiliary/scanner/http/jenkins_enum (It enumerates a remote Jenkins installationin an unauthenticated manner, includinghost OS and Jenkins installationdetails) • exploit/multi/http/jenkins_script_console (It uses the Jenkins Groovy script console to execute OS commands using Java.) • If no authenticationis required,it is trivialtogain remote code execution via script console. Abusing Jenkins
  • 27. • Wanna display jenkins’user private SSH key? No problem! It is as simple as executing: printlnnew ProcessBuilder('sh','-c','cat /Users/batman/.ssh/id_rsa').redirectErrorStream(true).start().text Abusing Jenkins – Script console
  • 28. • Last, but not least: • If you have access to /view/All/newJob,create new builds and run commands. • Browse WORKSPACEs, read config / folders containingsensitive data, eg. credentials,API keys Abusing Jenkins
  • 30. • ALL credentials are stored in plain-text in “”hidden files””,eg. /home/gvarisco/.foo/bar • Typicallyprivilegedaccesses • Once credentials are found, any of the OSS libraries available out there can interact withAWS (eg. Nimbostratus,AWS CLI tools) • OSINT / Informationleakage via GitHub, Pastebins,etc. AWS config files
  • 32. • If you expose a dashboard (eg. PuppetBoard/PuppetDB) be careful with your custom FACTS • Encrypt your sensitive YAML files’information(if you use HIERA, a key/value lookup tool for config data) with HIERA-EYAML • It does provide asymmetric encryption of sensitive data • Store the keys securely when using puppet, as only the puppetmaster needs access to them in order to perform decryption when the agent runs on a remote node Puppet
  • 34. • Web Interface (Chef Server),Rails powered, uses admin/ p@ssw0rd1 as default credentials Chef
  • 35. • Databags items (eg. MySQL data) can be encrypted • Use knife – a cli tool that provides an interface between a local chef-repo and the Chef server Chef
  • 36. • Did you change your SSH keys? • Vagrant 1.7+ embeds vagrant-rekey-ssh plug-in Vagrant
  • 37. • Common user/passwords: root/vagrant OR vagrant/vagrant • NO pass to sudo L Vagrant
  • 38. Vagrant – Scans using the default private key
  • 39. • Vagrant workflows encourage you to edit your code outside the VM. • That’s why it helpfully shares the project directory as /vagrant/ in the VM. “Put evil things in /vagrant/.git/hooks/post-commit and wait for the user to commit some code. Since the /vagrant/ directory is mounted from the host, such hook will persist even if the user destroys the VM.” Vagrant – breaking in!
  • 40. • Root passwords are either set: • During installation • Crypted hash defined in the KS file (rootpw –iscrypted) • Clear text defined in the KS file (rootpw –plaintext) Kickstart files (Red Hat, CentOS, …)
  • 42. • A distributed full-text search engine with a RESTful web interface and schema-free JSON documents • 9200/TCP (GET request shows version) • No authentication • Can search stored data via HTTP API • Update data with PUT requests • Join an existing, open cluster and get all the data • REMOTE CODE EXECUTION prior to 1.2.0 Elasticsearch
  • 43. • Own a server with a query like this (as the search function allows dynamic scripts execution): • 1.3.x adds a sandbox to control what classes and functions can be executed. • Add ‘script.disable_dynamic: true’ to your elasticsearch.yml • Make sure your instance is only binding on localhost Elasticsearch
  • 44. Elasticsearch – read inside /etc
  • 46. • Default config comes with: • NO encrypted communication • NO credentials • 6379/TCP • Binds to all interfaces Redis
  • 47. Redis – Shodan results
  • 49. • FLUSHALL (Remove all keys from all databases) • SCRIPT LOAD • EVAL / EVALSHA Redis – “Funny” commands
  • 50. • Free & open-source • High-performance, distributed memory object caching system • Fun things get put into memcache • SECURE IT: • First and always, FIREWALL • Check your bindings (interfaces) • If you need it, use SASL • DO NOT RUNAS ROOT Memcache
  • 53. • It automates the deployment of applications insidesoftware containers • Docker works as a client that communicates with a daemon process (dockerd) via a Unix domain socket called /var/run/docker.sock • Highly privileged, effectivelyhaving root access Docker
  • 54. • Error: # docker run -t -i -v /var/run/docker.sock:/var/run/docker.sock • PoC: • The container gets a docker client of its own, pointed at the /var/run/docker.sock • The container launches a new container mounting / on /host (It’s the host root filesystem, not the first container’s) • The second container chroots to /host, and is now effectively root on the host.. Don’t expose the Docker socket!
  • 55. Video
  • 56. • Add authentication to Jenkins • Make sure all your tools / systems are only available from/to hosts that need it • Change default private keys / credentials EVERYWHERE • Update to latest versions of all your devops tools And now what?
  • 57. • Don’t push DevOps back but rather embrace it. • Participate in or create cookbooks/modules/scripts for security • Check for known security items you don’t want going into production by creating audit scripts Go forward
  • 59. • Ken Johnson • Chris Gates • Laurens Van Houtven • Rocket Internet’s Security Team Credits
  • 60. © 2015 Rocket Internet SE. All rights reserved.