34
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Securing Microservices Containerized Security in AWS Mike Gillespie, Solutions Architect, Amazon Web Services

Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

  • Upload
    others

  • View
    25

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Securing MicroservicesContainerized Security in AWS

Mike Gillespie, Solutions Architect, Amazon Web Services

Page 2: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Splitting Monoliths Ten Years Ago

Page 3: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Splitting Monoliths Ten Years Ago

XML & SOAP

Page 4: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Splitting Monoliths TenFiveYears Ago

Page 5: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

REST JSONFast binary encodingsSplitting

Monoliths Five Years Ago

Page 6: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Page 7: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Page 8: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Microservices

Page 9: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Evolution of Business Logic

Monolith Microservices Functions

Page 10: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Competing Forces

Business

Development Operations

Build it faster Keep it stable

Security

Make it secure

Page 11: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Virtual Private Cloud

Isolated cloud resources

Web Application

Firewall

Filter Malicious Web

Traffic

Shield

DDoS protection

Certificate Manager

Provision, manage, and

deploy SSL/TSL

certificates

Networking

Key Management

Service

Manage creation and

control of encryption keys

CloudHSM

Hardware-based key

storage

Server-Side

Encryption

Flexible data encryption

options

Encryption

IAM

Manage user access and

encryption keys

SAML Federation

SAML 2.0 support to

allow on-prem identity

integration

Directory Service

Host and manage

Microsoft Active Directory

Organizations

Manage settings for

multiple accounts

Identity & Management

Service Catalog

Create and use

standardized products

Config

Track resource inventory

and changes

CloudTrail

Track user activity and

API usage

CloudWatch

Monitor resources and

applications

Inspector

Analyze application

security

Compliance

Access a deep set of cloud security tools

Macie

Discover, Classify &

Protect data

Page 12: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Kernel and Host Security

Denial of Service

Containers and

Serverless

Image &Instance

Secrets Runtime

Page 13: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

With AWS, Security Is a Shared Responsibility

DatabaseStorageCompute Networking

Edge Locations

Regions

Avail. Zones

AWS Global Infrastructure

Customers are responsible for

security ‘in’ the Cloud

AWS is responsible for security ‘of’ the Cloud

Customer Data

Platform, Applications, Identity & Access Management

Operating System, Network & Firewall Configuration

Client-side Data Encryption & Data

Integrity Authentication

Server-side Encryption (File System and/or

Data)

Network Traffic Protection (Encryption /

Integrity / Identity)

Page 14: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

VPC Security

Instance Level Firewalls – Security GroupsSubnet Network Rules – NACLsIntelligent Threat Protection – GuardDutyInline Network Security – 3rd Party Marketplace

Select tools that enable automation!

Page 15: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Host-Based Agents

Amazon InspectorAWS Simple Server Manager3rd Party Agents

Anti-virusIPSDLP

Again - Select tools that enable automation!

Page 16: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon Machine Image Bui lds

EC2 instance

• ECS Optimised Amazon Linux• RHEL• Ubuntu• Container Centric OS

EC2 instance

Foundational AMI

• Security best practices

• Provisioners• Loggers• Config, and so on

ECS OptimizedAMI

Page 17: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

API Gateway

Acts as a front door to the microservices and provides:AuthenticationRate ThrottlingMonitoringVersioning

Select an API Gateway that support Automation

Page 18: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Kernel and Host Security

Denial of Service

Containers and

Serverless

Image &Instance

Secrets Runtime

Page 19: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Web Application Firewall

WAFs provide Layer 7 protection for CVEs and OWASP Top 10.

AWS Web Application Firewall

AWS MarketplaceSaaS WAF OfferingsVirtual Appliances

Page 20: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

• Define your resource limits up front• It’s not just memory and CPU.• Monitor usage• Leverage Auto Scaling• Amazon Shield• Infrastructure as Code

Best pract ices

Page 21: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Kernel and Host Security

Denial of Service

Containers and

Serverless

Image &Instance

Secrets Runtime

Page 22: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

BUILDING AN ECOSYSTEM

AWS Lambda

ECS ECR

EKSFargate

Page 23: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon ECS—Task & Serv ice

EC2 INSTANCES

LOADBALANCER

InternetECS

AGENT

TASK

Container

TASK

Container

ECS AGENT

TASK

Container

TASK

ContainerAGENT COMMUNICATION

SERVICE

Amazon ECS

API

CLUSTER MANAGEMENT ENGINE

KEY/VALUE STOREECS

AGENT

TASK

Container

TASK

Container

LOADBALANCER

ECS Service

Page 24: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

PRODUCTION WORKLOADS ON AWS

AWS VPC networking mode

Advanced task placement

Deep integration with AWS services

ECS CLI…{ }

Global footprint

Powerful scheduling engines

Auto scaling

CloudWatch metrics

Load balancers

Page 25: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

I n t e g r a t e d w i t h A W S S e r v i c e s

H i g h l y a v a i l a b l e

U p s t r e a m P r o d u c t i o n w o r k l o a d s

Amazon EKS

Page 26: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

1. Pre ENI Attachment: The primary ENI

(eth0) is in the default namespace

2. ENI Attached: The new ENI (eth1) is in

the default namespace.

Default/Root Global Namespace Default/Root Global Namespace

Default/Root Global Namespace

docker0 docker0

eth0

lo lo

eth0

eth1

lo

eth0

docker0

ecs0

eth1

lo ve-

c1

3. ENI Provisioned: The ECS Agent

invokes CNI plugins to move the new ENI

into a new namespace and configure it

with the addresses and routes.

Page 27: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Kernel and Host Security

Denial of Service

Containers and

Serverless

Image &Instance

Secrets Runtime

Page 28: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Best pract ices

• Signing container images (Docker content trust)

• Set filesystems to be read-only (readonlyRootFilesystem)

• Remove setuid/setgid binaries from images (defang)

• Set containers to run as non-root user

• Run Vulnerability Analysis on Container/VM Build in pipeline

Page 29: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Kernel and Host Security

Denial of Service

Containers and

Serverless

Image &Instance

Secrets Runtime

Page 30: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Stor ing secrets in envi ronment var iab les

• Suggested by 12-factor apps (III. Config)• Environment variables can be seen in too many places

• Linked containers• ECS API calls• Docker inspect

• Can’t be deleted https://12factor.net/

Page 31: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Protect ing secrets us ing IAM ro les for tasksBenefits

• Simplify usage of AWS SDKs in containers

• Credential isolation between tasks/container

• Authorization per task/container

• Auditability in Amazon CloudTrail with taskArn

Page 32: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Kernel and Host Security

Denial of Service

Containers and

Serverless

Image &Instance

Secrets Runtime

Page 33: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

VPC f low logs and Task ENI

E C S Ta s k

C a t sC o n t a i n e r

C o n t a i n e r I n s t a n c e

S e c u r i t y G r o u p

S e c u r i t y G r o u p

E C S Ta s k

D o g sC o n t a i n e r

S e c u r i t y G r o u p

630247214269 eni-0123456a 10.0.1.22110.76.2.101 27039 22 6 5 268 14664911411466491200 REJECT OK

22

StopTask: {task: “52c…”

}

$ docker diff / inspect

Page 34: Securing Microservices on AWS v2 - Cyber Security Summit · control of encryption keys CloudHSM Hardware-based key storage Server-Side Encryption Flexible data encryption options

© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Partner Community

DevOpsFoundation Monitoring and Logging Security Networking