SlideShare a Scribd company logo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:INVENT
SaaS and OpenID Connect: The Secret Sauce Mul ti -
Tenant Id enti ty and Isol ati on
T o d G o l d i n g
P a r t n e r S o l u t i o n s A r c h i t e c t
S a a S T e c h L e a d
t o d g @ a m a z o n . c o m
G P S T E C 3 2 3
N o v e m b e r 2 7 , 2 0 1 7
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THE SAAS IDENTITY CHALLENGE
User Identity
Amazon Cognito
Tenant Identity
• Tenant ID
• Company Name
• Status
• Billing Tier
SaaS Identity
• SaaS Auth and Auth
• Implicit Isolation
• Applied Tenant Policies
• Embedded SaaS Context
A First-Class SaaS Token
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SAAS IDENTITY WITH MICROSERVICES
Service
Service
Service
Service
Service
Service
Service
Service
Service
• Flowing identity through services
• Low latency resolution of tenant context
• Streamlined developer experience
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THE TRADITIONAL MODEL
Identity
Provider
Redirect
2
3
4
Application
Service
5
User Token
Application
Service
Web App
1
Tenant
Tenant
Management
Bottleneck
User  Tenant
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
OIDC TO THE RESCUE
OpenID
Provider
Redirect
2
3
Access Token
ID Token
Application
Service
HTTP Header
Authorization: Bearer <Token>
Application
Service
HTTP Header
Authorization: Bearer <Token>
Web
App
1
Tenant
Tenant
Management
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EMBEDDING TENANT CONTEXT IN CLAIMS
Access Token
ID Token
{
"sub” : ”jane",
"email” : ”jane@test.com",
"email_verified” : true,
"name” : ”Jane Doe",
"given_name” : ”Jane",
"family_name” : ”Doe",
"phone_number” : ”(408) 555-1212",
"profile” : "https://test.com”
}
{
"iss” : "https://test.auth.com/",
"aud” : "https://test.com/v1/",
"sub” : "usr_123",
"scope” : "read write",
"iat” : 1458785796,
"exp” : 1458872196
}
JSON Web Token (JWT)
JSON Web Token (JWT)
Tenant
Identity Claims
• TenantID
• Status
• Tier
Add tenant attributes as
custom claims
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Signed TokenJWT Token
SECURING TOKENS
{
"sub” : ”jane",
"email” : ”jane@test.com",
"email_verified” : true,
"name” : ”Jane Doe",
"given_name” : ”Jane",
"family_name” : ”Doe",
"phone_number” : ”(408) 555-1212",
"profile” : "https://test.com”
}
Certificate
eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOWdkazcifQ.ew
ogImlzcyI6ICJodHRwOi8vc2VydmVyLmV4YW1wb
GUuY29tIiwKICJzdWIiOiAiMjQ4Mjg5NzYxMDAxIiw
KICJhdWQiOiAiczZCaGRSa3F0MyIsCiAibm9uY2Ui
OiAibi0wUzZfV3pBMk1qIiwKICJleHAiOiAxMzExMj
gxOTcwLAogImlhdCI6IDEzMTEyODA5NzAKfQ.gg
W8hZ1EuVLuxNuuIJKX_V8a_OMXzR0EHR9R6jgd
qrOOF4daGU96Sr_P6qJp6IcmD3HP99Obi1PRs-
cwh3LOp146waJ8IhehcwL7F09JdijmBqkvPeB2T9
CJNqeGpegccMg4vfKjkM8FcGvnzZUN4_KSP0aAp
1tOJ1zZwgjxqGByKHiOtX7TpdQyHE5lcMiKPXfEIQ
ILVq0pc_E2DzL7emopWoaoZTF_m0_N0YzFC6g6
EJbOEoRoSK5hoDalrcvRYLSrQAZZKflyuVCyixEoV
9GfNQC3_osjzw2PAithfubEEBLuVVk4XUVrWOLrL
l0nx7RkKU8NXNHq-rvKMzqg
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
TENANT REGISTRATION WITH COGNITO
Create User Pool
• TenantID
• Role
• Tier
• Company
Create Federated Identity
• UserPoolID • AppID
Create User
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SUPPORTING TENANT LEVEL POLICIES
Multi-factor authentication
Email and phone number verification
SMS messaging
********** Password policies
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MULTIPLE PROVISIONING PATHS
System Admin
(ISV Owner/Super User)
Registration
Service
System
Provisioning
1
Tenant
Admin
Tenant
Onboarding
2
Tenant
Administration
3
Tenant
User
4
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
TENANT AUTHENTICATION FLOW WITH COGNITO
Web
App
1
Tenant
Auth
Manager
2
User
Manager
3
• UserId: joe@abc.com
• UserPoolId: 10401
Amazon
Cognito
4
LookupUserPool(userId)
5
• A user can only be associated with a single tenant
• How would you support a single user with multiple tenants?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
THE CUSTOM CLAIMS CHALLENGE
Amazon
Cognito
Standard Claims
• given_name
• family_name
• middle_name
• gender
• Email
Custom Claims
• tenant_id
• role
• tier
• company_name
• status
Universal To Most Providers Requires access to claim
management/customization
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
TOKEN VALIDATION WITH AMAZON API GATEWAY
API Gateway
Order
Service
Catalog
Service
Cart
Service
Access Token
Custom
Authorizer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS LAMBDA VALIDATOR FUNCTION
verifiedJwt = nJwt.verify(event.authorizationToken, key);
// parse the ARN from the incoming event
// if the token is invalid, deny access immediately
…
policy = new AuthPolicy(verifiedJwt.body.sub, awsAccountId, apiOptions);
if (verifiedJwt.body.scope.indexOf("admins") > -1) {
policy.allowAllMethods();
} else {
policy.allowMethod(AuthPolicy.HttpVerb.GET, "*");
policy.allowMethod(AuthPolicy.HttpVerb.POST, "/users/" +
verifiedJwt.body.sub);
}
context.succeed(policy.build());
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SIMPLIFYING THE DEVELOPER EXPERIENCE
Web
AppClient
$rootScope.bearerToken = response.data.token;
var decodedToken =
jwtHelper.decodeToken($rootScope.bearerToken);
$rootScope.userDisplayName = decodedToken['given_name'] + ' '
+ decodedToken['family_name'];
$rootScope.userRole = decodedToken['custom:role'];
Application
Service
app.get('/order/:id', function(req, res) {
tokenManager.getCredentialsFromToken(req, function(credentials) {
var db = new DynamoDBHelper(orderSchema, credentials, config);
db.getItem(params, credentials, function (err, order)
}
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CENTRALIZED TOKEN MANAGEMENT
module.exports.getCredentialsFromToken = function(req, updateCredentials) {
var bearerToken = req.get('Authorization');
if (bearerToken) {
var tokenValue = bearerToken.substring(bearerToken.indexOf(' ') + 1);
var decodedIdToken = jwtDecode(tokenValue);
async.waterfall([
function(callback) {
getUserPoolWithParams(userName, callback)
},
function(userPool, callback) {
authenticateUserInPool(userPool, tokenValue, callback)
}
], function(error, results) {
if (!error)
updateCredentials(results)
});
}
};
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CONNECTING IDENTITY TO TENANT ISOLATION
Tenant1 Tenant2
S3 Bucket
S3 BucketDynamoDB
Table
DynamoDB
Table
SQS Queue
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SYSTEM USERS ADD ANOTHER WRINKLE
Tenant-1
User
Tenant-1
User
Tenant-1
User
Tenant-2
User
Tenant-2
User
Tenant-2
User
Tenant-1
Admin
Tenant-2
Admin
System
Admin
System
Ops
System
Support
System users have
access to all tenant
resources
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
PROVISIONING AWS IAM POLICES FOR TENANT ROLES
Registration
Create
Identity
Tenant
Admin
Role
Tenant
Order
Manager
Role
Tenant
Catalog
Manager
Role
Provision IAM roles/policies for each
system and tenant role
System
Registration
Tenant Registration System
Admin
Role
System
Ops
Role
System
Support
Role
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SCOPING POLICIES BY TENANT
{
"Sid": "TenantReadOnlyOrderTable",
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:BatchGetItem",
"dynamodb:Query",
"dynamodb:DescribeTable"
],
"Resource": [
"arn:aws:dynamodb:us-east-1:7000001000000:table/Order"
],
"Condition": {
"ForAllValues:StringEquals": {
"dynamodb:LeadingKeys": [
"5bd24c40d66c4755819d28ceab9f0826"
]
}
}
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RESOLVING CREDENTIALS WITH AMAZON COGNITO
Access Token
Web
App
1
3
OpenID
Provider
Redirect
2
ID Token
Tenant
4
5
App ServiceGet Orders
Amazon
Cognito
Get Creds
for Role
Scoped
Creds6 7
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MAPPING ROLES WITH ASSUME ROLE
Access Token
Web
App
1
3
OpenID
Provider
Redirect
2
ID Token
Tenant
4
6
STS Token
5
AWS
STS
Service
AssumeRoleWithWebIdentity()
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
POLICY STRATEGIES VARY
DynamoDB
RDS Amazon
Redshift
SQS
• Each AWS resource may require a unique strategy for injecting
tenant context into its IAM policy
• The model you pick for tenant (silo, bridge, pool) will influence
your policy scheme
Siloed Model Pool Model
Tenant TenantTenant
Tenant
Tenant Tenant
Tenant
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MAKING IDENTITY AN EARLY PRIORITY
Order
Management
CatalogCart Auth Manager
Tenant
API Gateway
DynamoDB RDS Amazon
Redshift
Amazon
Cognito
Tenant identity
shapes multi-tenant
design at every layer
of your architecture
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LEVERAGING PARTNER SOLUTIONS
Redirect
2
3
Access Token
ID Token
Web
App
1
Tenant
• Wide adoption of OIDC
• Varying approaches to tenant mapping
• Consider support for custom claims
• Must accommodate AssumeRole() flow
4 AWS
STS
Service
AssumeRoleWithWebIdentity()
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
TAKEAWAYS
• Need a model that treats SaaS identity as a first-class construct
• Piggyback on claims to introduce your SaaS custom attributes
• Leveraging custom claims may impact your provider portability
• Hide the details of authorization from developers
• Consider the needs of both tenant AND system users
• Identity directly influences your isolation scheme
• SaaS should always start with identity
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RE-THINKING YOUR IDENTITY SCHEME
• How are you connecting user identity to tenants today?
• How does tenant context flow through your application
services?
• Is your model efficient for the system and developers?
• How is access being validated on each request?
• What are you doing to limit cross-tenant access?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ADDITIONAL RESOURCES
SaaS Quick Starts
• SaaS Identity and Isolation with Amazon Cognito
re:INVENT sessions
• Tenant Health in a Multi-Tenant Environment Featuring New Relic
(GPSTEC309)
• Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions
on AWS (ARC407)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!

More Related Content

What's hot

Introduction of AWS KMS
Introduction of AWS KMSIntroduction of AWS KMS
Introduction of AWS KMS
Ricardo Schmidt
 
Credential store using HashiCorp Vault
Credential store using HashiCorp VaultCredential store using HashiCorp Vault
Credential store using HashiCorp Vault
Mayank Patel
 
Building Trust Between Modern Distributed Systems with SPIFFE
Building Trust Between Modern Distributed Systems with SPIFFEBuilding Trust Between Modern Distributed Systems with SPIFFE
Building Trust Between Modern Distributed Systems with SPIFFE
QAware GmbH
 
WSO2 Charon
WSO2 CharonWSO2 Charon
WSO2 Charon
HasiniG
 
AWS IAM and security
AWS IAM and securityAWS IAM and security
AWS IAM and security
Erik Paulsson
 
Advanced Container Security
Advanced Container Security Advanced Container Security
Advanced Container Security
Amazon Web Services
 
A Guide to AWS Penetration Testing.pptx
A Guide to AWS Penetration Testing.pptxA Guide to AWS Penetration Testing.pptx
A Guide to AWS Penetration Testing.pptx
saurabhpandey251355
 
Building an Ethereum Wallet using Hashicorp Vault
Building an Ethereum Wallet using Hashicorp VaultBuilding an Ethereum Wallet using Hashicorp Vault
Building an Ethereum Wallet using Hashicorp Vault
Jeff Ploughman
 
9 Security Best Practices
9 Security Best Practices9 Security Best Practices
9 Security Best Practices
Amazon Web Services
 
Amazon services ec2
Amazon services ec2Amazon services ec2
Amazon services ec2
Ismaeel Enjreny
 
Protecting Your Data with Encryption on AWS
Protecting Your Data with Encryption on AWSProtecting Your Data with Encryption on AWS
Protecting Your Data with Encryption on AWS
Amazon Web Services
 
Intro to Amazon ECS
Intro to Amazon ECSIntro to Amazon ECS
Intro to Amazon ECS
Amazon Web Services
 
AWS IAM
AWS IAMAWS IAM
AWS IAM
Diego Pacheco
 
Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL Secrets
Derek Downey
 
How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)
Shiu-Fun Poon
 
Learn Terraform on Azure
Learn Terraform on AzureLearn Terraform on Azure
Learn Terraform on Azure
Jorn Jambers
 
Azure vidyapeeth -Introduction to Azure Container Service & Registry Service
Azure vidyapeeth -Introduction to Azure Container Service & Registry ServiceAzure vidyapeeth -Introduction to Azure Container Service & Registry Service
Azure vidyapeeth -Introduction to Azure Container Service & Registry Service
Ilyas F ☁☁☁
 
How to get along with HATEOAS without letting the bad guys steal your lunch?
How to get along with HATEOAS without letting the bad guys steal your lunch?How to get along with HATEOAS without letting the bad guys steal your lunch?
How to get along with HATEOAS without letting the bad guys steal your lunch?
Graham Charters
 
Overview of secret management solutions and architecture
Overview of secret management solutions and architectureOverview of secret management solutions and architecture
Overview of secret management solutions and architecture
Yuechuan (Mike) Chen
 
Policy as Code: IT Governance With HashiCorp Sentinel
Policy as Code: IT Governance With HashiCorp SentinelPolicy as Code: IT Governance With HashiCorp Sentinel
Policy as Code: IT Governance With HashiCorp Sentinel
Mitchell Pronschinske
 

What's hot (20)

Introduction of AWS KMS
Introduction of AWS KMSIntroduction of AWS KMS
Introduction of AWS KMS
 
Credential store using HashiCorp Vault
Credential store using HashiCorp VaultCredential store using HashiCorp Vault
Credential store using HashiCorp Vault
 
Building Trust Between Modern Distributed Systems with SPIFFE
Building Trust Between Modern Distributed Systems with SPIFFEBuilding Trust Between Modern Distributed Systems with SPIFFE
Building Trust Between Modern Distributed Systems with SPIFFE
 
WSO2 Charon
WSO2 CharonWSO2 Charon
WSO2 Charon
 
AWS IAM and security
AWS IAM and securityAWS IAM and security
AWS IAM and security
 
Advanced Container Security
Advanced Container Security Advanced Container Security
Advanced Container Security
 
A Guide to AWS Penetration Testing.pptx
A Guide to AWS Penetration Testing.pptxA Guide to AWS Penetration Testing.pptx
A Guide to AWS Penetration Testing.pptx
 
Building an Ethereum Wallet using Hashicorp Vault
Building an Ethereum Wallet using Hashicorp VaultBuilding an Ethereum Wallet using Hashicorp Vault
Building an Ethereum Wallet using Hashicorp Vault
 
9 Security Best Practices
9 Security Best Practices9 Security Best Practices
9 Security Best Practices
 
Amazon services ec2
Amazon services ec2Amazon services ec2
Amazon services ec2
 
Protecting Your Data with Encryption on AWS
Protecting Your Data with Encryption on AWSProtecting Your Data with Encryption on AWS
Protecting Your Data with Encryption on AWS
 
Intro to Amazon ECS
Intro to Amazon ECSIntro to Amazon ECS
Intro to Amazon ECS
 
AWS IAM
AWS IAMAWS IAM
AWS IAM
 
Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL Secrets
 
How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)
 
Learn Terraform on Azure
Learn Terraform on AzureLearn Terraform on Azure
Learn Terraform on Azure
 
Azure vidyapeeth -Introduction to Azure Container Service & Registry Service
Azure vidyapeeth -Introduction to Azure Container Service & Registry ServiceAzure vidyapeeth -Introduction to Azure Container Service & Registry Service
Azure vidyapeeth -Introduction to Azure Container Service & Registry Service
 
How to get along with HATEOAS without letting the bad guys steal your lunch?
How to get along with HATEOAS without letting the bad guys steal your lunch?How to get along with HATEOAS without letting the bad guys steal your lunch?
How to get along with HATEOAS without letting the bad guys steal your lunch?
 
Overview of secret management solutions and architecture
Overview of secret management solutions and architectureOverview of secret management solutions and architecture
Overview of secret management solutions and architecture
 
Policy as Code: IT Governance With HashiCorp Sentinel
Policy as Code: IT Governance With HashiCorp SentinelPolicy as Code: IT Governance With HashiCorp Sentinel
Policy as Code: IT Governance With HashiCorp Sentinel
 

Similar to GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and Isolation

Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions on AWS ...
Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions on AWS ...Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions on AWS ...
Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions on AWS ...
Amazon Web Services
 
Soup to Nuts: Identity Federation for AWS
Soup to Nuts: Identity Federation for AWSSoup to Nuts: Identity Federation for AWS
Soup to Nuts: Identity Federation for AWS
Amazon Web Services
 
Incident Response on AWS - A Practical Look.pdf
Incident Response on AWS - A Practical Look.pdfIncident Response on AWS - A Practical Look.pdf
Incident Response on AWS - A Practical Look.pdf
Amazon Web Services
 
SRV312_Taking Serverless to the Edge
SRV312_Taking Serverless to the EdgeSRV312_Taking Serverless to the Edge
SRV312_Taking Serverless to the Edge
Amazon 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 Loft
Amazon Web Services
 
Detective Controls: Gain Visibility and Record Change:
Detective Controls: Gain Visibility and Record Change: Detective Controls: Gain Visibility and Record Change:
Detective Controls: Gain Visibility and Record Change:
Amazon Web Services
 
SID345-AWS Encryption SDK The Busy Engineer’s Guide to Client-Side Encryption
SID345-AWS Encryption SDK The Busy Engineer’s Guide to Client-Side EncryptionSID345-AWS Encryption SDK The Busy Engineer’s Guide to Client-Side Encryption
SID345-AWS Encryption SDK The Busy Engineer’s Guide to Client-Side Encryption
Amazon Web Services
 
Incident Response: Preparing and Simulating Threat Response
Incident Response: Preparing and Simulating Threat ResponseIncident Response: Preparing and Simulating Threat Response
Incident Response: Preparing and Simulating Threat Response
Amazon Web Services
 
[REPEAT 1] Managing Identity Management, Authentication, & Authorization for ...
[REPEAT 1] Managing Identity Management, Authentication, & Authorization for ...[REPEAT 1] Managing Identity Management, Authentication, & Authorization for ...
[REPEAT 1] Managing Identity Management, Authentication, & Authorization for ...
Amazon Web Services
 
Manage Infrastructure Securely at Scale and Eliminate Operational Risks - DEV...
Manage Infrastructure Securely at Scale and Eliminate Operational Risks - DEV...Manage Infrastructure Securely at Scale and Eliminate Operational Risks - DEV...
Manage Infrastructure Securely at Scale and Eliminate Operational Risks - DEV...
Amazon Web Services
 
Authentication & Authorization for Connected Mobile & Web Applications using ...
Authentication & Authorization for Connected Mobile & Web Applications using ...Authentication & Authorization for Connected Mobile & Web Applications using ...
Authentication & Authorization for Connected Mobile & Web Applications using ...
Amazon Web Services
 
Authentication & Authorization for Connected Mobile & Web Applications using ...
Authentication & Authorization for Connected Mobile & Web Applications using ...Authentication & Authorization for Connected Mobile & Web Applications using ...
Authentication & Authorization for Connected Mobile & Web Applications using ...
Amazon Web Services
 
How to use IAM roles grant access to AWS
How to use IAM roles grant access to AWSHow to use IAM roles grant access to AWS
How to use IAM roles grant access to AWS
Amazon Web Services
 
Best Practices for Active Directory with AWS Workloads
Best Practices for Active Directory with AWS WorkloadsBest Practices for Active Directory with AWS Workloads
Best Practices for Active Directory with AWS Workloads
Amazon Web Services
 
SID331_Architecting Security and Governance Across a Multi-Account Strategy
SID331_Architecting Security and Governance Across a Multi-Account StrategySID331_Architecting Security and Governance Across a Multi-Account Strategy
SID331_Architecting Security and Governance Across a Multi-Account Strategy
Amazon Web Services
 
Build a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIBuild a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UI
Amazon Web Services
 
Build a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIBuild a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UI
Amazon Web Services
 
GPSTEC309-SaaS Monitoring Creating a Unified View of Multitenant Health featu...
GPSTEC309-SaaS Monitoring Creating a Unified View of Multitenant Health featu...GPSTEC309-SaaS Monitoring Creating a Unified View of Multitenant Health featu...
GPSTEC309-SaaS Monitoring Creating a Unified View of Multitenant Health featu...
Amazon Web Services
 
Best Practices for AWS IoT Core (IOT347-R1) - AWS re:Invent 2018
Best Practices for AWS IoT Core (IOT347-R1) - AWS re:Invent 2018Best Practices for AWS IoT Core (IOT347-R1) - AWS re:Invent 2018
Best Practices for AWS IoT Core (IOT347-R1) - AWS re:Invent 2018
Amazon Web Services
 
The Essentials of AWS IoT Device Management (IOT326-R1) - AWS re:Invent 2018
The Essentials of AWS IoT Device Management (IOT326-R1) - AWS re:Invent 2018The Essentials of AWS IoT Device Management (IOT326-R1) - AWS re:Invent 2018
The Essentials of AWS IoT Device Management (IOT326-R1) - AWS re:Invent 2018
Amazon Web Services
 

Similar to GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and Isolation (20)

Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions on AWS ...
Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions on AWS ...Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions on AWS ...
Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions on AWS ...
 
Soup to Nuts: Identity Federation for AWS
Soup to Nuts: Identity Federation for AWSSoup to Nuts: Identity Federation for AWS
Soup to Nuts: Identity Federation for AWS
 
Incident Response on AWS - A Practical Look.pdf
Incident Response on AWS - A Practical Look.pdfIncident Response on AWS - A Practical Look.pdf
Incident Response on AWS - A Practical Look.pdf
 
SRV312_Taking Serverless to the Edge
SRV312_Taking Serverless to the EdgeSRV312_Taking Serverless to the Edge
SRV312_Taking Serverless to the Edge
 
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
 
Detective Controls: Gain Visibility and Record Change:
Detective Controls: Gain Visibility and Record Change: Detective Controls: Gain Visibility and Record Change:
Detective Controls: Gain Visibility and Record Change:
 
SID345-AWS Encryption SDK The Busy Engineer’s Guide to Client-Side Encryption
SID345-AWS Encryption SDK The Busy Engineer’s Guide to Client-Side EncryptionSID345-AWS Encryption SDK The Busy Engineer’s Guide to Client-Side Encryption
SID345-AWS Encryption SDK The Busy Engineer’s Guide to Client-Side Encryption
 
Incident Response: Preparing and Simulating Threat Response
Incident Response: Preparing and Simulating Threat ResponseIncident Response: Preparing and Simulating Threat Response
Incident Response: Preparing and Simulating Threat Response
 
[REPEAT 1] Managing Identity Management, Authentication, & Authorization for ...
[REPEAT 1] Managing Identity Management, Authentication, & Authorization for ...[REPEAT 1] Managing Identity Management, Authentication, & Authorization for ...
[REPEAT 1] Managing Identity Management, Authentication, & Authorization for ...
 
Manage Infrastructure Securely at Scale and Eliminate Operational Risks - DEV...
Manage Infrastructure Securely at Scale and Eliminate Operational Risks - DEV...Manage Infrastructure Securely at Scale and Eliminate Operational Risks - DEV...
Manage Infrastructure Securely at Scale and Eliminate Operational Risks - DEV...
 
Authentication & Authorization for Connected Mobile & Web Applications using ...
Authentication & Authorization for Connected Mobile & Web Applications using ...Authentication & Authorization for Connected Mobile & Web Applications using ...
Authentication & Authorization for Connected Mobile & Web Applications using ...
 
Authentication & Authorization for Connected Mobile & Web Applications using ...
Authentication & Authorization for Connected Mobile & Web Applications using ...Authentication & Authorization for Connected Mobile & Web Applications using ...
Authentication & Authorization for Connected Mobile & Web Applications using ...
 
How to use IAM roles grant access to AWS
How to use IAM roles grant access to AWSHow to use IAM roles grant access to AWS
How to use IAM roles grant access to AWS
 
Best Practices for Active Directory with AWS Workloads
Best Practices for Active Directory with AWS WorkloadsBest Practices for Active Directory with AWS Workloads
Best Practices for Active Directory with AWS Workloads
 
SID331_Architecting Security and Governance Across a Multi-Account Strategy
SID331_Architecting Security and Governance Across a Multi-Account StrategySID331_Architecting Security and Governance Across a Multi-Account Strategy
SID331_Architecting Security and Governance Across a Multi-Account Strategy
 
Build a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIBuild a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UI
 
Build a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UIBuild a Web Authentication System with a Custom UI
Build a Web Authentication System with a Custom UI
 
GPSTEC309-SaaS Monitoring Creating a Unified View of Multitenant Health featu...
GPSTEC309-SaaS Monitoring Creating a Unified View of Multitenant Health featu...GPSTEC309-SaaS Monitoring Creating a Unified View of Multitenant Health featu...
GPSTEC309-SaaS Monitoring Creating a Unified View of Multitenant Health featu...
 
Best Practices for AWS IoT Core (IOT347-R1) - AWS re:Invent 2018
Best Practices for AWS IoT Core (IOT347-R1) - AWS re:Invent 2018Best Practices for AWS IoT Core (IOT347-R1) - AWS re:Invent 2018
Best Practices for AWS IoT Core (IOT347-R1) - AWS re:Invent 2018
 
The Essentials of AWS IoT Device Management (IOT326-R1) - AWS re:Invent 2018
The Essentials of AWS IoT Device Management (IOT326-R1) - AWS re:Invent 2018The Essentials of AWS IoT Device Management (IOT326-R1) - AWS re:Invent 2018
The Essentials of AWS IoT Device Management (IOT326-R1) - AWS re:Invent 2018
 

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 Fargate
Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
Amazon 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
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
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 Workloads
Amazon Web Services
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
Amazon 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 sfatare
Amazon 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 NodeJS
Amazon 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 web
Amazon 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 sfatare
Amazon 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 AWS
Amazon 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 Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
Amazon 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 Service
Amazon 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
 

GPSTEC323-SaaS and OpenID Connect The Secret Sauce Multi-Tenant Identity and Isolation

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:INVENT SaaS and OpenID Connect: The Secret Sauce Mul ti - Tenant Id enti ty and Isol ati on T o d G o l d i n g P a r t n e r S o l u t i o n s A r c h i t e c t S a a S T e c h L e a d t o d g @ a m a z o n . c o m G P S T E C 3 2 3 N o v e m b e r 2 7 , 2 0 1 7
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THE SAAS IDENTITY CHALLENGE User Identity Amazon Cognito Tenant Identity • Tenant ID • Company Name • Status • Billing Tier SaaS Identity • SaaS Auth and Auth • Implicit Isolation • Applied Tenant Policies • Embedded SaaS Context A First-Class SaaS Token
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SAAS IDENTITY WITH MICROSERVICES Service Service Service Service Service Service Service Service Service • Flowing identity through services • Low latency resolution of tenant context • Streamlined developer experience
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THE TRADITIONAL MODEL Identity Provider Redirect 2 3 4 Application Service 5 User Token Application Service Web App 1 Tenant Tenant Management Bottleneck User  Tenant
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. OIDC TO THE RESCUE OpenID Provider Redirect 2 3 Access Token ID Token Application Service HTTP Header Authorization: Bearer <Token> Application Service HTTP Header Authorization: Bearer <Token> Web App 1 Tenant Tenant Management
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EMBEDDING TENANT CONTEXT IN CLAIMS Access Token ID Token { "sub” : ”jane", "email” : ”jane@test.com", "email_verified” : true, "name” : ”Jane Doe", "given_name” : ”Jane", "family_name” : ”Doe", "phone_number” : ”(408) 555-1212", "profile” : "https://test.com” } { "iss” : "https://test.auth.com/", "aud” : "https://test.com/v1/", "sub” : "usr_123", "scope” : "read write", "iat” : 1458785796, "exp” : 1458872196 } JSON Web Token (JWT) JSON Web Token (JWT) Tenant Identity Claims • TenantID • Status • Tier Add tenant attributes as custom claims
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Signed TokenJWT Token SECURING TOKENS { "sub” : ”jane", "email” : ”jane@test.com", "email_verified” : true, "name” : ”Jane Doe", "given_name” : ”Jane", "family_name” : ”Doe", "phone_number” : ”(408) 555-1212", "profile” : "https://test.com” } Certificate eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOWdkazcifQ.ew ogImlzcyI6ICJodHRwOi8vc2VydmVyLmV4YW1wb GUuY29tIiwKICJzdWIiOiAiMjQ4Mjg5NzYxMDAxIiw KICJhdWQiOiAiczZCaGRSa3F0MyIsCiAibm9uY2Ui OiAibi0wUzZfV3pBMk1qIiwKICJleHAiOiAxMzExMj gxOTcwLAogImlhdCI6IDEzMTEyODA5NzAKfQ.gg W8hZ1EuVLuxNuuIJKX_V8a_OMXzR0EHR9R6jgd qrOOF4daGU96Sr_P6qJp6IcmD3HP99Obi1PRs- cwh3LOp146waJ8IhehcwL7F09JdijmBqkvPeB2T9 CJNqeGpegccMg4vfKjkM8FcGvnzZUN4_KSP0aAp 1tOJ1zZwgjxqGByKHiOtX7TpdQyHE5lcMiKPXfEIQ ILVq0pc_E2DzL7emopWoaoZTF_m0_N0YzFC6g6 EJbOEoRoSK5hoDalrcvRYLSrQAZZKflyuVCyixEoV 9GfNQC3_osjzw2PAithfubEEBLuVVk4XUVrWOLrL l0nx7RkKU8NXNHq-rvKMzqg
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. TENANT REGISTRATION WITH COGNITO Create User Pool • TenantID • Role • Tier • Company Create Federated Identity • UserPoolID • AppID Create User
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SUPPORTING TENANT LEVEL POLICIES Multi-factor authentication Email and phone number verification SMS messaging ********** Password policies
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MULTIPLE PROVISIONING PATHS System Admin (ISV Owner/Super User) Registration Service System Provisioning 1 Tenant Admin Tenant Onboarding 2 Tenant Administration 3 Tenant User 4
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. TENANT AUTHENTICATION FLOW WITH COGNITO Web App 1 Tenant Auth Manager 2 User Manager 3 • UserId: joe@abc.com • UserPoolId: 10401 Amazon Cognito 4 LookupUserPool(userId) 5 • A user can only be associated with a single tenant • How would you support a single user with multiple tenants?
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. THE CUSTOM CLAIMS CHALLENGE Amazon Cognito Standard Claims • given_name • family_name • middle_name • gender • Email Custom Claims • tenant_id • role • tier • company_name • status Universal To Most Providers Requires access to claim management/customization
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. TOKEN VALIDATION WITH AMAZON API GATEWAY API Gateway Order Service Catalog Service Cart Service Access Token Custom Authorizer
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS LAMBDA VALIDATOR FUNCTION verifiedJwt = nJwt.verify(event.authorizationToken, key); // parse the ARN from the incoming event // if the token is invalid, deny access immediately … policy = new AuthPolicy(verifiedJwt.body.sub, awsAccountId, apiOptions); if (verifiedJwt.body.scope.indexOf("admins") > -1) { policy.allowAllMethods(); } else { policy.allowMethod(AuthPolicy.HttpVerb.GET, "*"); policy.allowMethod(AuthPolicy.HttpVerb.POST, "/users/" + verifiedJwt.body.sub); } context.succeed(policy.build());
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SIMPLIFYING THE DEVELOPER EXPERIENCE Web AppClient $rootScope.bearerToken = response.data.token; var decodedToken = jwtHelper.decodeToken($rootScope.bearerToken); $rootScope.userDisplayName = decodedToken['given_name'] + ' ' + decodedToken['family_name']; $rootScope.userRole = decodedToken['custom:role']; Application Service app.get('/order/:id', function(req, res) { tokenManager.getCredentialsFromToken(req, function(credentials) { var db = new DynamoDBHelper(orderSchema, credentials, config); db.getItem(params, credentials, function (err, order) } }
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CENTRALIZED TOKEN MANAGEMENT module.exports.getCredentialsFromToken = function(req, updateCredentials) { var bearerToken = req.get('Authorization'); if (bearerToken) { var tokenValue = bearerToken.substring(bearerToken.indexOf(' ') + 1); var decodedIdToken = jwtDecode(tokenValue); async.waterfall([ function(callback) { getUserPoolWithParams(userName, callback) }, function(userPool, callback) { authenticateUserInPool(userPool, tokenValue, callback) } ], function(error, results) { if (!error) updateCredentials(results) }); } };
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CONNECTING IDENTITY TO TENANT ISOLATION Tenant1 Tenant2 S3 Bucket S3 BucketDynamoDB Table DynamoDB Table SQS Queue
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SYSTEM USERS ADD ANOTHER WRINKLE Tenant-1 User Tenant-1 User Tenant-1 User Tenant-2 User Tenant-2 User Tenant-2 User Tenant-1 Admin Tenant-2 Admin System Admin System Ops System Support System users have access to all tenant resources
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. PROVISIONING AWS IAM POLICES FOR TENANT ROLES Registration Create Identity Tenant Admin Role Tenant Order Manager Role Tenant Catalog Manager Role Provision IAM roles/policies for each system and tenant role System Registration Tenant Registration System Admin Role System Ops Role System Support Role
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SCOPING POLICIES BY TENANT { "Sid": "TenantReadOnlyOrderTable", "Effect": "Allow", "Action": [ "dynamodb:GetItem", "dynamodb:BatchGetItem", "dynamodb:Query", "dynamodb:DescribeTable" ], "Resource": [ "arn:aws:dynamodb:us-east-1:7000001000000:table/Order" ], "Condition": { "ForAllValues:StringEquals": { "dynamodb:LeadingKeys": [ "5bd24c40d66c4755819d28ceab9f0826" ] } } }
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RESOLVING CREDENTIALS WITH AMAZON COGNITO Access Token Web App 1 3 OpenID Provider Redirect 2 ID Token Tenant 4 5 App ServiceGet Orders Amazon Cognito Get Creds for Role Scoped Creds6 7
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MAPPING ROLES WITH ASSUME ROLE Access Token Web App 1 3 OpenID Provider Redirect 2 ID Token Tenant 4 6 STS Token 5 AWS STS Service AssumeRoleWithWebIdentity()
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. POLICY STRATEGIES VARY DynamoDB RDS Amazon Redshift SQS • Each AWS resource may require a unique strategy for injecting tenant context into its IAM policy • The model you pick for tenant (silo, bridge, pool) will influence your policy scheme Siloed Model Pool Model Tenant TenantTenant Tenant Tenant Tenant Tenant
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MAKING IDENTITY AN EARLY PRIORITY Order Management CatalogCart Auth Manager Tenant API Gateway DynamoDB RDS Amazon Redshift Amazon Cognito Tenant identity shapes multi-tenant design at every layer of your architecture
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LEVERAGING PARTNER SOLUTIONS Redirect 2 3 Access Token ID Token Web App 1 Tenant • Wide adoption of OIDC • Varying approaches to tenant mapping • Consider support for custom claims • Must accommodate AssumeRole() flow 4 AWS STS Service AssumeRoleWithWebIdentity()
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. TAKEAWAYS • Need a model that treats SaaS identity as a first-class construct • Piggyback on claims to introduce your SaaS custom attributes • Leveraging custom claims may impact your provider portability • Hide the details of authorization from developers • Consider the needs of both tenant AND system users • Identity directly influences your isolation scheme • SaaS should always start with identity
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RE-THINKING YOUR IDENTITY SCHEME • How are you connecting user identity to tenants today? • How does tenant context flow through your application services? • Is your model efficient for the system and developers? • How is access being validated on each request? • What are you doing to limit cross-tenant access?
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ADDITIONAL RESOURCES SaaS Quick Starts • SaaS Identity and Isolation with Amazon Cognito re:INVENT sessions • Tenant Health in a Multi-Tenant Environment Featuring New Relic (GPSTEC309) • Deconstructing SaaS: A Deep Dive into Building Multi-tenant Solutions on AWS (ARC407)
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!