Join the conversation #DevSecCon
Security Testing for
Containerized Apps
@omerlh
@SolutoEng
http://lolcode.org/
- Helping people get the most out of their technology
https://www.solutotlv.com/
You Can’t Do it Alone
Letting Go Responsibly
AppSec @ Soluto:
● Threat Modeling
● Empowering
● Education
● Automation
Our Quest: Securing Containerized Apps
Code
Dependencies
Docker Image
Layers of Containerized App
What kind of security tests?
● Static
● Dynamic
● Integrated (which will be ignored)
By Using ONLY FOSS tools
Static Analysis
What?
● Scanning static assets (e.g. source code)
● Language aware
● Different Tools for different layer
● Point where is the issue
Code
Dependencies
Docker Image
Code Layer
● Scan the code for vulnerabilities
● Different tools for different languages
● Bandit – Python
● Brakeman – Ruby on Rails
● Find Security Bug - Java
● TSLint - TypeScript
● OWASP Source Code Analyzers list
Code
Dependencies
Docker Image
Example
https://snyk.io/blog/node-js-timing-attack-ccc-ctf/
Dependencies Layer
● 3rd party code used by the app
● Usually installed by a package manager
● PyPi, Gem, NuGet, NPM
● Each dependency might include known vulnerability
● OWASP Top 10 A9
● OWASP Dependency Track
Code
Dependencies
Docker Image
https://snyk.io/stateofossecurity/
NPQ
Docker Image Layer
● Contains the “OS”
● 3rd party software installed
● App engine (NodeJS/.NET Core etc)
● Each one could contain known vulnerabilities
● Multiple open source solutions
● Clair, Anchore, OWASP Dependency Track
Code
Dependencies
Docker Image
https://www.banyanops.com/pdf/BanyanOps-AnalyzingDockerHub-WhitePaper.pdf
Playing with Anchore-Engine
Dynamic Analysis
What?
● Scanning live app
● Language agnostic, protocol aware
● Only detect issues, not what cause to them
● Simple by using OWASP Zap
● Passive
● Active
● Leveraging Docker for local run
Code
Dependencies
Docker Image
Passive Scan
● Proxy black box tests
● Scan HTTP requests/responses
● HTTP static analysis
● Looks for security issues
● Fast, not risky
Code
Dependencies
Docker Image
Active Scan
● Discover all endpoint
● Craft malicious requests
● Test that the server can handle those request
● Slow, could cause damage
Code
Dependencies
Docker Image
Bringing it All Together
Building our CI/CD Pipeline
❑ Break the build or it didn’t happen
❑ False positives
❑ Keep it DRY
❑ Easy
Let’s add some Glue
The ”DevSecOps Tool”
Building our CI/CD Pipeline
✓ Break the build or it didn’t happen
✓ False positives
✓ Keep it DRY
✓ Easy
Image Certification
Only images that passed all the tests should be used on production
● Build dependency
● Image labels
● Image signing
● Image policy
What we have @ Soluto?
● Static analysis
✓ Source code scan
❑ Dependencies scan (in progress)
❑ Image scan
● Dynamic analysis
✓ Passive
❑ Active (in progress)
Demo Time
All the code is on GitHub
Testing LolCode App
● Static analysis?
✕ Nothing for source code
✕ No package manager (which is good?)
❑ Image scanning
● Dynamic analysis
✓ Passive
❑ Active
Let’s see it Live!
Hope it will work
… else I’ll show you slides with screenshots 
Wrapping Up
What we discussed
● Layers of Containerized Applications
● Kind of Tests & FOSS Tools
○ Static (OWASP Dependency Track)
○ Dynamic (OWASP Zap)
● Building the pipeline
○ OWASP Glue
○ Image Certification
Where Do I Start?
Our Quest: Securing Containerized Apps
Questions?
Resources
• TechBeacon: Security Tests for Containarized Applications
• Guide: Dynamic Security Testing with OWASP Zap
• Post: Dynamic Security Testing Made Easy
• Slides: Getting Started with OWASP Glue
Join the conversation #DevSecCon
Thank You!
@omerlh
@SolutoEng

DevSecCon Tel Aviv 2018 - Security Testing for Containerised Apps by Omer Levi

Editor's Notes

  • #2 My name is Omer, leading AppSec efforts at Soluto for the past 3 years Thank the organizers Who here is doing AppSec for her living? I’m also a coder, coding for the last 10 years Who here is willing to help me with code review?
  • #3 Who here is confidence enough in her review and think I can put this code in production? Lolcode is an esotirc languge, but I’m using it to explain a real pain we are facing at Soluto.
  • #4 How we help with technology
  • #5 This is a map of all the technologies we’re using, this is really wide stack. To me, reading a code in Go, elixir or F# is challenge like Lolcode – this is a code in a languge I am not familiar with, and it will take me some time to be able to read it. And this is a problem I’m facing as AppSec person, and I know from other company that our situation is not unique. Developers try to choose the best tool for the job, not what we the security teem know. And this is a challenge. We can try to increase the AppSec team but this is not scale, and not simple We can try to block the devs, and choose for them what to use – but we don’t have the right context for that
  • #6 We just need to let it go, we need to accept this situation and try to think how we can empower developers and let them choose whatever technology they want, without introducing new risks. And this is a great challenge I am facing, and I’m sure I’m not the only one. The question is how.
  • #10 Emphasis this is the plan we started with, and it’s WIP
  • #13 https://www.owasp.org/index.php/Source_Code_Analysis_Tools
  • #14 A real example of timing attack due to insecure equals Something easy to miss, but easy to spot using static analysis We had real issue at Soluto that caught by using TSLint 
  • #16 Show how many packages available Say something about the rise
  • #21 Specify that not use it for now
  • #28 Openapi/swagger