SlideShare a Scribd company logo
1 of 53
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Secrets Manager –
best practices for managing,
retrieving, and rotating secrets at
scale
Apurv Awasthi
Sr. Product Manager
AWS
S E C 3 0 4
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• I don’t want to email secrets
• I want to prevent developers from viewing or sharing secrets
• I want to stop “secret sprawl”
• I want visibility in to who used which secret, when
• I want to enable teams to operate quickly, without waiting on the
security team to create and provision secrets
• I want to roll-out secrets safely
• I want to rotate secrets without system downtime
SEC 304 – best practices for managing, retrieving, and rotating secrets at
scale with AWS Secrets Manager
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Secrets Manager enables customers
to manage, retrieve, and rotate database
credentials, API keys, and other secrets
throughout their lifecycle
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• IT Admins: store and manage access to
secrets securely and at scale
• Security Admins: audit and monitor the
use of secrets, and rotate secrets
without a risk of breaking applications
• Developers: avoid dealing with secrets
in their applications
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What to expect from this session?
• Understand the capabilities of AWS Secrets Manager
• Learn how to adopt AWS Secrets Manager
• Pro tips for managing secrets through their lifecycle at scale
• Demos
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rotate secrets
safely
Pay as you goFine-grained
access control
and auditability
Secure
centrally
Capabilities
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Secure
• Stored centrally and retrieved programmatically
• Encrypted by default using encryption keys owned
by the customer
• Support for VPC-endpoints via AWS Private Links
• Integrated with CloudFormation
• Support for client-side caching
• Compliant with HIPAA
Create and store secrets so that developers don’t view or handle secrets
, PCI, and ISO
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sample command
aws secretsmanager create-secret --name TestApplication/MyTestDatabaseSecret
--description “Upload credentials for my test database from the CLI. Team Isengard
owns this secret."
--secret-string file://mycreds.json
aws secretsmanager get-secret-value --secret-id TestApplication/MyTestDatabaseSecret
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fine-grained access control and auditability
• IAM policies for fine-grained access control
• Resource-based policies for cross-account access
• Tag-based access control and hierarchical names
for scalability
• Integrated with CloudTrail, CloudWatch
Control access and audit use to prevent “secret sprawl”
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sample policy
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect": "Allow",
"Action": ["secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret"],
"Resource": "arn:aws:secretsmanager:us-east-2:000000000000:secret:
TestApplication/MyTestDatabaseSecret"
}
]
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rotate secrets safely
• Built-in integrations for rotating all Amazon
Relational Database Service (Amazon RDS)
database types
• Extensible with AWS Lambda
• Use versioning so that applications don’t break
when secrets are rotated
• Pay for the API call; no additional charge for
rotating secrets
Transform a long-term secret in to a short-term secret that is rotated automatically
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Application
MS SQL
instance
AWS Secrets
Manager
AWS Relational
Database Service (RDS)
GetSecretVaule command
{Ua, Pa}
{Ua, Pa}
DataStage: AWSCURRENT
{Ua, Pa}
How rotation works
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Application
MS SQL
instance
AWS Secrets
Manager
AWS Relational
Database Service (RDS)
Stage: AWSPENDING
GetSecretVaule command
{Ua, Pa}
{Ua, Pa}
Data
{Ua, Pa}
Create and validate new database credential {Ub, Pb}
Confirmation message
{Ub, Pb}
How rotation works
Stage: AWSCURRENT
VPC
Rotation
Lambda
Function
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Stage: AWSCURRENTStage: AWSPREVIOUS
Application
MS SQL
instance
AWS Secrets
Manager
AWS Relational
Database Service (RDS)
GetSecretVaule command
{Ub, Pb}
{Ub, Pb}
Data
{Ua, Pa}
{Ub, Pb}
How rotation works
VPC
Rotation
Lambda
Function
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pay as you go
• No annual license or up front cost
• 30 day free trial for experimentation
• $0.40 per secret per month (pro-rated based on
the number of hours)
• $0.05 per 10,000 API calls
Pay only for what you use
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Network diagram for demo
VPC
Example Host 1
Bastion Host
Public subnet 1
Private subnet 1
NAT gateway 1
Rotation Lambda Function
MySQL DB instance NAT gateway 2
Internet
gateway
Example Host 2
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adopting Secrets Manager
1. Remove plain-text secrets
2. Rotate frequently
3. Retrieve programmatically
4. Lock down permissions
5. Use unique secrets
6. Audit and monitor the use of secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adopting Secrets Manager
1. Remove plain-text secrets
2. Rotate frequently
3. Retrieve programmatically
4. Lock down permissions
5. Use unique secrets
6. Audit and monitor the use of secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Remove plain-text secrets
Benefits
• Reduce risk of misuse
• Reduce “secret sprawl”
• Reduce overhead on developers
How to get started
• Pick an account strategy – manage
secrets in a central account or across
multiple accounts
• Find where secrets are being used
• Automate migration using AWS
CloudFormation or custom tools
Pro tip:
• Operate Secrets Manager in each AWS account
• Define practices for naming, retrieving, encrypting, and rotating
secrets
• Sanity check the number of secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Define practices for naming
Good practice
Poor practice
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Define practices for naming
Good practice
Poor practice
Instead
• Use names that are meaningful
• Hierarchical names (e.g., prod/MyMobileApp/MySQL)
are scalable
• Use description to record details about this secret
• Use tags to group secrets and manage these easily at
scale
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Define practices for naming
Good practice
Poor practice
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Define practices for naming
Good practice
Poor practice
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Define practices for naming
Good practice
Poor practice
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Define practices for naming
Good practice
Poor practice
“Statement": [
{
"Sid": “RequireTagWhenYouCreateSecret",
"Effect": "Allow",
"Action": [
“secretsmanager:CreateSecret“
],
"Resource": "*",
"Condition": {
"StringLike": {
“SecretsManager:RequestTag/Team": "*"
}
}
}
]
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Define practices for encryption
Good practice
Poor practice
Depends
Default service key
• Unique key for each account and region
• No overheard of managing AWS KMS permissions
Customer master key (CMK)
• Unique compliance or security requirements
• Required for cross-account access to secrets
• Another set of access control
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adopting Secrets Manager
1. Remove plain-text secrets
2. Rotate frequently
3. Retrieve programmatically
4. Lock down permissions
5. Use unique secrets
6. Audit and monitor the use of secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. Rotate frequently
Benefits
• Improve security
• Follow best practice
How to get started
• For existing applications, first migrate
the secret, then configure rotation
• For new applications, set up rotation
from the start
• Create the rotation lambda function
Pro tip:
• Use the default frequency of 30 days; check your compliance and
security requirements
• Pay for APIs and use of Lambda; no extra charge for rotation
• Rotation Lambda functions must be able to communicate both with
the protected resource (e.g. a database) and with Secrets Manager
• Use VPC end-points
• Update the password policy according to your downstream systems
• Reuse rotation Lambda functions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rotate frequently
Good practice
Poor practice
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rotate frequently
Good practice
Poor practice
• Set up rotation ASAP
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rotate frequently
Create new Lambda
Reuse existing Lambda
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rotate frequently
Create new Lambda
Reuse existing Lambda
• Easier to separate IAM permissions from Secrets
Manager permissions
• Easier to manage a small number of rotation lambda
functions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rotate frequently
Use this secret
Use previously stored secret
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rotate frequently
Use this secret
Use previously stored secret
• Rotate between credentials for two database users
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adopting Secrets Manager
1. Remove plain-text secrets
2. Rotate frequently
3. Retrieve programmatically
4. Lock down permissions
5. Use unique secrets
6. Audit and monitor the use of secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
3. Retrieve programmatically
Benefit
• Developers don’t have to view or
manage secrets
How to get started
• Create IAM roles for you applications
• Grant these IAM roles the ability to
retrieve secrets
• Update code to call GetSecretValue API
Pro tip:
• Retrieve every hour
• Use client-side caching libraries, or develop your own SDK, for example
similar to Spring Cloud SDK
• Place the code to retrieve outside the Lambda handler
• Schedule for deletion
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Example: C3P0 connection pooling via Spring
<bean id="employeeDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl" value="jdbc:mysql://my-dummy-rds-
instance.rds.amazonaws.com:3306" />
<property name="user" value="user" />
<property name="password" value="password" />
</bean>
<bean id="employeeDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass"
value="com.amazonaws.secretsmanager.sql.AWSSecretsManagerMySQLDriver" />
<property name="jdbcUrl" value="jdbc-secretsmanager:mysql://my-dummy-rds-
instance.rds.amazonaws.com:3306" />
<!-- The property below can take a secret-id as ARN or friendly name -->
<property name="user" value="demo-secret" />
</bean>
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adopting Secrets Manager
1. Remove plain-text secrets
2. Rotate frequently
3. Retrieve programmatically
4. Lock down permissions
5. Use unique secrets
6. Audit and monitor the use of secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
4. Lock down permissions
Benefits
• Support least privileges
• Less chance of human mistake
How to get started
• Identify who needs what access
• Define IAM policies
• Use resource based policies for cross-
account access
Pro tip:
• Tightly control secretsmanager:* permissions
• Grant ListSecrets and DescribeSecret permissions
• Configuring rotation requires IAM permissions
• Separate storing, retrieving, and configuring rotation tasks
• Use tags to group secrets
• Use tag-on-create to make secrets management self-service
• Cross-account access requires CMKs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adopting Secrets Manager
1. Remove plain-text secrets
2. Rotate frequently
3. Retrieve programmatically
4. Lock down permissions
5. Use unique secrets
6. Audit and monitor the use of secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
5. Use unique secrets
Benefits
• Minimize blast radius
• Easily recover in restart or DR scenarios
• Minimize overhead of synchronizing
secrets
How to get started
• Use CloudFormation or other tooling to
provision secrets
• Require applications to retrieve secrets
from the regional Secrets Manager end-
point
Pro tip:
• Use unique secrets per environment, per AWS Region, per account
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Application
MS SQL
instance
AWS Secrets
Manager
GetSecretVaule
{Ua, Pa}
{Ua,Pa}
Use unique secrets
Data
Application
MS SQL
instance
AWS Secrets
Manager
GetSecretVaule
{Ua, Pb}
{Ua,Pb}
Data
AWS Region – US West 2 (Oregon) AWS Region – US East 2 (Ohio)
Replicate
Replicate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adopting Secrets Manager
1. Remove plain-text secrets
2. Rotate frequently
3. Retrieve programmatically
4. Lock down permissions
5. Use unique secrets
6. Audit and monitor the use of secrets
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
6. Audit and monitor the use of secrets
Benefits
• Support least privileges
• Less chance of human mistake
How to get started
• Quick glance – IAM Access Advisor
• Auditable records – AWS CloudTrail Logs
• Monitor use – Amazon CloudWatch Events
Pro tip:
• Monitor attempts to retrieve secrets that are scheduled for deletion
• Monitor high value secrets
• CloudTrail records all Secrets Manager API calls; expect an increase in
the size of your trails
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Audit and monitor
AWS CloudTrail Amazon CloudWatch Events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Network diagram for demo
VPC
Example Host 1
Bastion Host
Example Host 2
Public subnet 1 Public subnet 2
Private subnet 1 Private subnet 2
NAT gateway 1 NAT gateway 2
Rotation Lambda Function
Secrets Manager VPC Endpoint
CloudFormation VPC Endpoint
Secrets Manager VPC Endpoint
CloudFormation VPC Endpoint
MySQL DB
instance
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Apurv Awasthi
Email: awasth@amazon.com
Twitter: @awasthi_av
(or, the blackjack tables at
Treasure Island)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)Amazon Web Services
 
