36
Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization Andrey Labunets Engineering security, making trade-os at Facebook Defensive Track, Zeronights 2017 A moderately inspiring keynote

Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Bootstrapping secure by design processes in a low-process, peer-to-peer engineering

organizationAndrey Labunets

Engineering security, making trade-offs at FacebookDefensive Track, Zeronights 2017

A moderately inspiring keynote

Page 2: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Why I am hereZeronights CFP: new attacks, techniques, bypasses, exploitation

Is defense still uninteresting?

Page 3: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Key points of this talk

• Offense is saturated with ideas, but not defense

• Defense work is unique, but its role is underestimated

Page 4: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

ContentsIntro. Basic blocks: secure by design, constraints, agile

Theory. Secure by design, constraints, and agile are hard to combine

Practice. Bootstrapping secure by design processes in a low-process mode

Exploratory. Product security at scale

Page 5: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Intro. Basic blocks: secure by design, constraints, agile

Page 6: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Secure by design

•System should be built with security in mind from the ground up

•Security engineers are involved on early phases:

•Requirements

•Architecture / design

•Most annoying part of any secure development methodology

•Once chosen, architecture/design are hard to roll back

Page 7: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Constraints & trade-offs

1 security engineer per 20 products

CPU usage not more than N%

Uptime 99,999%

Encryption at the cost of performance

Fail-closed ACL at the cost of availability

End-to-end encryption at the cost of fraud detection

CAP theorem

…etc

Constraints on1 parameter

Constraints on2 parameters

Constraints on3 parameters

Technical

Organizational

Page 8: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

• Real constraints are defined in a multidimensional parameter space (performance, reliability, usability, delivery time, etc)

• Dependencies are complex and hardly expressed analytically

• Design is choice within the given constraints

Naive example: a trade-off between A and B

Page 9: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

System’s constraints are often invisible to anyone except its architects

Page 10: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Agile

•Early delivery

•Simultaneous phases

•Continuous improvement

•Adaptive planning and A/B tests

Page 11: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Theory. Secure by design, constraints, and agile are hard to combine

Page 12: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Secure by design and organizational constraints

• Mandatory audit for all changes is at the cost of blocking requests

• The more audit layers - the more operational risks

• Strict policy has a limited resource of no

• Test / static check infra should not become stale, or it will be bypassed

• Organizational complexity, same as systems complexity, accumulates rapidly

Page 13: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Secure by design and technical constraints

• Q: put an access control here? hmac is just a line of code

• A: Clients are 3rd-party consumer hardware, new segment url format crash some % of them

• Reducing technical risks at the cost of reliability and more business risks?

• At our scale, we can’t afford saying “it’s their problem”, we need an optimal solution for the platform

Page 14: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Secure by design and agile: asymmetry of change and effect

Sets of properties Implementations

• Every small code change can redefine the properties we need and the properties are held

• Every new property can be a huge change in implementation

Page 15: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

• Phases collapse in agile, borders between one-line change and a new product dissolve

• Every small code change can redefine the properties we need and the properties are held

• Every new property can be a huge change in implementation

• Protocols, state machines, network, architecture, logic are the most hardcore in agile

• Need to workaround the asymmetry

• Avoid security/engineers slowing down each other

Secure by design and agile: asymmetry of change and effect

Page 16: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Prioritization is an improvisation

• Requirements phase: “just set a quality gate and never relax it”

• Ok, Let’s agree on launch-blocking bugs

• Q1: What is launch?

• Q2: What’s blocking?

• Ex: CEO uses product A to announce launch of the product A and other products

• Very much of a launch, not much of a blocking

Page 17: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Product launch, awareness, and risks

Launch

CEO posts about the product

Product is announcedat a conference First security reports

Use

rs

Time8 hours

difference6 daysdifferenceN months

difference

Page 18: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Secure by design

Define secure? Define design?• Constraints, trade-offs

• Assumptions change in the process

• 3rd-party components designed/evolving separately

• Prototype-based, experiment-driven design

• Repurposed systems

Secure by design, agile, and constraints are hard to combine

Page 19: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Practice. Bootstrapping secure by design processes in a low-process mode

Page 20: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Soft skills is the new hacking

• Applying individual tools and practices depends on a situation

• Making them actually work in the given org is crucial

• Offense is a technical problem, defense is a political human logistical problem

• Implementation of a complex operation is a thing

• Social engineering does not apply either

Page 21: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Product security in Agile

Page 22: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Empathy is an nmap for humans

• Anti-pattern: “We, infosec, are smarter, we told them to secure it, but they don’t listen”

• Not our level. We can’t afford thinking this↑, because it helps no one

• What works:

• “Fingerprinting” what engineers think

• Finding a root cause

• Identifying constraints

• Fixing a problem systemically, within the constraints

Page 23: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Exploit primitives for organizations

Consulting: a limited write-what-where primitive

Security Engineer

Product Team

Page 24: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Exploit primitives for organizations

Product Team

Security Engineer

Influence: a full write-what-where primitive

Page 25: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Exploratory. Product security at scale

Page 26: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Program analysis

Given a memory read pattern, can you say what code does?Offs

et (

0x-…

)

Time

Page 27: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Program analysis

• Sometimes yes: these sequential reads suggest it’s a parser

• We don’t always need program analysis as a bug-finding or verification tool

• We can use it for recognizing system components

Offs

et (

0x-…

)

Time

Page 28: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Recognizing system components

• We can recognize components statically too

• With a 200-LoC script we find parsers in our ~30 mLoC C++ code

• Diverse codebase (different teams, frameworks, freshness, OSI layer)

• High accuracy

• Tolerable noise

• Impact:

• Quicker, more effective code audits

• Detecting attack surface changes in fast-moving codebase

• Other components we need to recognize: access controls, storage, cryptography, …

Page 29: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

• We are distracted too much by individual vulnerabilities or attacks

• Classifying systems/components, studying their lifecycle, inferring what defense works for each type is much more useful

Page 30: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

What product lifecycle

Page 31: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

What product lifecycle

Page 32: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

What product lifecycle

Page 33: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

• Life of a system is an arms-race with multiple parties: attackers, researchers, competitors, regulators

• Features and complexity are a product of an ecosystem

• Defense priority is adaptation to changing environment and survival

• We have to build security within these limitations

Page 34: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

• Offense is saturated with ideas, unlike defense

• Defense work is unique, but its role is underestimated

Page 35: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Good luck finding your ways

Page 36: Bootstrapping secure by design processes in a low-process, peer … · 2017-11-23 · Bootstrapping secure by design processes in a low-process, peer-to-peer engineering organization

Q&A