SEC 1: How are you associating tenant context with users and applying that context within your SaaS architecture?

A SaaS architecture must successfully connect a user’s identity with the identity of their tenant. This SaaS identity must be attached to all of their interactions with a SaaS environment, allowing you to resolve and apply this context across all the services of your application without introducing overhead that could undermine the performance of your system.

Resources

AWS re:Invent 2017: GPS: SaaS and OpenID Connect: The Secret Sauce of Multi-Tenant Identity (GPSTEC323)
Identity Federation and SSO for SaaS on AWS
Managing SaaS Identity Through Custom Attributes and Amazon Cognito
SaaS Quick Start Highlights Identity and Isolation with Amazon Cognito/
AWS re:Invent 2016: The Secret to SaaS (Hint: It's Identity) (GPSSI404)

Best Practices:

Improvement Plan

Use application services to generate a unified SaaS identity

  • Manage and configure tenants separate from users
  • Create a linkage between tenants and users.
  • Package key tenant attributes with user data in a single representation.
    AWS re:Invent 2017: GPS: SaaS and OpenID Connect: The Secret Sauce of Multi-tenant Identity (GPSTEC323)
  • Place tenant attributes in custom claims that are essential to tenants without bringing in a large collection of authorization constructs that are used to manage access to features and functions.
  • Use a key to sign this token to protect its contents.
  • Inject this token into a token for all downstream interactions with the system.
  • Create libraries and frameworks that apply tenant context outside the view of developers

  • Have a centralized helper for acquiring tenant context.
  • Use libraries to inject tenant context into metrics and logs
  • Use data access libraries to encapsulate tenant dependencies
  • Use convention to enforce isolation
  • Use an identity provider to bind users to tenants

  • Use identity provider custom claims for tenant attributes
  • When your identity provider (Amazon Cognito, Okta, Ping, Auth0, etc.) is configured, define the custom attributes that are added to your user identity to track tenant attributes.
  • At a minimum, ensure that the tenant identifier for your system is stored in the custom claims of your identity provider.
    Managing SaaS Identity Through Custom Attributes and Amazon Cognito
    Amazon Cognito API Reference
  • Use Amazon Cognito with federated identity providers to introduce tenant context
  • Inject the token returned from the identity provider into a bearer token for all downstream interactions with the system.
  • Rely on the identity provider to handle signing and the lifecycle of tokens.