Introduction to SecDevOps!
Best practices for securing large scale Devops environments. Introducing security earlier in the CICD pipeline.
Devops Engineer for Versent. Speaking for myself.
This talk is dedicated to
Segment-your-network Woman
and Patch-your-shit Man!
This talk is heavily focused on the cloudy AWS heavy environments.
Similar patterns can be used in similar "Cloud Orchestrator" Tools
HarshiCorp Terraform, OpenStack Heat, Atlas and others.
Everybody has their own view on what DevOps actually means to them.
My loose interpretation of "DevOps" is the idea of
source control, testing, deployment and code reuse ;)
Development
Operations
Security
Deployment
Infracode
Test early. Test Often. Fail quick.
Developer Duck
Commits to Git
Jenkins Triggers
Builds Application
Jenkins Triggers
static code analysis
Checkmarx pvs-studio coverity
3
1
2
Unit Tests
Developer Duck
Commits to Git
Jenkins Triggers
Builds Application
Cloudformation
Builds Infra
App Deployed
on SOE
Jenkins Triggers
Builds staging
3
1
2
New environment
on trusted SOE
on 'production' infracode.
Developer Duck
Commits to Git
Jenkins Triggers
Builds Application
Cloudformation
Builds Infra
App Deployed
on SOE
Jenkins Triggers
Builds staging
Arachni Vega
Zap Selenium
Jenkins Triggers
Security scans
3
4
1
2
Scope, coverage and automation
Reporting/Alerts for automated scanning tools?
Static Application Security Testing (SAST)
Static Code
Dynamic Application Security Testing (DAST)
Security Scanners
Interactive Application Security Testing (IAST)
ModSecurity/WAF
Weirder shit
Fuzzing
Scope, coverage and automation
Reporting/Alerts for automated scanning tools?
External Network Scans
nmap
Internal Network Scans
Nessus
Third party tools
Qualys SSLtest
Scope, coverage and automation
Reporting/Alerts for automated scanning tools?
Reduplication? Delta reports?
Continuous reporting? Alerting?
No idea about that stuff.. ELK maybe?
Talk to me if you have any experience with this stuff.
Maintain a solid git repository for as much as possible: Application Source/infracode/Jenkins/enviromental data.
For the following examples - Assume the following:
Each of these Repos are accessible from inside the VPN
to people in the correct LDAP security groups.
+ Read-only access is given as required.
ALL GLORY TO (INSERT OR UPDATE)!
The "Hardened" SOE is the sidekick of "patch your shit man"
All of my AWS environment servers are based on a single AMI.
1) Harden single RHEL 7.2 gold release and
utilise in Dev,Test,Pre-Prod and Production.
2) Build AWS launch configuration userdata scripts
to maintain your freerange bespoke instances, built on SOE.
AWS RHEL Packer Serverspec SOE
Tools: Packer by Hashicorp
Tweaking /etc/sysctl.cfg, confirming timezone, installing bastion keys (revoking older keys), run openscap-scanner
Tools: ServerSpec
Test suites meant to be run against machines
"Dev put AWS keys on Github. Then BAD THINGS happened" - Darren Pauli
Seperate the business functions
into different accounts inside AWS.
Seperate roles in each account to protect against stolen sessions!
Restrict functionality as required.
@dagrz loves popping AWS
Cloudformation allows for the creation of new VPC and Subnets inside these VPCs easily.
Public subnets can be accessible from internet facing addresses
Private subnets can be accessible from public devices
Restricted can ONLY be accessed by private services with the correct security groups!
Preprod Production
Consider: Build new instances for each new version, Respond rapidly to security issues and reduce the risk of cowboys bugs.
Plus, existing ELBs are prewarmed from existing environment - Rolling upgrades work for webapps/api/microservices.
KEEP YOUR PASSWORDS OUT OF THE SOURCE CONTROL FOR THE LOVE OF CHRIST! YOU GOD DAMN SAVAGES!
Tools: Credstash/Unicreds
KMS and Credstore dynamodb
Limit write access to passwords
KMS and Credstore dynamodb
Limit read access to passwords
I love Jenkins, but it's a
perfect place to get persistence.
Using Jenkins Job Builder, I've moved on Jenkins code into the infracode repository.
Jenkins is read only and all modifications must be completed during the GIT repo.
Pull Requests preferred! :D
ImageTragick is an easy example of untrusted code running on production environments leading to RCE.
NEVER TRUST USER DATA!
PUT IT ALL IN THE LOGS!
https://codeascraft.com/2011/02/15/measure-anything-measure-everything/
Can't afford an Threatbutt Advanced Enterprise Platform licence?
After all of the low hanging fruit has been found, it's time to give the professionals a call. You're going to have missed something!
Upright and proud
Thank you!
Questions?