SlideShare ist ein Scribd-Unternehmen logo
1 von 53
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Nathan Taber
June 2018
Building Secure Services Using
Containers
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.©2017, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Security in AWS
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Shared Responsibility Model
AWSCUSTOMER
Responsible for
Security “of” the cloud
Responsible for
Security “in” the cloud
Network and Firewall Configuration
Identity & Access Management
Customer Data
Compute Storage Database Networking
Regions Availability Zones Edge Locations
Operating System
Applications Platform
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Shared Responsibility Model
AWSCUSTOMER
Responsible for
Security “of” the cloud
Responsible for
Security “in” the cloud
Network and Firewall Configuration
Identity & Access Management
Customer Data
Compute Storage Database Networking
Regions Availability Zones Edge Locations
Operating System
Applications Platform
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Security Groups
• Everything in an AWS VPC is in at least one security group
• You can use a security group as both a source and destination for
security group rules
• Helps to handle the elasticity of a cloud environment without
resorting to complex network topologies with many subnets
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Shared Responsibility Model
AWSCUSTOMER
Responsible for
Security “of” the cloud
Responsible for
Security “in” the cloud
Network and Firewall Configuration
Identity & Access Management
Customer Data
Compute Storage Database Networking
Regions Availability Zones Edge Locations
Operating System
Applications Platform
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
IAM Roles and Policies
"Statement": [{
"Action": [
"rds-db:connect"
],
"Resource": [
"arn:aws:rds-db:us-east-1:501381841826:dbuser:db-QM2ZETM6KG/appuser"
],
"Effect": "Allow"
}]
Assign SSO access to users and groups in
your corporate Microsoft Active Directory
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.©2017, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Everything you can do security-wise on EC2
you can now do on Amazon ECS and Fargate
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Network and Firewall Configuration
Identity & Access Management
Customer Data
Compute Storage Database Networking
Regions Availability Zones Edge Locations
Operating System
Applications Platform
IAM Role and Network Interface per Task in ECS
In 2016 we launched the
capability to assign an IAM
role to each Task within ECS
At re:Invent 2017 we
launched the ability to have a
dedicated network interface
(ENI) and Security Group(s)
per Task
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
ECS on EC2 Shared Responsibility Model
AWSCUSTOMER
Network and Firewall Configuration
Identity & Access Management
Customer Data
Compute Storage Database Networking
Regions Availability Zones Edge Locations
Operating System
Images ECS Config
Instance Scaling /
Capacity Mgmt.
ECS Scheduler /
Control Plane
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Fargate Shared Responsibility Model
AWSCUSTOMER
Network and Firewall Configuration
Identity & Access Management
Customer Data
Compute Storage Database Networking
Regions Availability Zones Edge Locations
Images ECS Config
Instance Scaling /
Capacity Mgmt.
ECS Scheduler /
Control Plane
Operating System
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Security Benefits of Fargate
• We patch and maintain the underlying Linux and Docker
• You cannot ssh or docker exec onto anything
• All cross-container network traffic will go through the
Elastic Network Interface (ENI) and Security Group (SG)
• No privileged access to docker or the underlying host
• We never run one customer’s tasks/containers on the same
underlying Instance(s) as another
We do more, you do less.
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Services / Mechanisms for Customer Responsibilities
AWSCUSTOMER
Network and Firewall Configuration
Identity & Access Management
Customer Data
Compute Storage Database Networking
Regions Availability Zones Edge Locations
Images ECS Config
Instance Scaling /
Capacity Mgmt.
ECS Scheduler /
Control Plane
Operating System
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.©2017, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Building security into the
service lifecycle
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
BUILD DEPLOY
SECURE
MONITOR
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
#Source Code
Def not_the_real_code:
if whitespace then:
indent++
else:
console.log(“generic
message”)
raise(null)
Merge Pull
Request
CI Pipeline
Automated
Build
Build process
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Multi-stage Docker builds
# docker build .
FROM buildtools:v4.5
COPY ./src ./
# Build
RUN dotnet restore
RUN dotnet publish
WORKDIR bin/
CMD [“myapp”]
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Multi-stage Docker builds
# docker build .
FROM buildtools:v4.5
COPY ./src ./
# Build
RUN dotnet restore
RUN dotnet publish
WORKDIR bin/
CMD [“myapp”]
# docker run with volume
FROM buildtools:v4.5
RUN dotnet restore
RUN dotnet package
# docker build .
FROM runtime:v1.1
COPY ./src/bin /app
WORKDIR /app/
CMD [“myapp”]
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Multi-stage Docker builds
# docker build .
FROM buildtools:v4.5
COPY ./src ./
# Build
RUN dotnet restore
RUN dotnet publish
WORKDIR bin/
CMD [“myapp”]
# docker run with volume
FROM buildtools:v4.5
RUN dotnet restore
RUN dotnet package
# docker build .
FROM runtime:v1.1
COPY ./src/bin /app
WORKDIR /app/
CMD [“myapp”]
# docker build .
FROM buildtools:v4.5 as builder
RUN dotnet restore
RUN dotnet package
FROM runtime:v1.1 as tests
RUN testrunner
FROM runtime:v1.1
COPY --from=builder /src/bin
/app/
WORKDIR /app/CMD
[“myapp”]
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Windows
instance
Ubuntu
Linux
Ubuntu
container
Alpine
container
ReadOnly
FS
The unit of deployment
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
#Source Code
Def not_the_real_code:
if whitespace then:
indent++
else:
console.log(“generic
message”)
raise(null)
Merge Pull
Request
CI Pipeline
Automated
Build
Build process
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Scan for known
vulnerabilities (CVEs)
• Debian, CentOS, NIST,
Ubuntu & other sources
• Integrate into your CI
pipeline
Other vendors
• May add pip / npm
modules
Image vulnerability scanning with clair
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Docker image Amazon ECRCI Pipeline
Automated
Build
Build process
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Security best practices for container images
• Do not store secrets in Container Images
• Use trusted base images such as Docker Hub official
• Do not put unnecessary tools in the container image
• Do not use generic tags like :latest – use something
unique and informative like the git commit ID
• Try to only run one process per container
• Consider embedding tools from our Container Security
partners Aqua and Twistlock for runtime security
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
DEPLOYBUILD
SECURE
MONITOR
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Docker image Amazon ECR
clair
Amazon ECR
Deploy process - tagging
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Amazon ECR
Deploy process - tagging
Dev
Prod
Staging:Dev:Staging:Prod
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Tagging: Version And Environment
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
:latest
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
What actually gets deployed?
:Staging Task Definition:
• Container
• CPU+Memory
• Networking
• Volumes
Service Definition:
• A task definition
• # of containers
• Scaling metrics
• Load balancing
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Amazon ECR
Triggering a deploy
:Staging
Deploy
function
Update Task
Definition
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Amazon ECR
Triggering a deploy - to production
:Staging
Deploy
function
Update Task
Definition
2FA
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Lambda Pseudocode
whitelist = get_account_whitelist()
if account in whitelist:
if account == ’test’ or ’staging’:
deploy()
if account == ‘prod’:
lookup_username()
duo_verify(username)
deploy()
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Lambda Pseudocode
def deploy():
new_revision = aws.register_task_definition()
update_service(task = new_revision)
while true:
if current_deployment != yours:
raise error
if new_revisions_running == desired_count:
exit(success)
print new_revisions_running
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Rolling deployment – to do
:v1.09 :v1.09 :v1.09 :v1.09
Production service Canary
:v1.21
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Canary or “one-box” deployment
:v1.09 :v1.09 :v1.09 :v1.09
Production service Canary
:v1.21
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Secrets Management
Parameter
Store
/staging/rds/secret-username
/staging/rds/secret-password
#container_start.sh
export env=‘staging’
aws ssm get-parameters-by-path $env
:staging
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Updating The Underlying Instances
instances
Auto Scaling group
AMI
Current launch
configuration
Application Load Balancer
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Updating The Underlying Instances
instances
Auto Scaling group
AMI
Current launch
configuration
New AMI
New launch
configuration
Application Load Balancer
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Updating The Underlying Instances
instances
Auto Scaling group
instances
AMI
Current launch
configuration
New AMI
New launch
configuration
Application Load Balancer
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Updating The Underlying Instances
instances
Auto Scaling group
instances
AMI
Current launch
configuration
New AMI
New launch
configuration
Application Load Balancer
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Updating The Underlying Instances
instances
Auto Scaling group
instances
AMI
Current launch
configuration
New AMI
New launch
configuration
Application Load Balancer
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Updating The Underlying Instances
Auto Scaling group
instances
AMI
Current launch
configuration
New AMI
New launch
configuration
Application Load Balancer
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
MONITORBUILD
SECURE
DEPLOY
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
CloudWatch
Logs
Subscription
filter
Logging
{ "log-driver":
"awslogs",
"log-opts":
{”region":
"us-east-1"}
}
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Monitoring - SysDig
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Monitoring - SysDig
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Monitoring - SysDig
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Threat Detection - Amazon GuardDuty
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Tools Summary
Hardening Bastille, SELinux,
AppArmour
Capabilities,
SELinux
Verification Amazon Inspector,
Security Best Practices
checklist
Docker Bench,
Clair
Monitoring &
reporting
Amazon Inspector,
Amazon GuardDuty
Falco, Sysdig,
CloudWatch Logs
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved.
Things To Think About
What’s my responsibility?
What’ going into each container image?
What’s my most appropriate tagging strategy?
What’s my optimal deployment strategy?
How do I monitor this when it’s deployed?
©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.©2017, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

