Building a DevSecOps Pipeline
Around your Spring Boot
Application
Spring One Platform, 2019

Simon Maple
@hayleydenb
Building a DevSecOps Pipeline
Around your Spring Boot
Application
Spring One Platform, 2019

Simon Maple

Hayley Denbraver
@hayleydenb
Send Simon nice tweets:
@sjmaple
@hayleydenb
Hello
@hayleydenb
Hayley Denbraver
Developer Advocate, Snyk

@hayleydenb

snyk.io
@hayleydenb
FYI
¯_(ツ)_/¯
@hayleydenb
DevSecOps for Spring Boot
@hayleydenb
DevOps
@hayleydenb
We all love DevOps!
But Why?
@hayleydenb
DevOps helps deliver value and
address market needs faster and
at scale
@hayleydenb
What does “doing DevOps”
mean?
@hayleydenb
•DevOps Technologies

•DevOps Methodologies

•DevOps Shared Ownership
@hayleydenb
DevSecOps
@hayleydenb
•Securing DevOps Technologies

•Security in DevOps
Methodologies

•Including Security in DevOps
Shared Ownership
@hayleydenb
•Securing DevOps Technologies

•Security in DevOps
Methodologies

•Including Security in DevOps
Shared Ownership
@hayleydenb
Securing DevOps Technologies
DevOps Created or Drove Adoption of new Technologies
Cloud Containers Serverless
Open
Source
Libraries
@hayleydenb
Securing DevOps Technologies
The adoption of these new technologies
create two main security problems.
@hayleydenb
Problem 1:
How do we adapt our current tools
to protect our DevOps projects
@hayleydenb
@hayleydenb
@hayleydenb
@hayleydenb
Another trouble maker:
containers!
@hayleydenb
How do you identify malware
or viruses in a container?
@hayleydenb
End Point Protection via Container Host
How do you “patch your servers” in
an ad-hoc, disposable container?
@hayleydenb
Scan Container images for OS Vulnerabilities
@hayleydenb
The need to adapt is an
opportunity for new players
@hayleydenb
Problem 2:
New technologies introduce new security
risk that require new security solutions.
@hayleydenb
Cloud introduces the risk of
unsecured buckets at an
unprecedented scale.
@hayleydenb
An Example
• Consider Uber’s 2016 data breach

• Attackers accessed the details of nearly 600,000 drivers

• “Some personal info” on nearly 57 mil users was also compromised
@hayleydenb
What happened?
• Dev pushed S3 tokens to a private GitHub repo

• Attackers gained access to repo, obtained tokens

• At the time, Uber wasn’t using 2FA

• Attackers used tokens to steal info from S3
@hayleydenb
An Interlude
Please Use 2FA/MFA. Please.
@hayleydenb
@hayleydenb
New platforms also mean new
insecure configuration risks
@hayleydenb
Default does not mean best
@hayleydenb
Insecure Config Breaches
Cloud Security Config
Static and Event Scan
@hayleydenb
New risk from containers:
Sandbox escaping!
@hayleydenb
@hayleydenb
Security for DevOps Technologies
1. Adapt existing tools to new tech

2. Create new tools to address new problems
@hayleydenb
•Securing DevOps Technologies

•Security in DevOps
Methodologies

•Including Security in DevOps
Shared Ownership
@hayleydenb
Security in DevOps Methodologies
CI/CD

Microservices

@hayleydenb
Traditional Approach
• Write code for the added functionality

• Turn code over to security for a review

• Wait

• Receive notes and issues from security that you must address

• Redo a bunch of work to address changes. Play a prank on your security reviewer to vent your
feelings. 

• Now it is Thanksgiving, so no one is around so wait some more

• Release 

• Profit???
@hayleydenb
Continuous Integration/
Continuous Delivery
@hayleydenb
Continuous Integration/
Continuous Delivery
@hayleydenb
Continuous Integration/
Continuous Delivery
@hayleydenb
• You keep your traditional security review and it causes a bottle neck in
your CI/CD process meaning you don’t really get the benefits from CI/CD

• You scrap the security review/or say you will do it later because you are
moving too fast

• You find a way to practice Continuous Security
@hayleydenb
Automated App Sec Testing
• We can automate app sec testing!

• There are a few different ways to approach this. 

• Let’s talk about static and dynamic testing.
@hayleydenb
Static Testing
• Scan your code to find potential vulnerable code paths
• Scans take hours (or days) to run != builds take minutes

• Adaptation: incremental scans
• Run long scans ~weekly
• Run “Delta” scans in the build

• Still a problem with false positives… different topic!
@hayleydenb
Dynamic Testing
• Tests a deployed instance like a hacker to find vulnerabilities
• Scans require dedicated env… often doesn’t exist.
• Scans take way too long to complete

