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
❑ Ownership
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
✓ Ownership
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

Security Testing for Containerized Applications

Editor's Notes

  • #2 Thank the organizers Who here is doing AppSec for her living? Who here is willing to help me with code review?
  • #4 How we help with technology
  • #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