Top Banner
Make Your Own Cloud Security Monitoring Solution 1
43

Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Jul 09, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Make Your Own Cloud Security

Monitoring Solution

�1

Page 2: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

About The Presenter

Security Researcher

Former ISS X-Force Member

Currently Staff Engineer at Datadog* *These opinions are mine and not my employer’s

John Ventura

@JohnAVentura!2

Page 3: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Alerting in the Cloud

• Build an alerting system for GCP or AWS

• Associated dangers

• Overcoming these dangers

!3

Page 4: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Why Alerting?

Do you have policies?

Do people make mistakes?

Do you get attacked?

!4

Page 5: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Build An Alerting System

You already have the components!

!5

Page 6: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

CIDF defines four categories of components:

•Event generators •Analyzers •Databases •Response units

https://tools.ietf.org/html/draft-staniford-cidf-data-formats-00

FrameworkCommon Intrusion Detection

!6

Page 7: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Actual Response Unit

!7

Page 8: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

For this talk, we will focus on the CIDF components provided by AWS and GCP.

AWS and GCP

!8

Page 9: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Public cloud environments provide some CIDF components as services:

•Easy to configure •Can feed into 3rd party tools •Accessible by API Calls (EVERYTHING is an API CALL)

CIDF In Public CloudEnvironments

!9

Page 10: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

AWS (CloudTrail) • Easily configurable • Logs ALL API calls to S3 or Lambda • Easily consumable by third party tools

Native Event Generators

!10

Page 11: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

AWS (CloudWatch) • Easily configurable • Logs filtered API calls to anywhere • Easily consumable by third party tools

Native Event Generators

!11

Page 12: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Stackdriver (GCP) • GCP log management platform • Collects GCP event data • Includes features that facilitate data

management

Native Event Generators

!12

Page 13: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Native Analyzers

AWS and GCP both provide native analyzers

• Accessible via the GUI

• Accessible via APIs

• Data presentations may vary

considerably based on logged calls

!13

Page 14: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Create a filter!

GCP’s Native Analyzer

!14

Page 15: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Create a policy!

GCP’s Native Response Unit

!15

Page 16: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

AWS’ Native Analyzer

!16

Page 17: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

AWS Native Response Unit

AWS offers native support for:

•SMS through SNS •E-mail through Simple Email Service  •Much more…

!17

Page 18: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Simple AWS Alerting

!18

Page 19: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

AWS CIDF Summary

• Configurable

• Consumable

• Spread across multiple services

• Intended for programatic access

• Log formats have inconsistent schema

!19

Page 20: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

GCP CIDF Summary

• Configurable

• Consolidated in single service

• Heavy focus on GUI

• Log formats have inconsistent schema

!20

Page 21: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Incompleteness Theorem

BEWARE!

!21

Page 22: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

gcloud logging [metrics | sinks] list

gcloud logging metrics update [metric_name] —log-filter = “SOMETHING”

Information for Red Teams!

!22

Page 23: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Information for Red Teams!

!23

Page 24: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Information for Red Teams!

•aws events list-rules # for CloudWatch rules

•aws events [disable-rule | enable-rule] —name [rule name]

•aws cloudtrail describe-trails

!24

Page 25: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Information for Red Teams!

!25

Page 26: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

•Transparent to attackers

•Easily clobbered by admins (including you)

•Metrics/Exports/Filters can be imprecise

Native Alerting Limitations

!26

Page 27: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

What Can We Do?

!27

Page 28: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Build your own Alerting!

Advantages

• Less transparent to attackers

• Allows for more complicated filtering

• Enabled third-party technology

• Storage and retention…

!28

Page 29: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Case Study

In this scenario

• AWS is our primary cloud

• GCP is our secondary cloud

• Shipping data out of GCP to other CIDF components

• Custom shipper “GoodCoP”

!29

Page 30: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Stackdriver API

•Continuous Polling

•Lose some convenience

•Protobuf support*

*https://github.com/googleapis/googleapis/blob/master/google/cloud/audit/audit_log.proto

!30

Page 31: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Application Flow

from google.cloud.logging import Client, ASCENDING, DESCENDING

client = Client(project = projectName) while true: timeFilter = GetFilter(LastScanTime) entries = False while not entries: entries = client.list_entries(order_by=DESCENDING, filter_ = timeFilter) for entry in entries: DoSomething(entry.payload) UpdateScanTime(entry.timestamp)

!31

Page 32: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

GoodCoP Configuration

!32

Page 33: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Flip the Script

What if AWS alerting data flows into GCP?

!33

Page 34: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Considerations for AWS

• CloudTrail - Dump all your API event to S3 or Lambda

• CloudWatch - Dump filtered API events to Lambda, Kinesis, SQS, SNS, or elsewhere

Consider separate accounts!!34

Page 35: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Adding Third Parties

Several third party CIDF components are available.

!35

Page 36: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Open Source Searching and Alerting

•Elasticsearch

•Elastalert

•Streamalert

!36

Page 37: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Third Party Response Units

•Slack — https://api.slack.com/

•PagerDuty — https://v2.developer.pagerduty.com/

•SMS — Several available

•SMTP Email — Several available

•Smart bulbs — https://www.developers.meethue.com/philips-hue-api

!37

Page 38: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Simple AWS Alerting

!38

Page 39: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Datadog as Datastore

!39

Page 40: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Datadog as Analyzer

!40

Page 41: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Datadog Response Units

!41

Page 42: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

Go Build It!

!42

• CIDF components are out there

• These systems can be fragile

• Good luck!

Page 43: Make Your Own Cloud Security Monitoring Solution · Common Intrusion Detection!6. Actual Response Unit!7. For this talk, we will focus on the CIDF components provided by AWS and GCP.

•Twitter: @JohnAVentura

•Github: https://github.com/johnaventura/

Thank you

!43