Challenge - 5 Problems
DynamoDB Row-Level Security Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
Identify the correct condition key for user identity in DynamoDB row-level security
Which condition key is used in DynamoDB to restrict access to items based on the user's identity in a row-level security policy?
Attempts:
2 left
💡 Hint
Think about the key that controls access based on partition key values.
✗ Incorrect
The dynamodb:LeadingKeys condition key is used to restrict access to items by matching the partition key values to the user's identity or other attributes.
🧠 Conceptual
intermediate2:00remaining
Purpose of dynamodb:Attributes condition key
What is the main purpose of the dynamodb:Attributes condition key in DynamoDB's row-level security?
Attempts:
2 left
💡 Hint
Think about controlling access to specific columns or fields.
✗ Incorrect
dynamodb:Attributes is used to control access to specific attributes (columns) of an item, allowing fine-grained permissions on which fields can be read or written.
📝 Syntax
advanced2:30remaining
Identify the valid condition expression for row-level security using dynamodb:LeadingKeys
Which of the following IAM policy condition expressions correctly restricts access to items where the partition key matches the user's ID stored in the request context?
DynamoDB
Condition:
StringEquals:
???Attempts:
2 left
💡 Hint
The value for dynamodb:LeadingKeys must be a list of strings with variable substitution.
✗ Incorrect
The dynamodb:LeadingKeys condition expects a list of partition key values. Using ["${aws:userid}"] correctly passes the user's ID as a list.
🔧 Debug
advanced2:30remaining
Why does this row-level security condition fail to restrict access?
Given this IAM policy snippet for DynamoDB row-level security:
"Condition": {
"StringEquals": {
"dynamodb:LeadingKeys": "${aws:userid}"
}
}
Why does this condition fail to restrict access as intended?
Attempts:
2 left
💡 Hint
Check the expected data type for dynamodb:LeadingKeys in conditions.
✗ Incorrect
dynamodb:LeadingKeys expects a list of strings representing partition key values. Passing a single string causes the condition to fail.
❓ optimization
expert3:00remaining
Optimize a row-level security policy to minimize policy size and improve performance
You have a DynamoDB table with a partition key 'UserId' and many attributes. You want to restrict users to only access their own items and only read specific attributes. Which approach optimizes the IAM policy for row-level security?
Attempts:
2 left
💡 Hint
Think about combining partition key restrictions with attribute-level restrictions in one policy.
✗ Incorrect
Combining dynamodb:LeadingKeys and dynamodb:Attributes in one condition allows fine-grained, efficient row-level and attribute-level security with minimal policy size and better performance.