Deep Dive on Amazon GuardDuty - AWS Online Tech Talks
Deep Dive on Amazon GuardDuty - AWS Online Tech TalksDeep Dive on Amazon GuardDuty - AWS Online Tech Talks
Deep Dive on Amazon GuardDuty - AWS Online Tech TalksAmazon Web Services
 
Identity Round Robin Workshop - Serverless Round: Security Week at the SF Loft
Identity Round Robin Workshop - Serverless Round: Security Week at the SF LoftIdentity Round Robin Workshop - Serverless Round: Security Week at the SF Loft
Identity Round Robin Workshop - Serverless Round: Security Week at the SF LoftAmazon Web Services
 
Secure Configuration and Automation Overview
Secure Configuration and Automation OverviewSecure Configuration and Automation Overview
Secure Configuration and Automation OverviewAmazon Web Services
 
Identity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS SecurityIdentity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS SecurityAmazon Web Services
 
Understanding AWS Secrets Manager - AWS Online Tech Talks
Understanding AWS Secrets Manager - AWS Online Tech TalksUnderstanding AWS Secrets Manager - AWS Online Tech Talks
Understanding AWS Secrets Manager - AWS Online Tech TalksAmazon Web Services
 
Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...
Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...
Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...Amazon Web Services
 
Achieving Continuous Compliance with CTP and AWS
Achieving Continuous Compliance with CTP and AWS Achieving Continuous Compliance with CTP and AWS
Achieving Continuous Compliance with CTP and AWS Amazon Web Services
 
