1 of 34

Introduction to TUF and Notary

Justin {Cormack,Cappos}

2 of 34

There exists an attack vector

  • When exploited has nearly unlimited privileges
  • Traditional defenses are ineffective
  • Ubiquitous
  • A failed attack often appears benign
  • Exploited by the best hackers in the world

2

3 of 34

Many Victims...

3

4 of 34

Doesn’t crypto just work?

5 of 34

SSL / TLS (online key)

Protects users from man-in-the-middle attacks

5

Repository

User

6 of 34

SSL / TLS (online key)

If the repository is compromised, the user gets compromised.

6

Repository

User

7 of 34

GPG (offline key)

  • Key distribution?
  • Separation of Trust?
  • Revocation?

7

8 of 34

Some basic attacks...

8

9 of 34

Attack: Slow Retrieval

Goal: Silently prevent a client from obtaining an update

Attack: When a client tries to update, send

at

a

very

slow

rate

...

9

10 of 34

Attack: Endless Data

Goal: Crash the software updater or the hosting machine

Attack: When a client makes a request, just send data infinitely...

10

11 of 34

Problem: Endless Data

yum package manager:

    - Used by RedHat, Fedora, and many other popular distributions

    - Updates software on Linux machines

    - Runs as root

    - Would download an update first, writing it to disk

    - Would download until the server stops sending

    - Fills the disk, crashes and prints no error.

        Can't even write the problem to the syslog!

11

12 of 34

Attack: Zip Bomb

Goal: Crash the software updater or the hosting machine

Attack: send a ZIP file designed to crash or render useless the program or system reading it

(Similar attacks exist for XML, PGP.)

12

13 of 34

Attack: Duplicate Files in Zip

Goal: Insert an arbitrary file into a package

Mechanism: List a file multiple times (one malicious, one correct). The SU may check the wrong one.

Example: Google APK

13

14 of 34

Arbitrarily Modify Updates

Goal: Run arbitrary malicious code on the device

Attack: Attacker changes software package.

Provide it in place of normal update.

Solution: Use encryption -- Not a panacea

14

15 of 34

Attack: Reverting Packages

Goal: Downgrade a package to an earlier version (likely with known vulnerabilities)

Solution: Ensure version numbers increase (unless the user requested a downgrade)

15

16 of 34

Attack: Freeze Attack

Goal: Prevent updates forever

Mechanism: Replay the last known data forever

Solution: Have an uncompromised party sign files periodically

(This is implicit for an uncompromised repository using TLS)

Clients check that the signature is not older than a certain date.

16

17 of 34

Attack: Mix-and-Match Attack

Goal: Compromise users by causing them to install vulnerable packages

Mechanism: Repo signs snapshot of released packages

17

firefox

libc-secure

libc-vulnerable

x

snapshot

firefox

libc-secure

18 of 34

Attack: Extraneous

Dependencies

Goal: Cause vulnerable or incompatible packages to be installed.

Mechanism: Replace metadata with different dependency information

Example in the wild: npm (2016)

18

firefox

libc

sendmail 1.0

+

19 of 34

Attack: Depends on Everything

Goal: DOS / wasted bandwidth

Mechanism: Replace metadata with dependencies on all packages

All packages are downloaded

19

firefox

chrome

opera

+

safari

iexplore

+

+

+

20 of 34

Attack: Unsatisfiable Dependencies

Goal: Prevent package installation

Mechanism: Replace metadata with missing / conflicting dependencies

Stops package manager from performing installation

Can also be caused be a developer removing packages from a repo

npm

20

21 of 34

Attack: Provides Everything

Goal: Cause a vulnerable package to be installed

Mechanism: Make a flawed package provide a virtual dependency for everything

Vulnerable package is installed by all parties

21

sendmail 1.0

firefox

iexplore

chrome

safari

opera

22 of 34

Attack: Compromise

Goal: Arbitrarily change packages

22

23 of 34

Enter TUF!

Be compromise-resilient!

Key management, etc.

Support, don’t judge!

23

24 of 34

TUF Goal: Compromise-Resilience

Goal: Minimize damage from attack

Minimize likelihood of successful attack

Contain impact of successful attacks

24

25 of 34

Explicit & Implicit Revocation

Expiration

Revocation

25

26 of 34

Responsibility Separation

26

timeliness

Root of trust

content

consistency

27 of 34

Minimize Risk

27

DAMAGE ~= PROBABILITY x IMPACT

High-impact role?

Low-impact role

Highly secure keys

Online keys?

28 of 34

Multi-signature Trust

28

{ "_type" : "root",

"compression_algorithms": [ ... ],

"consistent_snapshot":,

"version" : VERSION,

"expires" : EXPIRES,

"keys" : {

KEYID : KEY

, ... },

"roles" : {

ROLE : {

"keyids" : [ KEYID, ... ] ,

"threshold" : THRESHOLD }

, ... }

}

29 of 34

Roles in TUF

  • Responsibility separation.
  • Multitrust signatures (a.k.a. two-man rule).
  • Explicit and implicit revocation of keys.
  • Minimizing risk (with offline keys).

29

ε

timestamp

metadata

packages

online

keys

offline

keys

signs metadata for

target

package

signs root keys for

delegates packages to

root

snapshot

projects

A1

BC

A.pkg

C.gz

signs for packages

A.*

B.*, C.*

*.pkg

A2

B.tar

30 of 34

TUF Key Hierarchy

30

Root

Targets

Timestamp

Snapshot

David

TUF

Justin

31 of 34

TUF Metadata Verification

31

Root

Targets

Snapshot

Timestamp

David

Justin

TUF

32 of 34

Notary

  • implementation of TUF for container applications
  • CNCF project
  • written in Go, use as library or server
  • allows some flexibility in how you validate trust
  • integrated into many container registries
    • Docker Hub
    • Azure
    • IBM Cloud
    • Harbor

33 of 34

Integrations

34 of 34

Beyond TUF

What is coming for TUF?

Things TUF does not protect against...

34