An enterprise is building an application that stores sensitive customer metadata in a shared Amazon DynamoDB table. The design requires strict tenant isolation, ensuring that users from one tenant cannot view or modify the metadata of another tenant. All client authentication is managed by an external identity provider (IdP) federated with AWS, which supplies a custom tenant identifier during the login process. The application must leverage AWS Identity and Access Management (IAM) to enforce this tenant separation dynamically at the database level.
Which design strategy should the solutions architect implement to meet these requirements securely with the least administrative overhead?
- AAllow federated sessions to assume the AWS account root user credentials, and write dynamic session policies to restrict database operations by the tenant partition key.
- BCreate individual IAM users for each federated client user inside the AWS account, and attach custom policies that restrict access to their respective tenant partition key.
- Implement an IAM policy for the application execution role that uses a condition block matching the dynamodb:LeadingKeys condition key with the federated user's tenant tag variable.Answer
- DStore the database access credentials for each tenant as a plaintext string in Systems Manager Parameter Store, and configure the application to retrieve these parameters to authenticate requests.
Answer
Implement an IAM policy for the application execution role that uses a condition block matching the dynamodb:LeadingKeys condition key with the federated user's tenant tag variable.
The correct strategy uses IAM policy variables to achieve fine-grained access control. By matching the dynamodb:LeadingKeys condition key with the federated session's principal tag (${aws:PrincipalTag/TenantID}), IAM dynamically verifies that the user can only read or write items whose partition key matches their tenant ID. This enforces strict logical tenant isolation within a single DynamoDB table without managing individual credentials or multiple database tables.
Step-by-Step Solution
Key Concept
Fine-Grained Access Control in Amazon DynamoDB using IAM Policy Variables and Principal Tags
Estimated Time:2m 0s