About Me CEO & Co-Founder at Snyk Find & Fix - - PowerPoint PPT Presentation

about me
SMART_READER_LITE
LIVE PREVIEW

About Me CEO & Co-Founder at Snyk Find & Fix - - PowerPoint PPT Presentation

Developer as a Malware Distribution Vehicle Guy Podjarny (@guypod) @guypod About Me CEO & Co-Founder at Snyk Find & Fix vulnerabilities in open source dependencies! Founder @Blaze, CTO @Akamai Security work since


slide-1
SLIDE 1

@guypod

Developer as a 


Malware Distribution Vehicle


Guy Podjarny (@guypod)

slide-2
SLIDE 2

@guypod

About Me

  • CEO & Co-Founder at Snyk
  • Find & Fix vulnerabilities in open source dependencies!
  • Founder @Blaze, CTO @Akamai
  • Security work since 1997
  • DevOps & Performance since 2010
  • A Developer
slide-3
SLIDE 3

@guypod

Developers are 


more powerful 


than ever

slide-4
SLIDE 4

@guypod

That can be


Dangerous

slide-5
SLIDE 5

@guypod

I’m here to tell you


a few stories…

slide-6
SLIDE 6

@guypod

XCodeGhost

slide-7
SLIDE 7

@guypod

The time: September, 2015

slide-8
SLIDE 8

@guypod

XCode: iOS Dev Platform

slide-9
SLIDE 9

@guypod

Xcode is BIG…

Was 3GB in 2015

slide-10
SLIDE 10

@guypod

Xcode downloads in


China come from the US

and are 


SLOW

slide-11
SLIDE 11

@guypod

  • Hosted inside the great firewall
  • Must faster to download
  • Found via forums etc

Devs use local mirrors

  • And… some contain malware !

(dubbed XcodeGhost)

slide-12
SLIDE 12

@guypod

XcodeGhost Malware

  • Includes a malicious CoreServices component
  • Component is compiled into the iOS app
  • Submitted to app store, evades detection!
  • Malware spies on users installing the apps
slide-13
SLIDE 13

@guypod

XcodeGhost went


undetected

for


4 months

slide-14
SLIDE 14

@guypod

Up to 300 affected apps

WeChat
 (China’s WhatsApp) Didi
 (China’s Uber) Railway 12306
 (Train Tickets) + Dozens of US apps

slide-15
SLIDE 15

@guypod

Some apps compromised 


Via a Library

https://possiblemobile.com/2015/11/a-lesson-in-xcode-ghost-third-party-frameworks/

slide-16
SLIDE 16

@guypod

Up to 


1.4M active victims/day!

http://www.circleid.com/posts/20151001_verisign_idefense_analysis_of_xcodeghost/

slide-17
SLIDE 17

@guypod

Not just in China


(DNS queries to evil sites by geo)

http://www.circleid.com/posts/20151001_verisign_idefense_analysis_of_xcodeghost/

slide-18
SLIDE 18

@guypod

Apple cleans up App Store immediately, Users take months to update.

https://www.fireeye.com/blog/threat-research/2015/11/xcodeghost_s_a_new.html

slide-19
SLIDE 19

@guypod

slide-20
SLIDE 20

@guypod

Local Xcode downloads

slide-21
SLIDE 21

@guypod

“[CoreServices] is a Mach-O object file that is used by LLVM linker and can’t directly execute in any way”

https://researchcenter.paloaltonetworks.com/2015/09/novel-malware-xcodeghost-modifies-xcode-infects-apple-ios-apps-and-hits-app-store/

slide-22
SLIDE 22

@guypod

Developers were a


distribution vehicle.

slide-23
SLIDE 23

@guypod

XcodeGhost 


Was not the first

slide-24
SLIDE 24

@guypod

The year: 2009

slide-25
SLIDE 25

@guypod

slide-26
SLIDE 26

@guypod

Developers still used


Delphi

slide-27
SLIDE 27

@guypod

Induc Malware

  • Detects if Delphi is installed
  • Compiles sysconst.pas to a malicious sysconst.dcu
  • Malware added to every program compiled on machine
  • Every execution of Induc compromises local sysconst.dcu
slide-28
SLIDE 28

@guypod

Induc ~> XcodeGhost

  • Took longer to find
  • 10 months!
  • Spread faster
  • Kaspersky:“millions of copies”
  • More viral and hard to remove
  • no unofficial downloads, no app store
  • Replicates via compilers, not executables
slide-29
SLIDE 29

@guypod

Developers were a


distribution vehicle.

slide-30
SLIDE 30

@guypod

Induc was 


not that original

either!

slide-31
SLIDE 31

@guypod

