Top Banner
Iterative Security: Secrets Management When You’re Not Ready For Vault [email protected] @tmclaughbos
76

Iterative Security: Secrets when you're not ready for Vault

Jan 21, 2018

Download

Internet

Tom McLaughlin
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Iterative Security:Secrets Management

When You’re Not Ready For Vault

[email protected] @tmclaughbos

Page 2: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Who is this guy up here?His headshot is lasers and a cat

Page 3: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

I’m Tom!• Community Engineer at CloudZero

• Previously infrastructure engineer with a focus on automation.

Page 4: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Background & BiasesWhere I’m coming from

Page 5: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Background & Biases: I like startups

Page 6: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Background & Biases: I like startups

Page 7: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Background & Biases: Engineering is just a title

Page 8: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Does this look like you?

Page 9: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

There is a lot of work to be done each day

Page 10: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

For many of us, this ends up as reality…

Page 11: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

We have all this technology! So why does these problems still exist?

Page 12: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

How we present security

Page 13: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Security ParalysisI don’t know what to do

Page 14: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Security things you in ops might end up responsible for

• Access controls • How much is too much access?

• Password policies • How often should I force password rotation? • Wait, NIST has changed their recommendation? Don’t force

rotation? • Patching • Do I patch immediately on every vendor release or test first?

• and more…

Page 16: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

I am not a “security person”

Page 17: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Iterative SecurityStarting and progressively improving your security stance

Page 18: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Why is security hard for us?

Page 19: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

OMG SECURITY!!!

Page 20: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Things we get excited about with security

Page 21: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Things we get excited about with security

0-Days!!!

Page 22: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Things we get excited about with security

Hash collisions

Page 23: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Things we get excited about with security

What the CIA/NSA/DoD has

Page 24: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Things we get excited about in security

Logos

Page 25: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Things we don’t get excited about with security

Page 26: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Patching!

Page 27: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Not leaving MongoDB exposed to the internet with weak credentials

Page 28: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Not leaving Elasticsearch exposed to the internet with weak credentials

Page 29: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Learning from our mistakes

Page 30: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Many of us focus on the wrong things

http://www.littlebobbycomic.com/projects/week-115/

Page 31: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

How we present security

Page 32: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

What we should be teaching

•What are you trying to do? •Where do you start? • How do you progress

Page 33: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

There’s a lot of info at the extremes

Page 34: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

But this is where many of us are

Page 35: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

We know not to…

Put passwords, API keys, tokens, etc. in code.

Page 36: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

But it still happens…

Page 37: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Where do you go from here?

Page 38: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Developing a threat model!

Page 39: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Be Realistic

Page 40: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

USB sticks are a bigger threat than the man in the ceiling

Page 41: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

A breach probably won’t end business

Page 42: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

What are we trying to protect?• Intellectual property • Customer data (data about who our customers are) • Customer’s data (data from our customers) • etc.

Page 43: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

What does our architecture look like?

Page 44: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Decompose the system

Page 45: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Decompose system: Perimeters

Page 46: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Decompose system: Data pipeline

Page 47: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Decompose system: Data pipeline

Page 48: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Identify threats

• Exposed network ports (network) • Unpatched EC2 instances (host) • Weak secrets management(application) • User submitted data (application) • etc.

Page 49: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Document Threats• Weak password management • At two points in our infrastructure we’re not managing

passwords • Both points involve highly valuable assets • Breach would be bad • Reputation loss -> customer loss • Data could be leveraged against our customers

Page 50: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Rate Threats

Risk = Probability * Damage Potential

Page 51: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Rate Threats• D: Damage potential • R: Reproducibility • E: Exploitability • A: Affected users • D: Discoverability

https://en.wikipedia.org/wiki/DREAD_(risk_assessment_model)

Page 52: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Rate Threats• D: Disaster if this is found (high) • R: Easy to reproduce (high) • E: Easy to exploit; requires existing access (medium) • A: Affects all users (high) • D: Not easy to find; users are hops away from issue (medium)

Page 53: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Putting a response into action

Let’s manage those secrets

Page 54: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Constraints

Time Complexity Risk

Page 55: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Constraints: Time

Page 56: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Constraints: complexity

Page 57: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Constraints: Risk of failure

“It’s all code… We monitor it using Nagios.”

Page 58: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Constraints• Time: Few days to a few weeks • The faster we get this done the more likely we will finish.

• Complexity: We’re going to go with what we know. • Less surprises. • Less to learn and get wrong.

• Risk: Taking only as much risk as we’re ready for. • We’re moving fast! • Let’s limit the failure blast radius

Page 59: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Approaches to get you started

Finally we secure some secrets

Page 60: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

git-crypt• Encrypts secrets directly in your repository • Find secrets, rotate, and store them

https://github.com/AGWA/git-crypt

Page 61: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

git-crypt• Pro • You’ve done the exercise of auditing your code base

• Cons • Symmetric encryption • Everyone needs the master password

• TODO • Prevent key proliferation • Move to new secrets management when ready

Page 62: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Configuration Management: Puppet• Hiera-eyaml: Encrypt values in your Hiera hierarchy • Can use public key encryption • Multiple backends

https://github.com/voxpupuli/hiera-eyaml

Page 63: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Configuration Management: Puppet• Pros • You’ve centralized your secrets in one repo. • Public key encryption support

• Cons • May require manual intervention when rolling Puppetmasters. • May need to cleanup your Puppet code if you haven’t already

moved to Hiera. • TODO: • Figure out master rekey strategy

Page 64: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Configuration Management: Ansible• Ansible Vault: Encrypts entire var files in playbook

http://docs.ansible.com/ansible/playbooks_vault.html

Page 65: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Configuration Management: Ansible• Pros • You’ve done the exercise of auditing your code base

• Cons • Symmetric encryption • Everyone needs the shared password • key proliferation

• TODO • Preventing the proliferation of the Vault key • rekeying and rolling secrets.

Page 66: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

S3 Buckets• Sneaker • Encrypt, store, and retrieve secrets from S3.

https://github.com/codahale/sneaker

Page 67: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

S3 Buckets• Pros • Secrets no longer live in repos • reduced secret proliferation

• Secrets encrypted in S3. • Cons • How are you managing S3 buckets?

• TODO • Manage your S3 buckets with CloudFormation, Terraform, etc.

https://github.com/codahale/sneaker

Page 68: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

What should we have gotten out of all this?

Page 69: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Less this…

Page 70: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

…More this!

Page 71: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

YOU CAN DO THIS!

Page 72: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Thank You!http://strayc.at/feedback

Page 74: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Threat Modeling: startup edition

https://twitter.com/CommitStrip/status/876830310780071936

Page 75: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

Threat Modeling: startup edition response

https://twitter.com/ErrataRob/status/876963608076439556

Page 76: Iterative Security: Secrets when you're not ready for Vault

[email protected] @tmclaughbos

We know what not to do. We (think) we know where we want to be.

But we don’t know how to get there.