backdooring git august 2015 john menerick conf... · git ‹# › definition 1 while it works,...

78
John Menerick August 2015 Backdooring Git

Upload: others

Post on 02-Aug-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

John Menerick − August 2015

Backdooring Git

Page 2: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Legal Disclaimer

Page 3: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Thank you for coming

Page 4: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

What we are covering

Page 5: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

What we are not covering

Page 6: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

What we are not covering

Page 7: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Software is like sex; it is better when it is free Linus Torvalds

Name the Quote

Page 8: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

Setting the Stage

Page 9: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Good luck!

Page 10: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Revision control vs. Source Control

Source control == source code change management

Page 11: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Wrong Tool for the Job

Page 12: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Right Tool for the Job

Page 13: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Distributed vs. Centralized

Page 14: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Helfe!

Page 15: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Trends

Page 16: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

Git

Page 17: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Definition

1 While it works, angel sings and light shines from above - “Global information tracker”

Page 18: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Definition

2 When it dies, fire erupts from under your feet - “Goddamn idiot truckload of sh*t”

Page 19: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Hitler Uses Git

Page 20: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Rings of Trust

Page 21: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

If you have ever done any security work - and it did not involve the concept of “network of

trust” - it wasn’t security work, it was - <insert word my mother would not approve me

stating>. I don’t know what you were doing. But trust me, it’s the only way you can do

security. it’s the only way you can do development. Linus Torvalds

Name the Quote

Page 22: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Typical Trust Relationships

Page 23: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Morons

Since you do not want everybody to write to the central repository because most people are morons, you create this class of people who are ostensibly not morons. And most of the time what happens is that you make that class too small, because it is really hard to know if a person is smart or not, and even if you make it too small, you will have problems. So this whole commit access issue, which some companies are able to ignore by just giving everybody commit access, is a huge psychological barrier and causes endless hours of politics in most open source projects

Page 24: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

Empircal Study

Page 25: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

SVN

Page 26: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Git

Page 27: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Not Scientific CVE Search

Page 28: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

GitLab

Page 29: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

GitLab 0day

Page 30: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Functionality or Backdoor?

Page 31: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

2003 Linux backdoor

Page 32: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

2003 Linux backdoor

Page 33: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

2003 Linux backdoor

Page 34: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Old School Cloud Repository Hacks

Page 35: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

New School Cloud Repository Hacks

Page 36: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

New School Cloud Repository Hacks

Page 37: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

New School Cloud Repository Hacks

Page 38: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

New School Cloud Repository Hacks

Page 39: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

New School Cloud Repository Hacks

Page 40: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

Story Time

Page 41: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Sit back and relax

Page 42: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Corruption

Page 43: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

It wasn’t me

Page 44: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

It wasn’t me

Page 45: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

It wasn’t me

Page 46: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Feelings

Page 47: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Trust

Page 48: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Crypto to the rescue

Page 49: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Crypto to the rescue

Page 50: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

My voice is my passport – Verify me

Page 51: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

GPG Trust Model

Page 52: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

GPG Trust Model

Page 53: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Embedded Signatures

Page 54: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

No More Than One Signature Per Commit

Page 55: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Backdooring

Page 56: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Simple Scenario

* User "Alice" clones the canonical repo so they can work on a bugfix. They branch locally, and then push their local branch to a branch on a public repository somewhere. * User "Alice" does not have direct commit access to the canonical repository, so they contact a committer, "Bob". "Bob" adds a remote in his working copy pointing to Alice's remote; after review of the changes, Bob merges the branch to their development branch. * Later, Bob pushes his development branch to the canonical repository.

The question that arises is: how do we know that Alice has signed a CLA? How does Bob know that Alice has signed a CLA?

Page 57: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Danger Zone

Page 58: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Ambiguity

Page 59: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Transitive Policy Checks

Page 60: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Transitive Policy Checks

Page 61: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Trust your peer?

trusting the pushing client's assertions as to the signature status is meaningless from a security perspective.

Page 62: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

Demo

Page 63: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

Has this been seen in the wild?

Page 64: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

No?from hashlib import sha1 def githash(data): s = sha1() s.update("blob %u\0" % len(data)) s.update(data) return s.hexdigest()

Page 65: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

No?

“If all 6.5 billion humans on Earth were programming, and every second, each one was producing code that was the equivalent of the entire Linux kernel history (3.6 million Git objects) and pushing it into one enormous Git repository, it would take roughly 2 years until that repository contained enough objects to have a 50% probability of a single SHA-1 object collision.. A higher probability exists that every member of your programming team will be attacked and killed by wolves in unrelated incidents on the same night.”

Page 66: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

No?

Page 67: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Yes?

https://github.com/bradfitz/gitbrute

Page 68: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Yes?

Page 69: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Yes?

Page 70: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Yes?

Page 71: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

Signed commit metrics on the popular git services vs. not signed commits

Page 72: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

Tools

Page 73: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

CLI

Page 74: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

To a close

Page 75: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”
Page 76: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

One More Thing

Page 77: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

One More Thingfrom RockStar import RockStar

activity = RockStar(days=4061) activity.make_me_a_rockstar()

Page 78: Backdooring Git August 2015 John Menerick Conf... · Git ‹# › Definition 1 While it works, angel sings and light shines from above - “Global information tracker”

‹#›

One More Thingfrom RockStar import RockStar

activity = RockStar(days=4061) activity.make_me_a_rockstar()