The year: 1984

slide-32
SLIDE 32

@guypod

“Reflections on Trusting Trust”

Ken Thompson, 1984

https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf

slide-33
SLIDE 33

@guypod

“I would like to present to you the cutest program I ever wrote…”

https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf

slide-34
SLIDE 34

@guypod

The Ken Thompson Hack

  • Modify C compiler to “miscompile”:
  • Unix login to accept a hard coded password (Trojan 1)
  • C compiler to replicate the trojans (Trojan 2)
  • Disassembler to hide the trojans (Trojan 3)
  • Remove these trojans code from the source code

Originally described by Karger and Schell in 1974, dubbed Multics vulnerability

slide-35
SLIDE 35

@guypod

If this happened 


How would you find out?

“Solution” by David Wheeler, 2005: 
 two independent compilers producing bit-identical output

slide-36
SLIDE 36

@guypod

“I picked on the C compiler. I could have picked on any program-handling program …
 As the level of program gets lower, these bugs will be harder and harder to detect”

slide-37
SLIDE 37

@guypod

“The moral is obvious. 
 You can't trust code that you 
 did not totally create yourself. 


(Especially code from companies that employ people like me.)”

slide-38
SLIDE 38

@guypod

Who here


totally created their code?

slide-39
SLIDE 39

@guypod

https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf

slide-40
SLIDE 40

@guypod

Back to today…

slide-41
SLIDE 41

@guypod

https://hackernoon.com/im-harvesting-credit-card-numbers-and-passwords-from-your-site-here-s-how-9a8cb347c5b5

slide-42
SLIDE 42

@guypod

https://hackernoon.com/im-harvesting-credit-card-numbers-and-passwords-from-your-site-here-s-how-9a8cb347c5b5

slide-43
SLIDE 43

@guypod

Malicious PyPi packages

(2017)

slide-44
SLIDE 44

@guypod

Malicious npm packages

(2017, 2018)

2017 2018

slide-45
SLIDE 45

@guypod

RubyGems Hacked

(2013,2016)

2013 2016

slide-46
SLIDE 46

@guypod

https://kromtech.com/blog/security-center/cryptojacking-invades-cloud-how-modern-containerization-trend-is-exploited-by-attackers

Malicious Docker Images

(June 2018) - THIS MONTH

slide-47
SLIDE 47

@guypod

These are the ones


we know about

slide-48
SLIDE 48

@guypod

  • Mario Heidrich fixed a bug in Angular… 


and introduced a vulnerability!
 
 


  • Angular accepted the “fix”



 


  • Google security team blocked release

Injecting Vulnerability into Angular.js

(2015)

https://www.slideshare.net/x00mario/an-abusive-relationship-with-angularjs/54

slide-49
SLIDE 49

@guypod

How often are vulnerabilities 


intentional?

https://research.checkpoint.com/jenkins-miner-one-biggest-mining-operations-ever-discovered/

slide-50
SLIDE 50

@guypod

Developers were a


distribution vehicle.

slide-51
SLIDE 51

@guypod

The pace of 


shipping code


is skyrocketing

slide-52
SLIDE 52

@guypod

Our users


Trust


the code we ship

slide-53
SLIDE 53

@guypod

From

Code


to


Systems & Data

slide-54
SLIDE 54

@guypod

Developers access 


production systems


daily

slide-55
SLIDE 55

@guypod

Developers access 


user data


daily

slide-56
SLIDE 56

@guypod

That can be


Dangerous

slide-57
SLIDE 57

@guypod

The


Syrian Electronic Army


and the


Financial Times

slide-58
SLIDE 58

@guypod

  • 1. Phishing email to employees who


had publicly shared their email

Masked link to an 
 attacker controlled
 compromised site

slide-59
SLIDE 59

@guypod

  • 2. Link redirects to 


spoofed FT Single Sign-on
 page (for Google Apps)

Some users entered their passwords…

slide-60
SLIDE 60

@guypod

  • 3. Attackers use compromised accounts to 


Email more FT users
 this time from an FT email address

More users are compromised…

slide-61
SLIDE 61

@guypod

  • 4. IT finds out, sends warning email to all.


Attackers send identical email - with evil links

slide-62
SLIDE 62

@guypod

  • 5. Attackers gain access to several

  • fficial Twitter accounts blog

https://www.telegraph.co.uk/technology/twitter/10064184/Financial-Times-hacked-by-Syrian-Electronic-Army.html

slide-63
SLIDE 63

@guypod

“A sobering day”


by Andrew Betts, 
 a compromised FT developer

https://labs.ft.com/2013/05/a-sobering-day/

slide-64
SLIDE 64

@guypod