Adding the Sec to Your DevOps Pipelines
Adding the Sec to Your DevOps PipelinesAdding the Sec to Your DevOps Pipelines
Adding the Sec to Your DevOps PipelinesAmazon Web Services
 
AWS Cloud Security & Compliance Basics Webinar
AWS Cloud Security & Compliance Basics WebinarAWS Cloud Security & Compliance Basics Webinar
AWS Cloud Security & Compliance Basics WebinarAmazon Web Services
 
Achieving Compliance and Selling to Regulated Markets
Achieving Compliance and Selling to Regulated MarketsAchieving Compliance and Selling to Regulated Markets
Achieving Compliance and Selling to Regulated MarketsAmazon Web Services
 
Build security into your golden AMI pipeline - DEM08 - AWS reInforce 2019
Build security into your golden AMI pipeline - DEM08 - AWS reInforce 2019 Build security into your golden AMI pipeline - DEM08 - AWS reInforce 2019
Build security into your golden AMI pipeline - DEM08 - AWS reInforce 2019 Amazon Web Services
 
Detective Controls: Gain Visibility and Record Change
Detective Controls: Gain Visibility and Record ChangeDetective Controls: Gain Visibility and Record Change
Detective Controls: Gain Visibility and Record ChangeAmazon Web Services
 
Securing serverless and container services - SDD306 - AWS re:Inforce 2019
Securing serverless and container services - SDD306 - AWS re:Inforce 2019 Securing serverless and container services - SDD306 - AWS re:Inforce 2019
Securing serverless and container services - SDD306 - AWS re:Inforce 2019 Amazon Web Services
 