Introducing AWS Certificate Manager Private Certificate Authority (CA) - AWS ...
Introducing AWS Certificate Manager Private Certificate Authority (CA) - AWS ...Introducing AWS Certificate Manager Private Certificate Authority (CA) - AWS ...
Introducing AWS Certificate Manager Private Certificate Authority (CA) - AWS ...Amazon Web Services
 
AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016
AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016
AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016Amazon Web Services
 
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015Amazon Web Services Korea
 
AWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipelineAWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipelineJulien SIMON
 
SID305 AWS Certificate Manager Private CA
SID305 AWS Certificate Manager Private CASID305 AWS Certificate Manager Private CA
SID305 AWS Certificate Manager Private CAAmazon Web Services
 
Deep Dive on AWS Single Sign-On - AWS Online Tech Talks
Deep Dive on AWS Single Sign-On - AWS Online Tech TalksDeep Dive on AWS Single Sign-On - AWS Online Tech Talks
Deep Dive on AWS Single Sign-On - AWS Online Tech TalksAmazon Web Services
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSAmazon Web Services
 
(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep Dive(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep DiveAmazon Web Services
 

What's hot (20)

Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)
 
Introduction of AWS KMS
Introduction of AWS KMSIntroduction of AWS KMS
Introduction of AWS KMS
 
Deep dive into AWS fargate
Deep dive into AWS fargateDeep dive into AWS fargate
Deep dive into AWS fargate
 
Introducing AWS Certificate Manager Private Certificate Authority (CA) - AWS ...
Introducing AWS Certificate Manager Private Certificate Authority (CA) - AWS ...Introducing AWS Certificate Manager Private Certificate Authority (CA) - AWS ...
Introducing AWS Certificate Manager Private Certificate Authority (CA) - AWS ...
 
AWS API Gateway
AWS API GatewayAWS API Gateway
AWS API Gateway
 
Amazon EKS Deep Dive
Amazon EKS Deep DiveAmazon EKS Deep Dive
Amazon EKS Deep Dive
 
AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016
AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016
AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016
 
AWS EC2 Fundametals
AWS EC2 FundametalsAWS EC2 Fundametals
AWS EC2 Fundametals
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
 
Deep Dive on AWS Lambda
Deep Dive on AWS LambdaDeep Dive on AWS Lambda
Deep Dive on AWS Lambda
 
AWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipelineAWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipeline
 
Intro to AWS Lambda
Intro to AWS Lambda Intro to AWS Lambda
Intro to AWS Lambda
 
IAM Introduction
IAM IntroductionIAM Introduction
IAM Introduction
 
Amazon s3
Amazon s3Amazon s3
Amazon s3
 
Intro to AWS: Security
Intro to AWS: SecurityIntro to AWS: Security
Intro to AWS: Security
 
SID305 AWS Certificate Manager Private CA
SID305 AWS Certificate Manager Private CASID305 AWS Certificate Manager Private CA
SID305 AWS Certificate Manager Private CA
 
Deep Dive on AWS Single Sign-On - AWS Online Tech Talks
Deep Dive on AWS Single Sign-On - AWS Online Tech TalksDeep Dive on AWS Single Sign-On - AWS Online Tech Talks
Deep Dive on AWS Single Sign-On - AWS Online Tech Talks
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKS
 
(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep Dive(SEC318) AWS CloudTrail Deep Dive
(SEC318) AWS CloudTrail Deep Dive
 

Similar to AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Secrets at Scale (SEC304) - AWS re:Invent 2018

Best Practices for Encrypting Data on AWS
Best Practices for Encrypting Data on AWSBest Practices for Encrypting Data on AWS
Best Practices for Encrypting Data on AWSAmazon Web Services
 
AWS Security and Encryption
AWS Security and EncryptionAWS Security and Encryption
AWS Security and EncryptionRichard Harvey
 
Deep dive - AWS security by design
Deep dive - AWS security by designDeep dive - AWS security by design
Deep dive - AWS security by designRichard Harvey
 
Compliance and Security Mitigation Techniques
Compliance and Security Mitigation TechniquesCompliance and Security Mitigation Techniques
Compliance and Security Mitigation TechniquesAmazon Web Services
 
SecuringYourCustomersDataFromDayOne_SFStartupDay
SecuringYourCustomersDataFromDayOne_SFStartupDaySecuringYourCustomersDataFromDayOne_SFStartupDay
SecuringYourCustomersDataFromDayOne_SFStartupDayAmazon Web Services
 
Securing Your Customers Data From Day One
Securing Your Customers Data From Day OneSecuring Your Customers Data From Day One
Securing Your Customers Data From Day OneAmazon Web Services
 
Security Framework Shakedown: Chart Your Journey with AWS Best Practices (SEC...
Security Framework Shakedown: Chart Your Journey with AWS Best Practices (SEC...Security Framework Shakedown: Chart Your Journey with AWS Best Practices (SEC...
Security Framework Shakedown: Chart Your Journey with AWS Best Practices (SEC...Amazon 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
 
AWS18_StartupDayToronto_SecuringYourCustomersDataFromDayOne
AWS18_StartupDayToronto_SecuringYourCustomersDataFromDayOneAWS18_StartupDayToronto_SecuringYourCustomersDataFromDayOne
AWS18_StartupDayToronto_SecuringYourCustomersDataFromDayOneAmazon Web Services
 
Securing Customer Data from Day 1 - AWS Startup Day Boston 2018.pdf
Securing Customer Data from Day 1 - AWS Startup Day Boston 2018.pdfSecuring Customer Data from Day 1 - AWS Startup Day Boston 2018.pdf
Securing Customer Data from Day 1 - AWS Startup Day Boston 2018.pdfAmazon Web Services
 
AWS STARTUP DAY 2018 I Securing Your Customer Data From Day One
AWS STARTUP DAY 2018 I Securing Your Customer Data From Day OneAWS STARTUP DAY 2018 I Securing Your Customer Data From Day One
AWS STARTUP DAY 2018 I Securing Your Customer Data From Day OneAWS Germany
 
Getting Started with AWS Security
Getting Started with AWS SecurityGetting Started with AWS Security
Getting Started with AWS SecurityAmazon Web Services
 
How to Implement a Well-Architected Security Solution.pdf
How to Implement a Well-Architected Security Solution.pdfHow to Implement a Well-Architected Security Solution.pdf
How to Implement a Well-Architected Security Solution.pdfAmazon Web Services
 
Best Practices to Secure Data Lake on AWS (ANT327) - AWS re:Invent 2018
Best Practices to Secure Data Lake on AWS (ANT327) - AWS re:Invent 2018Best Practices to Secure Data Lake on AWS (ANT327) - AWS re:Invent 2018
Best Practices to Secure Data Lake on AWS (ANT327) - AWS re:Invent 2018Amazon Web Services
 
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...Amazon Web Services
 

Similar to AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Secrets at Scale (SEC304) - AWS re:Invent 2018 (20)

Best Practices for Encrypting Data on AWS
Best Practices for Encrypting Data on AWSBest Practices for Encrypting Data on AWS
Best Practices for Encrypting Data on AWS
 
AWS Security and Encryption
AWS Security and EncryptionAWS Security and Encryption
AWS Security and Encryption
 
Deep dive - AWS security by design
Deep dive - AWS security by designDeep dive - AWS security by design
Deep dive - AWS security by design
 
Compliance and Security Mitigation Techniques
Compliance and Security Mitigation TechniquesCompliance and Security Mitigation Techniques
Compliance and Security Mitigation Techniques
 
Securing Your Customers Data From Day One
Securing Your Customers Data From Day OneSecuring Your Customers Data From Day One
Securing Your Customers Data From Day One
 
SecuringYourCustomersDataFromDayOne_SFStartupDay
SecuringYourCustomersDataFromDayOne_SFStartupDaySecuringYourCustomersDataFromDayOne_SFStartupDay
SecuringYourCustomersDataFromDayOne_SFStartupDay
 
Mitigating techniques
Mitigating techniquesMitigating techniques
Mitigating techniques
 
Securing Your Customers Data From Day One
Securing Your Customers Data From Day OneSecuring Your Customers Data From Day One
Securing Your Customers Data From Day One
 
Security Framework Shakedown: Chart Your Journey with AWS Best Practices (SEC...
Security Framework Shakedown: Chart Your Journey with AWS Best Practices (SEC...Security Framework Shakedown: Chart Your Journey with AWS Best Practices (SEC...
Security Framework Shakedown: Chart Your Journey with AWS Best Practices (SEC...
 
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
 
AWS18_StartupDayToronto_SecuringYourCustomersDataFromDayOne
AWS18_StartupDayToronto_SecuringYourCustomersDataFromDayOneAWS18_StartupDayToronto_SecuringYourCustomersDataFromDayOne
AWS18_StartupDayToronto_SecuringYourCustomersDataFromDayOne
 
How AI is disrupting the world
How AI is disrupting the world How AI is disrupting the world
How AI is disrupting the world
 
Securing Customer Data from Day 1 - AWS Startup Day Boston 2018.pdf
Securing Customer Data from Day 1 - AWS Startup Day Boston 2018.pdfSecuring Customer Data from Day 1 - AWS Startup Day Boston 2018.pdf
Securing Customer Data from Day 1 - AWS Startup Day Boston 2018.pdf
 
AWS Secrets for Best Practices
AWS Secrets for Best PracticesAWS Secrets for Best Practices
AWS Secrets for Best Practices
 
AWS Secrets for Best Practices
AWS Secrets for Best PracticesAWS Secrets for Best Practices
AWS Secrets for Best Practices
 
AWS STARTUP DAY 2018 I Securing Your Customer Data From Day One
AWS STARTUP DAY 2018 I Securing Your Customer Data From Day OneAWS STARTUP DAY 2018 I Securing Your Customer Data From Day One
AWS STARTUP DAY 2018 I Securing Your Customer Data From Day One
 
Getting Started with AWS Security
Getting Started with AWS SecurityGetting Started with AWS Security
Getting Started with AWS Security
 
How to Implement a Well-Architected Security Solution.pdf
How to Implement a Well-Architected Security Solution.pdfHow to Implement a Well-Architected Security Solution.pdf
How to Implement a Well-Architected Security Solution.pdf
 
Best Practices to Secure Data Lake on AWS (ANT327) - AWS re:Invent 2018
Best Practices to Secure Data Lake on AWS (ANT327) - AWS re:Invent 2018Best Practices to Secure Data Lake on AWS (ANT327) - AWS re:Invent 2018
Best Practices to Secure Data Lake on AWS (ANT327) - AWS re:Invent 2018
 
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
Operational Excellence for Identity & Access Management (SEC334) - AWS re:Inv...
 

More from 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
 

More from 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
 

AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Secrets at Scale (SEC304) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Secrets Manager – best practices for managing, retrieving, and rotating secrets at scale Apurv Awasthi Sr. Product Manager AWS S E C 3 0 4
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • I don’t want to email secrets • I want to prevent developers from viewing or sharing secrets • I want to stop “secret sprawl” • I want visibility in to who used which secret, when • I want to enable teams to operate quickly, without waiting on the security team to create and provision secrets • I want to roll-out secrets safely • I want to rotate secrets without system downtime SEC 304 – best practices for managing, retrieving, and rotating secrets at scale with AWS Secrets Manager
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Secrets Manager enables customers to manage, retrieve, and rotate database credentials, API keys, and other secrets throughout their lifecycle
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • IT Admins: store and manage access to secrets securely and at scale • Security Admins: audit and monitor the use of secrets, and rotate secrets without a risk of breaking applications • Developers: avoid dealing with secrets in their applications
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What to expect from this session? • Understand the capabilities of AWS Secrets Manager • Learn how to adopt AWS Secrets Manager • Pro tips for managing secrets through their lifecycle at scale • Demos
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rotate secrets safely Pay as you goFine-grained access control and auditability Secure centrally Capabilities
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Secure • Stored centrally and retrieved programmatically • Encrypted by default using encryption keys owned by the customer • Support for VPC-endpoints via AWS Private Links • Integrated with CloudFormation • Support for client-side caching • Compliant with HIPAA Create and store secrets so that developers don’t view or handle secrets , PCI, and ISO
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Sample command aws secretsmanager create-secret --name TestApplication/MyTestDatabaseSecret --description “Upload credentials for my test database from the CLI. Team Isengard owns this secret." --secret-string file://mycreds.json aws secretsmanager get-secret-value --secret-id TestApplication/MyTestDatabaseSecret
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Fine-grained access control and auditability • IAM policies for fine-grained access control • Resource-based policies for cross-account access • Tag-based access control and hierarchical names for scalability • Integrated with CloudTrail, CloudWatch Control access and audit use to prevent “secret sprawl”
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Sample policy { "Version" : "2012-10-17", "Statement" : [ { "Effect": "Allow", "Action": ["secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret"], "Resource": "arn:aws:secretsmanager:us-east-2:000000000000:secret: TestApplication/MyTestDatabaseSecret" } ] }
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rotate secrets safely • Built-in integrations for rotating all Amazon Relational Database Service (Amazon RDS) database types • Extensible with AWS Lambda • Use versioning so that applications don’t break when secrets are rotated • Pay for the API call; no additional charge for rotating secrets Transform a long-term secret in to a short-term secret that is rotated automatically
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Application MS SQL instance AWS Secrets Manager AWS Relational Database Service (RDS) GetSecretVaule command {Ua, Pa} {Ua, Pa} DataStage: AWSCURRENT {Ua, Pa} How rotation works
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Application MS SQL instance AWS Secrets Manager AWS Relational Database Service (RDS) Stage: AWSPENDING GetSecretVaule command {Ua, Pa} {Ua, Pa} Data {Ua, Pa} Create and validate new database credential {Ub, Pb} Confirmation message {Ub, Pb} How rotation works Stage: AWSCURRENT VPC Rotation Lambda Function
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Stage: AWSCURRENTStage: AWSPREVIOUS Application MS SQL instance AWS Secrets Manager AWS Relational Database Service (RDS) GetSecretVaule command {Ub, Pb} {Ub, Pb} Data {Ua, Pa} {Ub, Pb} How rotation works VPC Rotation Lambda Function
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Pay as you go • No annual license or up front cost • 30 day free trial for experimentation • $0.40 per secret per month (pro-rated based on the number of hours) • $0.05 per 10,000 API calls Pay only for what you use
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Network diagram for demo VPC Example Host 1 Bastion Host Public subnet 1 Private subnet 1 NAT gateway 1 Rotation Lambda Function MySQL DB instance NAT gateway 2 Internet gateway Example Host 2
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adopting Secrets Manager 1. Remove plain-text secrets 2. Rotate frequently 3. Retrieve programmatically 4. Lock down permissions 5. Use unique secrets 6. Audit and monitor the use of secrets
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adopting Secrets Manager 1. Remove plain-text secrets 2. Rotate frequently 3. Retrieve programmatically 4. Lock down permissions 5. Use unique secrets 6. Audit and monitor the use of secrets
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Remove plain-text secrets Benefits • Reduce risk of misuse • Reduce “secret sprawl” • Reduce overhead on developers How to get started • Pick an account strategy – manage secrets in a central account or across multiple accounts • Find where secrets are being used • Automate migration using AWS CloudFormation or custom tools Pro tip: • Operate Secrets Manager in each AWS account • Define practices for naming, retrieving, encrypting, and rotating secrets • Sanity check the number of secrets
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Define practices for naming Good practice Poor practice
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Define practices for naming Good practice Poor practice Instead • Use names that are meaningful • Hierarchical names (e.g., prod/MyMobileApp/MySQL) are scalable • Use description to record details about this secret • Use tags to group secrets and manage these easily at scale
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Define practices for naming Good practice Poor practice
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Define practices for naming Good practice Poor practice
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Define practices for naming Good practice Poor practice
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Define practices for naming Good practice Poor practice “Statement": [ { "Sid": “RequireTagWhenYouCreateSecret", "Effect": "Allow", "Action": [ “secretsmanager:CreateSecret“ ], "Resource": "*", "Condition": { "StringLike": { “SecretsManager:RequestTag/Team": "*" } } } ]
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Define practices for encryption Good practice Poor practice Depends Default service key • Unique key for each account and region • No overheard of managing AWS KMS permissions Customer master key (CMK) • Unique compliance or security requirements • Required for cross-account access to secrets • Another set of access control
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adopting Secrets Manager 1. Remove plain-text secrets 2. Rotate frequently 3. Retrieve programmatically 4. Lock down permissions 5. Use unique secrets 6. Audit and monitor the use of secrets
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. Rotate frequently Benefits • Improve security • Follow best practice How to get started • For existing applications, first migrate the secret, then configure rotation • For new applications, set up rotation from the start • Create the rotation lambda function Pro tip: • Use the default frequency of 30 days; check your compliance and security requirements • Pay for APIs and use of Lambda; no extra charge for rotation • Rotation Lambda functions must be able to communicate both with the protected resource (e.g. a database) and with Secrets Manager • Use VPC end-points • Update the password policy according to your downstream systems • Reuse rotation Lambda functions
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rotate frequently Good practice Poor practice
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rotate frequently Good practice Poor practice • Set up rotation ASAP
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rotate frequently Create new Lambda Reuse existing Lambda
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rotate frequently Create new Lambda Reuse existing Lambda • Easier to separate IAM permissions from Secrets Manager permissions • Easier to manage a small number of rotation lambda functions
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rotate frequently Use this secret Use previously stored secret
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rotate frequently Use this secret Use previously stored secret • Rotate between credentials for two database users
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adopting Secrets Manager 1. Remove plain-text secrets 2. Rotate frequently 3. Retrieve programmatically 4. Lock down permissions 5. Use unique secrets 6. Audit and monitor the use of secrets
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3. Retrieve programmatically Benefit • Developers don’t have to view or manage secrets How to get started • Create IAM roles for you applications • Grant these IAM roles the ability to retrieve secrets • Update code to call GetSecretValue API Pro tip: • Retrieve every hour • Use client-side caching libraries, or develop your own SDK, for example similar to Spring Cloud SDK • Place the code to retrieve outside the Lambda handler • Schedule for deletion
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Example: C3P0 connection pooling via Spring <bean id="employeeDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="jdbcUrl" value="jdbc:mysql://my-dummy-rds- instance.rds.amazonaws.com:3306" /> <property name="user" value="user" /> <property name="password" value="password" /> </bean> <bean id="employeeDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="com.amazonaws.secretsmanager.sql.AWSSecretsManagerMySQLDriver" /> <property name="jdbcUrl" value="jdbc-secretsmanager:mysql://my-dummy-rds- instance.rds.amazonaws.com:3306" /> <!-- The property below can take a secret-id as ARN or friendly name --> <property name="user" value="demo-secret" /> </bean>
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adopting Secrets Manager 1. Remove plain-text secrets 2. Rotate frequently 3. Retrieve programmatically 4. Lock down permissions 5. Use unique secrets 6. Audit and monitor the use of secrets
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4. Lock down permissions Benefits • Support least privileges • Less chance of human mistake How to get started • Identify who needs what access • Define IAM policies • Use resource based policies for cross- account access Pro tip: • Tightly control secretsmanager:* permissions • Grant ListSecrets and DescribeSecret permissions • Configuring rotation requires IAM permissions • Separate storing, retrieving, and configuring rotation tasks • Use tags to group secrets • Use tag-on-create to make secrets management self-service • Cross-account access requires CMKs
  • 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adopting Secrets Manager 1. Remove plain-text secrets 2. Rotate frequently 3. Retrieve programmatically 4. Lock down permissions 5. Use unique secrets 6. Audit and monitor the use of secrets
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5. Use unique secrets Benefits • Minimize blast radius • Easily recover in restart or DR scenarios • Minimize overhead of synchronizing secrets How to get started • Use CloudFormation or other tooling to provision secrets • Require applications to retrieve secrets from the regional Secrets Manager end- point Pro tip: • Use unique secrets per environment, per AWS Region, per account
  • 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Application MS SQL instance AWS Secrets Manager GetSecretVaule {Ua, Pa} {Ua,Pa} Use unique secrets Data Application MS SQL instance AWS Secrets Manager GetSecretVaule {Ua, Pb} {Ua,Pb} Data AWS Region – US West 2 (Oregon) AWS Region – US East 2 (Ohio) Replicate Replicate
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adopting Secrets Manager 1. Remove plain-text secrets 2. Rotate frequently 3. Retrieve programmatically 4. Lock down permissions 5. Use unique secrets 6. Audit and monitor the use of secrets
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 6. Audit and monitor the use of secrets Benefits • Support least privileges • Less chance of human mistake How to get started • Quick glance – IAM Access Advisor • Auditable records – AWS CloudTrail Logs • Monitor use – Amazon CloudWatch Events Pro tip: • Monitor attempts to retrieve secrets that are scheduled for deletion • Monitor high value secrets • CloudTrail records all Secrets Manager API calls; expect an increase in the size of your trails
  • 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Audit and monitor AWS CloudTrail Amazon CloudWatch Events
  • 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Network diagram for demo VPC Example Host 1 Bastion Host Example Host 2 Public subnet 1 Public subnet 2 Private subnet 1 Private subnet 2 NAT gateway 1 NAT gateway 2 Rotation Lambda Function Secrets Manager VPC Endpoint CloudFormation VPC Endpoint Secrets Manager VPC Endpoint CloudFormation VPC Endpoint MySQL DB instance
  • 52. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Apurv Awasthi Email: awasth@amazon.com Twitter: @awasthi_av (or, the blackjack tables at Treasure Island)
  • 53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.