“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/

slide-65
SLIDE 65

@guypod

Developers were the 2nd most likely to click a link in a phishing email

https://www.heavybit.com/library/podcasts/the-secure-developer/ep-16-security-training-with-elevates-masha-sedova/

Internal Salesforce Phishing Test


run by Masha Sedova (@modMasha)

slide-66
SLIDE 66

@guypod

Compromising a


high privileged developer 


is hitting the jackpot

slide-67
SLIDE 67

@guypod

The

Uber Hack


  • f 2016
slide-68
SLIDE 68

@guypod

Attackers accessed details of 


600,000 Uber drivers


and “some personal info” of


57M Uber users

slide-69
SLIDE 69

@guypod

Uber paid 


$100,000 ransom


disguised as a bug bounty

slide-70
SLIDE 70

@guypod

Uber didn’t report the breach


for a FULL YEAR


(until Nov, 2017)

slide-71
SLIDE 71

@guypod

Uber Hack Details

  • Dev pushed S3 tokens to private github.com repo
  • Attackers gained access to repo, stole tokens
  • Uber was not using 2FA
  • Attackers used token to steal info from S3
slide-72
SLIDE 72

@guypod

“we immediately instituted multifactor authentication on Github.
 
 We then subsequently ceased using GitHub except for items like open source code”

slide-73
SLIDE 73

@guypod

Uber Hack of 2014

  • Dev stored sensitive URL in public github.com gists
  • Attacker accessed data in May, 2014
  • “Only” 50,000 drivers exposed that time

  • Uber discovered breach in September, 2014
  • Uber notified drivers in February, 2015
slide-74
SLIDE 74

@guypod

Developers can access 


Extremely Sensitive Data


and expose it too often

Chalker, 2015 Dan Godin, 2013

slide-75
SLIDE 75

@guypod

These stores are just


a few examples


  • f MANY
slide-76
SLIDE 76

@guypod

Developers are 


more powerful 


than ever

slide-77
SLIDE 77

@guypod

With


Great Power


comes


Great Responsibility

slide-78
SLIDE 78

@guypod

Why are developers
 falling for these?

slide-79
SLIDE 79

@guypod

https://www.youtube.com/watch?v=fDryj_9I5eM

Rachel Ilan Simpson
 @rilan Guy Podjarny
 @guypod

slide-80
SLIDE 80

@guypod

Why do people make insecure decisions?

  • Different motivations
  • Cognitive Limitations
  • Lack of Expertise
slide-81
SLIDE 81

@guypod

Why do developers make insecure decisions?

  • Different motivations
  • Our goal is improved functionality, security is just a constraint
  • Cognitive Limitations
  • We move fast, and sometimes break things - including security
  • Lack of Expertise
  • We often don’t understand the security implications of our decisions
slide-82
SLIDE 82

@guypod

Developers are also


Over Confident

slide-83
SLIDE 83

@guypod

“I find training developers, actually to be much harder than regular employees”
 


Masha Sedova (@modMasha)

https://www.heavybit.com/library/podcasts/the-secure-developer/ep-16-security-training-with-elevates-masha-sedova/

slide-84
SLIDE 84

@guypod

“there's a certain amount of arrogance associated with, "I already know this,"or "I'm smarter than this." ”
 


Masha Sedova (@modMasha)

https://www.heavybit.com/library/podcasts/the-secure-developer/ep-16-security-training-with-elevates-masha-sedova/

slide-85
SLIDE 85

@guypod

“Most developers that I talk to, specifically, don't actually believe security is an issue that happens at their company” 


Masha Sedova (@modMasha)

https://www.heavybit.com/library/podcasts/the-secure-developer/ep-16-security-training-with-elevates-masha-sedova/

slide-86
SLIDE 86

@guypod

Security breaches


Can happen to You

slide-87
SLIDE 87

@guypod

You are


Trustworthy


but

Not Infallible

slide-88
SLIDE 88

@guypod

How can we 


Mitigate


this risk?

slide-89
SLIDE 89

@guypod

Learn lessons from


Past Incidents

slide-90
SLIDE 90

@guypod

Automate Security Controls

  • Apple: Malware detection in app store
  • npm: Malicious package detection in registry
  • FT: 2FA on SSO Page
  • Uber: 2FA on GitHub.com, then move to self hosted git
slide-91
SLIDE 91

@guypod

Make it Easy to be Secure

  • Apple: Stand up fast local Xcode download mirrors
  • FT: “Reducing and removing privileges more aggressively”
  • Uber: Auto-expire AWS tokens
  • npm/PyPi/Docker: Flag/block malicious packages
slide-92
SLIDE 92

@guypod