Secure and Integrated - Using IAM with Amazon MSK | Mitchell Henderson, AWS
Secure and Integrated - Using IAM with Amazon MSK | Mitchell Henderson, AWSSecure and Integrated - Using IAM with Amazon MSK | Mitchell Henderson, AWS
Secure and Integrated - Using IAM with Amazon MSK | Mitchell Henderson, AWSHostedbyConfluent
 
Intro to Threat Detection and Remediation on AWS
Intro to Threat Detection and Remediation on AWSIntro to Threat Detection and Remediation on AWS
Intro to Threat Detection and Remediation on AWSAmazon Web Services
 

Was ist angesagt? (20)

Deep Dive on Amazon GuardDuty - AWS Online Tech Talks
Deep Dive on Amazon GuardDuty - AWS Online Tech TalksDeep Dive on Amazon GuardDuty - AWS Online Tech Talks
Deep Dive on Amazon GuardDuty - AWS Online Tech Talks
 
Identity Round Robin Workshop - Serverless Round: Security Week at the SF Loft
Identity Round Robin Workshop - Serverless Round: Security Week at the SF LoftIdentity Round Robin Workshop - Serverless Round: Security Week at the SF Loft
Identity Round Robin Workshop - Serverless Round: Security Week at the SF Loft
 
Secure Configuration and Automation Overview
Secure Configuration and Automation OverviewSecure Configuration and Automation Overview
Secure Configuration and Automation Overview
 
Identity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS SecurityIdentity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS Security
 
Understanding AWS Secrets Manager - AWS Online Tech Talks
Understanding AWS Secrets Manager - AWS Online Tech TalksUnderstanding AWS Secrets Manager - AWS Online Tech Talks
Understanding AWS Secrets Manager - AWS Online Tech Talks
 
Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...
Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...
Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...
 
Federation & Access Management
Federation & Access ManagementFederation & Access Management
Federation & Access Management
 
Achieving Continuous Compliance with CTP and AWS
Achieving Continuous Compliance with CTP and AWS Achieving Continuous Compliance with CTP and AWS
Achieving Continuous Compliance with CTP and AWS
 
Adding the Sec to Your DevOps Pipelines
Adding the Sec to Your DevOps PipelinesAdding the Sec to Your DevOps Pipelines
Adding the Sec to Your DevOps Pipelines
 
AWS Cloud Security & Compliance Basics Webinar
AWS Cloud Security & Compliance Basics WebinarAWS Cloud Security & Compliance Basics Webinar
AWS Cloud Security & Compliance Basics Webinar
 
Introduzione ad Amazon EKS
Introduzione ad Amazon EKSIntroduzione ad Amazon EKS
Introduzione ad Amazon EKS
 
Achieving Compliance and Selling to Regulated Markets
Achieving Compliance and Selling to Regulated MarketsAchieving Compliance and Selling to Regulated Markets
Achieving Compliance and Selling to Regulated Markets
 
Build security into your golden AMI pipeline - DEM08 - AWS reInforce 2019
Build security into your golden AMI pipeline - DEM08 - AWS reInforce 2019 Build security into your golden AMI pipeline - DEM08 - AWS reInforce 2019
Build security into your golden AMI pipeline - DEM08 - AWS reInforce 2019
 
Detective Controls: Gain Visibility and Record Change
Detective Controls: Gain Visibility and Record ChangeDetective Controls: Gain Visibility and Record Change
Detective Controls: Gain Visibility and Record Change
 
Securing serverless and container services - SDD306 - AWS re:Inforce 2019
Securing serverless and container services - SDD306 - AWS re:Inforce 2019 Securing serverless and container services - SDD306 - AWS re:Inforce 2019
Securing serverless and container services - SDD306 - AWS re:Inforce 2019
 
Managing Security on AWS
Managing Security on AWSManaging Security on AWS
Managing Security on AWS
 
Secure and Integrated - Using IAM with Amazon MSK | Mitchell Henderson, AWS
Secure and Integrated - Using IAM with Amazon MSK | Mitchell Henderson, AWSSecure and Integrated - Using IAM with Amazon MSK | Mitchell Henderson, AWS
Secure and Integrated - Using IAM with Amazon MSK | Mitchell Henderson, AWS
 
