Amazon DynamoDB | Security and control Flashcards

1
Q

What is the order of the results in scan on a local secondary index?

Security and control

Amazon DynamoDB | Database

A

For local secondary index, the ordering within a collection will be the based on the order of the indexed attribute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is DynamoDB Fine-Grained Access Control?

Security and control

Amazon DynamoDB | Database

A

Fine Grained Access Control (FGAC) gives a DynamoDB table owner a high degree of control over data in the table. Specifically, the table owner can indicate who (caller) can access which items or attributes of the table and perform what actions (read / write capability). FGAC is used in concert with AWS Identity and Access Management (IAM), which manages the security credentials and the associated permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the common use cases for DynamoDB FGAC?

Security and control

Amazon DynamoDB | Database

A

FGAC can benefit any application that tracks information in a DynamoDB table, where the end user (or application client acting on behalf of an end user) wants to read or modify the table directly, without a middle-tier service. For instance, a developer of a mobile app named Acme can use FGAC to track the top score of every Acme user in a DynamoDB table. FGAC allows the application client to modify only the top score for the user that is currently running the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can I use Fine Grain Access Control with JSON documents?

Security and control

Amazon DynamoDB | Database

A

Yes. You can use Fine Grain Access Control (FGAC) to restrict access to your data based on top-level attributes in your document. You cannot use FGAC to restrict access based on nested attributes. For example, suppose you stored a JSON document that contained the following information about a person: ID, first name, last name, and a list of all of their friends. You could use FGAC to restrict access based on their ID, first name, or last name, but not based on the list of friends.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Without FGAC, how can a developer achieve item level access control?

Security and control

Amazon DynamoDB | Database

A

To achieve this level of control without FGAC, a developer would have to choose from a few potentially onerous approaches. Some of these are:

Proxy: The application client sends a request to a brokering proxy that performs the authentication and authorization. Such a solution increases the complexity of the system architecture and can result in a higher total cost of ownership (TCO).

Per Client Table: Every application client is assigned its own table. Since application clients access different tables, they would be protected from one another. This could potentially require a developer to create millions of tables, thereby making database management extremely painful.

Per-Client Embedded Token: A secret token is embedded in the application client. The shortcoming of this is the difficulty in changing the token and handling its impact on the stored data. Here, the key of the items accessible by this client would contain the secret token.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does DynamoDB FGAC work?

Security and control

Amazon DynamoDB | Database

A

With FGAC, an application requests a security token that authorizes the application to access only specific items in a specific DynamoDB table. With this token, the end user application agent can make requests to DynamoDB directly. Upon receiving the request, the incoming request’s credentials are first evaluated by DynamoDB, which will use IAM to authenticate the request and determine the capabilities allowed for the user. If the user’s request is not permitted, FGAC will prevent the data from being accessed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How much does DynamoDB FGAC cost?

Security and control

Amazon DynamoDB | Database

A

There is no additional charge for using FGAC. As always, you only pay for the provisioned throughput and storage associated with the DynamoDB table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do I get started?

Security and control

Amazon DynamoDB | Database

A

Refer to the Fine-Grained Access Control section of the DynamoDB Developer Guide to learn how to create an access policy, create an IAM role for your app (e.g. a role named AcmeFacebookUsers for a Facebook app_id of 34567), and assign your access policy to the role. The trust policy of the role determines which identity providers are accepted (e.g. Login with Amazon, Facebook, or Google), and the access policy describes which AWS resources can be accessed (e.g. a DynamoDB table). Using the role, your app can now to obtain temporary credentials for DynamoDB by calling the AssumeRoleWithIdentityRequest API of the AWS Security Token Service (STS).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do I allow users to Query a Local Secondary Index, but prevent them from causing a table fetch to retrieve non-projected attributes?

Security and control

Amazon DynamoDB | Database

A

Some Query operations on a Local Secondary Index can be more expensive than others if they request attributes that are not projected into an index. You an restrict such potentially expensive “fetch” operations by limiting the permissions to only projected attributes, using the “dynamodb:Attributes” context key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do I prevent users from accessing specific attributes?

Security and control

Amazon DynamoDB | Database

A

The recommended approach to preventing access to specific attributes is to follow the principle of least privilege, and Allow access to only specific attributes.

Alternatively, you can use a Deny policy to specify attributes that are disallowed. However, this is not recommended for the following reasons:

With a Deny policy, it is possible for the user to discover the hidden attribute names by issuing repeated requests for every possible attribute name, until the user is ultimately denied access.

Deny policies are more fragile, since DynamoDB could introduce new API functionality in the future that might allow an access pattern that you had previously intended to block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do I prevent users from adding invalid data to a table?

Security and control

Amazon DynamoDB | Database

A

The available FGAC controls can determine which items changed or read, and which attributes can be changed or read. Users can add new items without those blocked attributes, and change any value of any attribute that is modifiable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Can I grant access to multiple attributes without listing all of them?

Security and control

Amazon DynamoDB | Database

A

Yes, the IAM policy language supports a rich set of comparison operations, including StringLike, StringNotLike, and many others. For additional details, please see the IAM Policy Reference.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do I create an appropriate policy?

Security and control

Amazon DynamoDB | Database

A

We recommend that you use the DynamoDB Policy Generator from the DynamoDB console. You may also compare your policy to those listed in the Amazon DynamoDB Developer Guide to make sure you are following a recommended pattern. You can post policies to the AWS Forums to get thoughts from the DynamoDB community.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can I grant access based on a canonical user id instead of separate ids for the user based on the identity provider they logged in with?

Security and control

Amazon DynamoDB | Database

A

Not without running a “token vending machine”. If a user retrieves federated access to your IAM role directly using Facebook credentials with STS, those temporary credentials only have information about that user’s Facebook login, and not their Amazon login, or Google login. If you want to internally store a mapping of each of these logins to your own stable identifier, you can run a service that the user contacts to log in, and then call STS and provide them with credentials scoped to whatever partition key value you come up with as their canonical user id.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What information cannot be hidden from callers using FGAC?

Security and control

Amazon DynamoDB | Database

A

Certain information cannot currently be blocked from the caller about the items in the table:

Item collection metrics. The caller can ask for the estimated number of items and size in bytes of the item collection.

Consumed throughput The caller can ask for the detailed breakdown or summary of the provisioned throughput consumed by operations.

Validation cases. In certain cases, the caller can learn about the existence and primary key schema of a table when you did not intend to give them access. To prevent this, follow the principle of least privilege and only allow access to the tables and actions that you intended to allow access to.

If you deny access to specific attributes instead of whitelisting access to specific attributes, the caller can theoretically determine the names of the hidden attributes if “allow all except for” logic. It is safer to whitelist specific attribute names instead.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Does Amazon DynamoDB support IAM permissions?

Security and control

Amazon DynamoDB | Database

A

Yes, DynamoDB supports API-level permissions through AWS Identity and Access Management (IAM) service integration.

For more information about IAM, go to:

AWS Identity and Access Management

AWS Identity and Access Management Getting Started Guide

Using AWS Identity and Access Management