1 of 78

Transitioning to AWS in a hurry without getting owned (Hopefully...)

Devina Dhawan

02/06/2017 - Women & Non-Binary Focused intro to AWS

Email: 3@etsy.com

Twitter: @theulzo

1

2 of 78

Transitioning to AWS in a hurry without getting owned (Hopefully...)

Devina Dhawan

02/06/2017 - Women & Non-Binary Focused intro to AWS

Email: 3@etsy.com

Twitter: @theulzo

2

3 of 78

Introduction

3

  • Etsy (Jan 2015 - Present)
  • Orbitz (May 2014 - Dec 2015)
  • University of Illinois in Chicago

4 of 78

Etsy operates a global marketplace where people around the world connect,

both online and offline, to make, sell and buy unique goods.

4

5 of 78

Security at Etsy

  • Evangelizing Security at Etsy
    • Candy is a great way to make friends
    • Allow the conversation about security to be comfortable and inviting.

5

6 of 78

What is this talk about?

  • I will help you improve your existing AWS infrastructure
  • You will walk away with action items
  • http://bit.ly/2EnZU1q

6

7 of 78

“Securing Amazon Web Services”

7

8 of 78

  • Traditional bare metal
  • Minimal footprint in the clouds

Infrastructure

8

9 of 78

Where to begin?

10 of 78

  • Evident.io
    • Scans of configurations to see if anything is misconfigured
  • Password policies?
  • Multi-factor Authentication
  • Jira Tickets

10

Evident.io

11 of 78

11

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Cloudtrail Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

12 of 78

Scout2

  • Github Page: https://github.com/nccgroup/Scout2
  • Reports for all accounts
  • Tie that into alerts manually

13 of 78

13

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Cloudtrail Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

14 of 78

Changes I made… like a goon

  • Password policy to the highest scrutiny
  • Removed all admin roles from accounts that didn’t need them (aka hadn’t used aws in 2 yrs and didn’t have any api keys tied to their user)

14

15 of 78

Password Policies

16 of 78

My first Etsy communication

Hello X,

Looks like you still do not have MFA set up on your AWS account.

Go ahead and go to Identity & Access Management in your Amazon Web Services console -> find your username -> Manage MFA Device.

Note: If you no longer need your AWS account, please let me know!

Devina

17 of 78

Version 2.0

Hello X,

Looks like you still do not have MFA set up on your AWS account. It looks like you used your AWS account recently as well, so please sign up for MFA by 03/31/16 or your account will be suspended.

Go ahead and go to Identity & Access Management in your Amazon Web Services console -> find your username -> Manage MFA Device.

Note: If you no longer need your AWS account, please let me know!

Your neighborhood candy provider,

Devina

18 of 78

Oops...

19 of 78

Multiple statements which allow you to:

  • Resync MFA devices
  • Deactivate MFA devices
  • List MFA devices
  • Primary, management

Other policies:

  • Forcing MFA

20 of 78

Oof…

21 of 78

Aws-cli for account creation

Becoming really used to the aws client is really useful too!

22 of 78

Using Terraform for IAM

  • What is terraform?
  • What can it do?
    • Static creds
    • Environment variables
    • Shared creds
    • EC2 Roles

23 of 78

Static Creds

24 of 78

24

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Cloudtrail Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

25 of 78

Logging in AWS - Cloudtrail

26 of 78

27 of 78

28 of 78

29 of 78

ELK

30 of 78

Alert Types

Email:

  • Daily Roundup Emails
    • No production impacting
  • High Risk Alerts
    • Enough resources to handle

IRC/Slack/Jabber:

  • Slack & Dropbox

Collect the alerts:

  • Splunk
  • 411 / Elastalert

31 of 78

31

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Scout2

# Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

32 of 78

Inbound/Outbound

33 of 78

EC2 Roles

34 of 78

34

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Scout2

# Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

35 of 78

Bucket Policies

36 of 78

37 of 78

38 of 78

  • Bug Bounties at Etsy: https://www.etsy.com/bounty
  • S3 Scanner �Github: https://github.com/bear/s3scan
    • Report of all s3 buckets and perms
    • Likely how bountiers are finding out about your misconfigured policies.

39 of 78

39

So… it happened, what do I do now?

  • Write down all the systems you need to take care of
  • Find out what you need to fix on all systems, write that down
  • Start with the low-hanging fruit
  • Over communicate what you are doing.
  • Work with networking on the AWS network
  • Create default rulesets & roles
  • Work with IT/helpdesk to handle account provisioning
  • Work with systems engineering to handle provisioning of services
  • … profit?