Intro to Threat Detection and Remediation on AWS
Intro to Threat Detection and Remediation on AWSIntro to Threat Detection and Remediation on AWS
Intro to Threat Detection and Remediation on AWS
 
ThreatResponse
ThreatResponseThreatResponse
ThreatResponse
 
AWS Security Fundamentals
AWS Security FundamentalsAWS Security Fundamentals
AWS Security Fundamentals
 

Ähnlich wie Building Secure Services using Containers

From Code to a Running Container | AWS Floor28
From Code to a Running Container | AWS Floor28From Code to a Running Container | AWS Floor28
From Code to a Running Container | AWS Floor28Amazon Web Services
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019AWS Summits
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019Amazon Web Services
 
Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018Amazon Web Services
 
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018Amazon Web Services
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateAmazon Web Services
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWSAmazon Web Services
 
Introducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech TalksIntroducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech TalksAmazon Web Services
 
More Containers Less Operations
More Containers Less OperationsMore Containers Less Operations
More Containers Less OperationsDonnie Prakoso
 
DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)Amazon Web Services
 
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...Amazon Web Services
 
[AWS Container Service] Introducing AWS Fargate
[AWS Container Service] Introducing AWS Fargate[AWS Container Service] Introducing AWS Fargate
[AWS Container Service] Introducing AWS FargateAmazon Web Services Korea
 
Orchestrating containers on AWS | AWS Floor28
Orchestrating containers on AWS | AWS Floor28Orchestrating containers on AWS | AWS Floor28
Orchestrating containers on AWS | AWS Floor28Amazon Web Services
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfAmazon Web Services
 
How Zalando integrates Kubernetes with AWS
How Zalando integrates Kubernetes with AWSHow Zalando integrates Kubernetes with AWS
How Zalando integrates Kubernetes with AWSUri Savelchev
 

Ähnlich wie Building Secure Services using Containers (20)

Container Security
Container SecurityContainer Security
Container Security
 
From Code to a Running Container | AWS Floor28
From Code to a Running Container | AWS Floor28From Code to a Running Container | AWS Floor28
From Code to a Running Container | AWS Floor28
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
 
Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018
 
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
 
Using Containers on AWS
Using Containers on AWSUsing Containers on AWS
Using Containers on AWS
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWS
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Introducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech TalksIntroducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech Talks
 
More Containers Less Operations
More Containers Less OperationsMore Containers Less Operations
More Containers Less Operations
 
DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)
 
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
 
[AWS Container Service] Introducing AWS Fargate
[AWS Container Service] Introducing AWS Fargate[AWS Container Service] Introducing AWS Fargate
[AWS Container Service] Introducing AWS Fargate
 
EKS Workshop
 EKS Workshop EKS Workshop
EKS Workshop
 
Orchestrating containers on AWS | AWS Floor28
Orchestrating containers on AWS | AWS Floor28Orchestrating containers on AWS | AWS Floor28
Orchestrating containers on AWS | AWS Floor28
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
How Zalando integrates Kubernetes with AWS
How Zalando integrates Kubernetes with AWSHow Zalando integrates Kubernetes with AWS
How Zalando integrates Kubernetes with AWS
 