• Adaptation:
• IAST - instrument app, run unit-tests, deduce security issues
• Less comprehensive, but works with less overhead
• Very imperfect… but sometimes work
@hayleydenb
Open Source Known Vulnerabilities
• Flag use of libraries with known vulnerabilities
• “Break build” on vulnerability or otherwise alert
• Fast & accurate - naturally CI/CD friendly…
@hayleydenb
Microservices
@hayleydenb
- Clear perimeter
- Constrained flow
- Wholesale deploys
- Many perimeters
- Flexible flow
- Constant deploys
@hayleydenb
Adaptions
• Adaptation: Track data flows across apps
@hayleydenb
Adaptions
• Adaptation: Embed installation into deploy flow
@hayleydenb
Opportunities
There are positive changes too
@hayleydenb
Opportunities
When a container misbehaves… 

Just kill it!

(It’ll start up again in no time)
@hayleydenb
Opportunities
Continuous Deployments mean
Fast security patch deployment!

(contain risks faster and more safely than ever)
@hayleydenb
Opportunities
CI/CD means easy
Automated security gating!

(block secrets or vulns from passing, enforce policies, etc.)
@hayleydenb
Security in DevOps Methodologies
• Adapt current security practices

• Take the opportunity to leverage
automation and do security better

@hayleydenb
•Securing DevOps Technologies

•Security in DevOps
Methodologies

•Including Security in DevOps
Shared Ownership
@hayleydenb
DevSecOps includes security
in the ownership model
@hayleydenb
The Syrian Electronic Army and
the Financial Times
@hayleydenb
1. Phishing email to employees who

had publicly shared their email
Masked link to an 

attacker controlled

compromised site
@hayleydenb
Developers were the 2nd most likely
to click a link in a phishing email
Internal Salesforce Phishing Test

run by Masha Sedova (@modMasha)
@hayleydenb
Compromising a

high privileged developer 

is hitting the jackpot
@hayleydenb
2. Link redirects to 

spoofed FT Single Sign-on

page (for Google Apps)
Some users entered their passwords…
@hayleydenb
3. Attackers use compromised accounts to 

Email more FT users

this time from an FT email address
More users are compromised…
@hayleydenb
4. IT finds out, sends warning email to all.

Attackers send identical email - with evil links
@hayleydenb
5. Attackers gain access to several

official Twitter accounts and blog
@hayleydenb
“A sobering day”

by Andrew Betts, 

a compromised FT developer
@hayleydenb
“Developers might well think they’d be wise to all this
– and I thought I was.”
https://labs.ft.com/2013/05/a-sobering-day/
@hayleydenb
DevOps means developers are
more powerful than ever
@hayleydenb
• Code is shipped at a fast pace

• Developers access production systems daily

• Developers access user data daily
@hayleydenb
100:10:1
@hayleydenb
Developers cannot 

outsource security.
Nobody else can keep up.
@hayleydenb
Developers believe

dev should (co)own security
Source: State of open source security

https://snyk.io/blog/81-believe-developers-should-own-security-but-they-arent-well-equipped/
68% of users feel 

developers should own security
responsibility of container
images
Security tools are designed for
security professionals
@hayleydenb
Find or build security tools that
developers will use
@hayleydenb
Challenge:
Security embraces Dev

Dev Embraces Security
@hayleydenb
Security
• Provides devs with the tools (Dev tools!) and training they need to succeed

• Sets a clear policy that is well documented, actionable

• Acceptable vs. Unacceptable risk

• Prioritization: What gets flagged vs. what fails the build

• How are team members onboarded?

• Available to support the team as security issues arise

• Make issues actionable
@hayleydenb
Developers
• Use tools provided

• Ask good questions and give feedback. 

• Understand and embrace the policy

• Don’t fall into the SEP Field Trap
@hayleydenb
–Douglas Adams, Life, the Universe and Everything
“The Somebody Else's Problem field is much simpler and more
effective, and what's more can be run for over a hundred years on a
single torch battery. This is because it relies on people's natural
disposition not to see anything they don't want to, weren't expecting,
or can't explain.”
@hayleydenb
Security in DevOps Ownership
• Find a tool or tools that
developers will actually adopt

• Look for ways to engage devs in
security 

@hayleydenb
DevOps helps 

deliver value and adapt to market needs

faster and at scale
@hayleydenb
1. Securing DevOps Technologies
2. Security in DevOps Methodologies
3. Include Security in DevOps Shared Ownership
@hayleydenb
Security For DevOps Technologies:
1. Adapt existing security tools to new tech
2. Address new security risks new tech introduced
@hayleydenb
Security For DevOps Methodologies:
1. Adapt how existing security tools are applied
2. Use the new opportunities to do security better
@hayleydenb
Include Security in DevOps Shared ownership:
1. Find security tools dev will actually use
2. Look for ways to engage dev in security
@hayleydenb
To Close
@hayleydenb
Java Security Resources
@hayleydenb
Java Security Resources
@hayleydenb
Java Security Resources
@hayleydenb
Thank You!
Hayley Denbraver, Developer
Advocate

hayley@snyk.io
@hayleydenb

Building a DevSecOps Pipeline Around Your Spring Boot Application