40 of 78

THANKS!

3@etsy.com

@theulzo

41 of 78

Introduction

41

  • Etsy (Jan 2015 - Present)
  • Orbitz (May 2014 - Dec 2015)
  • University of Illinois in Chicago

42 of 78

Etsy operates a global marketplace where people around the world connect,

both online and offline, to make, sell and buy unique goods.

42

43 of 78

Security at Etsy

  • Evangelizing Security at Etsy
    • Candy is a great way to make friends
    • Allow the conversation about security to be comfortable and inviting.

43

44 of 78

What is this talk about?

  • I will help you improve your existing AWS infrastructure
  • You will walk away with action items
  • http://bit.ly/2EnZU1q

44

45 of 78

“Securing Amazon Web Services”

45

46 of 78

  • Traditional bare metal
  • Minimal footprint in the clouds

Infrastructure

46

47 of 78

Where to begin?

48 of 78

  • Evident.io
    • Scans of configurations to see if anything is misconfigured
  • Password policies?
  • Multi-factor Authentication
  • Jira Tickets

48

Evident.io

49 of 78

49

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Cloudtrail Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

50 of 78

Scout2

  • Github Page: https://github.com/nccgroup/Scout2
  • Reports for all accounts
  • Tie that into alerts manually

51 of 78

51

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Cloudtrail Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

52 of 78

Changes I made… like a goon

  • Password policy to the highest scrutiny
  • Removed all admin roles from accounts that didn’t need them (aka hadn’t used aws in 2 yrs and didn’t have any api keys tied to their user)

52

53 of 78

Password Policies

54 of 78

My first Etsy communication

Hello X,

Looks like you still do not have MFA set up on your AWS account.

Go ahead and go to Identity & Access Management in your Amazon Web Services console -> find your username -> Manage MFA Device.

Note: If you no longer need your AWS account, please let me know!

Devina

55 of 78

Version 2.0

Hello X,

Looks like you still do not have MFA set up on your AWS account. It looks like you used your AWS account recently as well, so please sign up for MFA by 03/31/16 or your account will be suspended.

Go ahead and go to Identity & Access Management in your Amazon Web Services console -> find your username -> Manage MFA Device.

Note: If you no longer need your AWS account, please let me know!

Your neighborhood candy provider,

Devina

56 of 78

Oops...

57 of 78

Multiple statements which allow you to:

  • Resync MFA devices
  • Deactivate MFA devices
  • List MFA devices
  • Primary, management

Other policies:

  • Forcing MFA

58 of 78

Oof…

59 of 78

Aws-cli for account creation

Becoming really used to the aws client is really useful too!

60 of 78

Using Terraform for IAM

  • What is terraform?
  • What can it do?
    • Static creds
    • Environment variables
    • Shared creds
    • EC2 Roles

61 of 78

Static Creds

62 of 78

62

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Cloudtrail Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

63 of 78

Logging in AWS - Cloudtrail

64 of 78

65 of 78

66 of 78

67 of 78

ELK

68 of 78

Alert Types

Email:

  • Daily Roundup Emails
    • No production impacting
  • High Risk Alerts
    • Enough resources to handle

IRC/Slack/Jabber:

  • Slack & Dropbox

Collect the alerts:

  • Splunk
  • 411 / Elastalert

69 of 78

69

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Scout2

# Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

70 of 78

Inbound/Outbound

71 of 78

EC2 Roles

72 of 78

72

Low-hanging IAM Fruit

# Password Policy

# Multi-factor auth

Monitoring

# Scout2

# Logging

EC2

# Netwerkin’

# EC2 Roles

S3

# S3 Bucket Policies

73 of 78

Bucket Policies

74 of 78

75 of 78

76 of 78

  • Bug Bounties at Etsy: https://www.etsy.com/bounty
  • S3 Scanner �Github: https://github.com/bear/s3scan
    • Report of all s3 buckets and perms
    • Likely how bountiers are finding out about your misconfigured policies.

77 of 78

77

So… it happened, what do I do now?

  • Write down all the systems you need to take care of
  • Find out what you need to fix on all systems, write that down
  • Start with the low-hanging fruit
  • Over communicate what you are doing.
  • Work with networking on the AWS network
  • Create default rulesets & roles
  • Work with IT/helpdesk to handle account provisioning
  • Work with systems engineering to handle provisioning of services
  • … profit?

78 of 78

THANKS!

3@etsy.com

@theulzo