Developer Education

  • Apple: Encourage dev to validate Xcode Download
  • npm: Blog about malicious packages & typosquatting
  • FT: “set clearer expectations of security standards”
  • Angular: Require 2 expert reviewers for sensitive code
slide-93
SLIDE 93

@guypod

Caring
 about security Ease 


  • f being secure
slide-94
SLIDE 94

@guypod

Manage


Access


Like a 


Tech Giant

slide-95
SLIDE 95

@guypod

Google BeyondCorp

https://cloud.google.com/beyondcorp/

slide-96
SLIDE 96

@guypod

BeyondCorp in a nutshell

  • All access done via a corporate proxy
  • Eliminates trusted network
  • Proxy grants access per user & device
  • No more static credentials
  • Access is logged and monitored
  • Anomalies can be detected during or after actions

https://www.slideshare.net/fortyfivan/beyondcorp-sf-meetup-closing-the-adherence-gap

slide-97
SLIDE 97

@guypod

https://cloud.google.com/beyondcorp/

slide-98
SLIDE 98

@guypod

Microsoft 
 Privileged Access Workstations (PAW)

slide-99
SLIDE 99

@guypod

PAWs in a nutshell

  • Access to production requires a secure machine
  • With strict controls and no further internet access
  • Your “Desktop” runs as a VM on the machine
  • Running a secure VM in an insecure host isn’t enough
  • Optionally a “Guarded Host” can host both VMs
  • Allows more flexibility and routine updates to the PAW

https://blogs.technet.microsoft.com/datacentersecurity/2017/10/13/privileged-access-workstationpaw/

slide-100
SLIDE 100

@guypod

Detailed PAW Guidance 


(windows centric)

https://blogs.technet.microsoft.com/datacentersecurity/2017/10/13/privileged-access-workstationpaw/

  • PAW deployment guide
  • Why use shielded VM for PAW?
  • How to deploy VM template for PAW
  • Building VM template for PAW
  • Connect to VMs on PAW
  • Shielded VM local mode vs HGS mode
  • How to build the PAW host
slide-101
SLIDE 101

@guypod

Netflix - BLESS

slide-102
SLIDE 102

@guypod

QCon NYC 2017 Talk!

https://www.infoq.com/presentations/bless-security-ops-ssh

slide-103
SLIDE 103

@guypod

BLESS in a nutshell

  • Central SSH Certificate Authority (Lambda based)
  • Centrally manage keys & track SSH permissions per user/system
  • Instances trust CA instead of managing keys
  • Dev SSH via a Bastion (jump host) server
  • Lyft uses BLESS server to manage SSH access to Bastion too
  • Bastion manages access per BLESS Server instructions
  • Logs access & can enforce custom rules (e.g. allowed source IP)

https://www.infoq.com/presentations/bless-security-ops-ssh

slide-104
SLIDE 104

@guypod

More on Netflix BLESS

https://blogs.technet.microsoft.com/datacentersecurity/2017/10/13/privileged-access-workstationpaw/

  • GitHub repo


https://github.com/Netflix/bless


  • Lyft on using BLESS for Bastion access


https://eng.lyft.com/blessing-your-ssh-at-lyft-a1b38f81629d 


  • Bryan Payne's QCon NYC talk


https://www.infoq.com/presentations/bless-security-ops-ssh

slide-105
SLIDE 105

@guypod

Controlling access 
 makes
 Security easier

slide-106
SLIDE 106

@guypod

Beyond learning from others,


Ask Questions!

slide-107
SLIDE 107

@guypod

When someone asks for access


Challenge It

slide-108
SLIDE 108

@guypod

What happens if you 


don’t allow access? 


  • r only grant partial access?
slide-109
SLIDE 109

@guypod

How Urgently is access needed?

slide-110
SLIDE 110

@guypod

How long is access needed for?

slide-111
SLIDE 111

@guypod

How bad would it be if this access was 


Compromised?

slide-112
SLIDE 112

@guypod

If access was compromised, 


How would you find out?

and how quickly?

slide-113
SLIDE 113

@guypod

If access was compromised, 


What would you do?

slide-114
SLIDE 114

@guypod

Agility 
 vs
 Safety

slide-115
SLIDE 115

@guypod

Developers are a


lucrative target


and attackers know it

slide-116
SLIDE 116

@guypod

Users


Trust You

slide-117
SLIDE 117

@guypod

Care about user safety
 even if it’s hard

slide-118
SLIDE 118

@guypod

Don’t be a


Malware distribution vehicle

slide-119
SLIDE 119

@guypod

Developer as a 


Malware Distribution Vehicle


Guy Podjarny (@guypod)

Thank You!