Mehr von Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Building Secure Services using Containers

  • 1. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Nathan Taber June 2018 Building Secure Services Using Containers
  • 2. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.
  • 3. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.©2017, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Security in AWS
  • 4. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Shared Responsibility Model AWSCUSTOMER Responsible for Security “of” the cloud Responsible for Security “in” the cloud Network and Firewall Configuration Identity & Access Management Customer Data Compute Storage Database Networking Regions Availability Zones Edge Locations Operating System Applications Platform
  • 5. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Shared Responsibility Model AWSCUSTOMER Responsible for Security “of” the cloud Responsible for Security “in” the cloud Network and Firewall Configuration Identity & Access Management Customer Data Compute Storage Database Networking Regions Availability Zones Edge Locations Operating System Applications Platform
  • 6. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Security Groups • Everything in an AWS VPC is in at least one security group • You can use a security group as both a source and destination for security group rules • Helps to handle the elasticity of a cloud environment without resorting to complex network topologies with many subnets
  • 7. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Shared Responsibility Model AWSCUSTOMER Responsible for Security “of” the cloud Responsible for Security “in” the cloud Network and Firewall Configuration Identity & Access Management Customer Data Compute Storage Database Networking Regions Availability Zones Edge Locations Operating System Applications Platform
  • 8. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. IAM Roles and Policies "Statement": [{ "Action": [ "rds-db:connect" ], "Resource": [ "arn:aws:rds-db:us-east-1:501381841826:dbuser:db-QM2ZETM6KG/appuser" ], "Effect": "Allow" }] Assign SSO access to users and groups in your corporate Microsoft Active Directory
  • 9. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.©2017, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Everything you can do security-wise on EC2 you can now do on Amazon ECS and Fargate
  • 10. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Network and Firewall Configuration Identity & Access Management Customer Data Compute Storage Database Networking Regions Availability Zones Edge Locations Operating System Applications Platform IAM Role and Network Interface per Task in ECS In 2016 we launched the capability to assign an IAM role to each Task within ECS At re:Invent 2017 we launched the ability to have a dedicated network interface (ENI) and Security Group(s) per Task
  • 11. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ECS on EC2 Shared Responsibility Model AWSCUSTOMER Network and Firewall Configuration Identity & Access Management Customer Data Compute Storage Database Networking Regions Availability Zones Edge Locations Operating System Images ECS Config Instance Scaling / Capacity Mgmt. ECS Scheduler / Control Plane
  • 12. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Fargate Shared Responsibility Model AWSCUSTOMER Network and Firewall Configuration Identity & Access Management Customer Data Compute Storage Database Networking Regions Availability Zones Edge Locations Images ECS Config Instance Scaling / Capacity Mgmt. ECS Scheduler / Control Plane Operating System
  • 13. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Security Benefits of Fargate • We patch and maintain the underlying Linux and Docker • You cannot ssh or docker exec onto anything • All cross-container network traffic will go through the Elastic Network Interface (ENI) and Security Group (SG) • No privileged access to docker or the underlying host • We never run one customer’s tasks/containers on the same underlying Instance(s) as another We do more, you do less.
  • 14. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Services / Mechanisms for Customer Responsibilities AWSCUSTOMER Network and Firewall Configuration Identity & Access Management Customer Data Compute Storage Database Networking Regions Availability Zones Edge Locations Images ECS Config Instance Scaling / Capacity Mgmt. ECS Scheduler / Control Plane Operating System
  • 15. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.©2017, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Building security into the service lifecycle
  • 16. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. BUILD DEPLOY SECURE MONITOR
  • 17. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. #Source Code Def not_the_real_code: if whitespace then: indent++ else: console.log(“generic message”) raise(null) Merge Pull Request CI Pipeline Automated Build Build process
  • 18. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Multi-stage Docker builds # docker build . FROM buildtools:v4.5 COPY ./src ./ # Build RUN dotnet restore RUN dotnet publish WORKDIR bin/ CMD [“myapp”]
  • 19. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Multi-stage Docker builds # docker build . FROM buildtools:v4.5 COPY ./src ./ # Build RUN dotnet restore RUN dotnet publish WORKDIR bin/ CMD [“myapp”] # docker run with volume FROM buildtools:v4.5 RUN dotnet restore RUN dotnet package # docker build . FROM runtime:v1.1 COPY ./src/bin /app WORKDIR /app/ CMD [“myapp”]
  • 20. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Multi-stage Docker builds # docker build . FROM buildtools:v4.5 COPY ./src ./ # Build RUN dotnet restore RUN dotnet publish WORKDIR bin/ CMD [“myapp”] # docker run with volume FROM buildtools:v4.5 RUN dotnet restore RUN dotnet package # docker build . FROM runtime:v1.1 COPY ./src/bin /app WORKDIR /app/ CMD [“myapp”] # docker build . FROM buildtools:v4.5 as builder RUN dotnet restore RUN dotnet package FROM runtime:v1.1 as tests RUN testrunner FROM runtime:v1.1 COPY --from=builder /src/bin /app/ WORKDIR /app/CMD [“myapp”]
  • 21. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Windows instance Ubuntu Linux Ubuntu container Alpine container ReadOnly FS The unit of deployment
  • 22. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. #Source Code Def not_the_real_code: if whitespace then: indent++ else: console.log(“generic message”) raise(null) Merge Pull Request CI Pipeline Automated Build Build process
  • 23. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Scan for known vulnerabilities (CVEs) • Debian, CentOS, NIST, Ubuntu & other sources • Integrate into your CI pipeline Other vendors • May add pip / npm modules Image vulnerability scanning with clair
  • 24. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Docker image Amazon ECRCI Pipeline Automated Build Build process
  • 25. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Security best practices for container images • Do not store secrets in Container Images • Use trusted base images such as Docker Hub official • Do not put unnecessary tools in the container image • Do not use generic tags like :latest – use something unique and informative like the git commit ID • Try to only run one process per container • Consider embedding tools from our Container Security partners Aqua and Twistlock for runtime security
  • 26. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. DEPLOYBUILD SECURE MONITOR
  • 27. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Docker image Amazon ECR clair Amazon ECR Deploy process - tagging
  • 28. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Amazon ECR Deploy process - tagging Dev Prod Staging:Dev:Staging:Prod
  • 29. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Tagging: Version And Environment
  • 30. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. :latest
  • 31. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. What actually gets deployed? :Staging Task Definition: • Container • CPU+Memory • Networking • Volumes Service Definition: • A task definition • # of containers • Scaling metrics • Load balancing
  • 32. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Amazon ECR Triggering a deploy :Staging Deploy function Update Task Definition
  • 33. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Amazon ECR Triggering a deploy - to production :Staging Deploy function Update Task Definition 2FA
  • 34. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Lambda Pseudocode whitelist = get_account_whitelist() if account in whitelist: if account == ’test’ or ’staging’: deploy() if account == ‘prod’: lookup_username() duo_verify(username) deploy()
  • 35. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Lambda Pseudocode def deploy(): new_revision = aws.register_task_definition() update_service(task = new_revision) while true: if current_deployment != yours: raise error if new_revisions_running == desired_count: exit(success) print new_revisions_running
  • 36. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Rolling deployment – to do :v1.09 :v1.09 :v1.09 :v1.09 Production service Canary :v1.21
  • 37. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Canary or “one-box” deployment :v1.09 :v1.09 :v1.09 :v1.09 Production service Canary :v1.21
  • 38. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Secrets Management Parameter Store /staging/rds/secret-username /staging/rds/secret-password #container_start.sh export env=‘staging’ aws ssm get-parameters-by-path $env :staging
  • 39. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Updating The Underlying Instances instances Auto Scaling group AMI Current launch configuration Application Load Balancer
  • 40. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Updating The Underlying Instances instances Auto Scaling group AMI Current launch configuration New AMI New launch configuration Application Load Balancer
  • 41. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Updating The Underlying Instances instances Auto Scaling group instances AMI Current launch configuration New AMI New launch configuration Application Load Balancer
  • 42. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Updating The Underlying Instances instances Auto Scaling group instances AMI Current launch configuration New AMI New launch configuration Application Load Balancer
  • 43. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Updating The Underlying Instances instances Auto Scaling group instances AMI Current launch configuration New AMI New launch configuration Application Load Balancer
  • 44. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Updating The Underlying Instances Auto Scaling group instances AMI Current launch configuration New AMI New launch configuration Application Load Balancer
  • 45. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. MONITORBUILD SECURE DEPLOY
  • 46. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. CloudWatch Logs Subscription filter Logging { "log-driver": "awslogs", "log-opts": {”region": "us-east-1"} }
  • 47. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Monitoring - SysDig
  • 48. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Monitoring - SysDig
  • 49. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Monitoring - SysDig
  • 50. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Threat Detection - Amazon GuardDuty
  • 51. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Tools Summary Hardening Bastille, SELinux, AppArmour Capabilities, SELinux Verification Amazon Inspector, Security Best Practices checklist Docker Bench, Clair Monitoring & reporting Amazon Inspector, Amazon GuardDuty Falco, Sysdig, CloudWatch Logs
  • 52. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved. ©2018, AmazonWebServices, Inc. or its affiliates. All rights reserved. Things To Think About What’s my responsibility? What’ going into each container image? What’s my most appropriate tagging strategy? What’s my optimal deployment strategy? How do I monitor this when it’s deployed?
  • 53. ©2018, AmazonWebServices, Inc. or its Affiliates. All rights reserved.©2017, AmazonWebServices, Inc. or its Affiliates. All rights reserved. Thank you!