View a markdown version of this page

Data protection in AWS Amplify - AWS Amplify

Data protection in AWS Amplify

Welcome to the new AWS Amplify

Amplify now puts hosting, a Postgres database, and sign-in in one AWS account. Deploy from your terminal or from Git, check every change in a preview first, and roll back in one step if something breaks.

Looking for Amplify Hosting? See the Amplify Hosting User Guide.

The AWS shared responsibility model applies to data protection in AWS Amplify. As described in this model, AWS is responsible for protecting the global infrastructure that runs all of the AWS Cloud. You are responsible for maintaining control over your content that is hosted on this infrastructure. This content includes the security configuration and management tasks for the AWS services that you use. For more information about data privacy, see the Data Privacy FAQ.For information about data protection in Europe, see the AWS Shared Responsibility Model and GDPR blog post on the AWS Security Blog.

For data protection purposes, we recommend that you protect AWS account credentials and set up individual users with AWS Identity and Access Management (IAM). That way each user is given only the permissions necessary to fulfill their job duties. We also recommend that you secure your data in the following ways:

  • Use multi-factor authentication (MFA) with each account.

  • Use SSL/TLS to communicate with AWS resources. We recommend TLS 1.2 or later.

  • Set up API and user activity logging with AWS CloudTrail.

  • Use AWS encryption solutions, along with all default security controls within AWS services.

  • Use advanced managed security services such as Amazon Macie, which assists in discovering and securing sensitive data that is stored in Amazon S3.

  • If you require FIPS 140-2 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint. For more information about the available FIPS endpoints, see Federal Information Processing Standard (FIPS) 140-2.

We strongly recommend that you never put sensitive identifying information, such as your customers' account numbers, into free-form fields such as a Name field. This includes when you work with AWS Amplify or other AWS services using the console, API, AWS CLI, or AWS SDKs. Any data that you enter into AWS Amplify or other services might get picked up for inclusion in diagnostic logs. When you provide a URL to an external server, don’t include credentials information in the URL to validate your request to that server.

Data protection for Amplify backends

An Amplify backend stores two distinct classes of data, and they have different protections:

  • Your content — the rows in your database. This is the data your application reads and writes.

  • Amplify metadata about your backends — the records Amplify keeps to operate your backends: backend and branch names, status, timestamps, configuration documents, and the API credentials Amplify has issued for your branches.

Secrets in the logs delivered to you – The one-time account-access tokens your end users' links carry (email verification, password reset, and magic links) are masked in the request path, query string, and referrer before a backend’s access logs reach you, so a log reader cannot replay them. The database log keeps each statement as PostgreSQL wrote it, so do not put secrets in SQL text your application sends.

An end user verifies their email address before changing it – When your backend lets users change their email address (user.changeEmail), a signed-in user whose address isn’t verified can’t change it. The request fails with HTTP 403 and the code EMAIL_NOT_VERIFIED. This stops someone who signed up with another person’s address from starting a change to their own address and finishing it after the owner verifies. A verified user’s change is confirmed first at the current address. A user who mistyped their address at sign-up can’t fix it with a change, so they sign up again with the right address. A change to an address that already has an account gets the same answer and the same confirmation email as a change to a free address, so it doesn’t reveal which addresses have accounts.

Amplify does not use your content to provide or maintain the service – There is no model-training use and no service-improvement use of backend content.

Retention – Amplify stores backend data until you delete it from the service. When you delete a backend database, the data it contains is deleted with it. Deleting a branch deletes that branch’s database, and deleting a backend deletes every database it owns.

Data encryption

Encryption at rest

Enabled by default; no configuration is required

Data Encryption at rest

Your database

Encrypted at rest by default

Amplify metadata about your backends

Encrypted at rest by default

A branch’s environment-variable values

Encrypted with server-side encryption using an AWS KMS key that Amplify owns

A branch’s authentication configuration document

Server-side encrypted

You do not need to take any action to enable encryption at rest, and there is no way to disable it.

Enforcing encryption at rest through policy – Because encryption at rest is always on and cannot be turned off for any Amplify backend resource, there is no API parameter for it and therefore no IAM or SCP condition key to enforce.

Encryption in transit

Enabled by default, and Amplify does not accept unencrypted backend connections

  • Amplify’s control-plane API — the API your AWS CLI and SDK call to manage backends and branches — requires HTTPS with a minimum of TLS 1.2.

  • A backend’s data API — the REST and authentication endpoints your application calls — is reachable only over HTTPS on port 443, negotiating TLS 1.2 or TLS 1.3. There is no plaintext HTTP listener on any Amplify backend endpoint.

  • Every response from a backend’s data API carries Strict-Transport-Security (a max-age with no includeSubDomains or preload), so a browser that has reached the endpoint keeps to HTTPS for that host, and X-Content-Type-Options: nosniff. A value your SQL sets for either header is replaced, so a file your API serves for a page to load as a script or style must carry its real content type. These responses carry no Server or X-Powered-By header naming the software behind them. Amplify adds no Content-Security-Policy or X-Frame-Options to data responses; every HTML page a backend’s authentication endpoint serves sets both, with a policy that blocks plugin content and upgrades insecure requests.

  • No response from a backend’s data API is cached. Every response carries Cache-Control: no-store, which replaces any value that your SQL sets. So a CDN or browser in front of your backend doesn’t store one request’s answer and serve it to another. A refusal of a request that the data API can’t parse, or of a CONNECT request, carries Cache-Control: private, no-store instead. The local backend doesn’t add this header to REST responses.

  • The pages that a backend’s authentication endpoint serves keep to their own window. The managed sign-in page under /auth/ui/, its error pages and the default /auth/callback/ pages send Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Resource-Policy: same-origin. They also send a Permissions-Policy that turns off the camera, microphone, geolocation, and payment features. So a page that opens the sign-in page in a popup or a new tab gets no handle to it, and the sign-in page sees no window.opener. Send users to the sign-in page in the same tab, and read the result at the redirectUri that you pass. For more information, see Managed sign-in page.

  • Direct database connections use TLS. The aws amplifygen3 db commands connect with sslmode=verify-full, verifying the server certificate against the trust store of the Amplify local backend image they run psql in. If you name your own client with --psql (psql 16 or later) or --pg-dump (pg_dump 17 or later), it verifies against your operating system’s trust store. Configure other clients with sslmode=verify-full as well. Amplify’s PostgreSQL endpoint (see Connecting to your backend database with your AWS identity) refuses any connection that does not start TLS; it cannot make your client verify its certificate, and sslmode=require, prefer and allow do not.

  • Traffic between Amplify’s internal components stays on Amplify managed networks within the Region. You cannot configure this, and no backend content crosses a Region boundary unless you explicitly copy it there.

Adding your own encryption – You can encrypt field values in your application before writing them to a backend. Amplify treats column values as opaque, so client-side encryption works, with the usual trade-off that the backend cannot index, filter, or sort on an encrypted value.

Key management

Customer managed AWS KMS keys are not supported by Amplify backends today – Amplify encrypts backend data using AWS owned and AWS managed keys, and using AWS KMS keys that Amplify itself owns. There is currently no way to supply your own AWS KMS key for your backend database, for Amplify metadata, or for your configuration documents.

What this means in practice:

  • You cannot audit Amplify’s use of the encryption keys protecting your backend data through your own AWS CloudTrail key-usage events, because the keys are not in your account.

  • You cannot revoke Amplify’s access to your backend data by disabling a key you control.

There is no customer-initiated key rotation for the keys Amplify owns; Amplify enables automatic key rotation on them.

Amplify integrates with AWS KMS for the keys described above and does not currently integrate with AWS Secrets Manager, AWS Certificate Manager Private CA, or AWS IoT Core for customer-supplied key material.

Internetwork traffic privacy

Amplify backend resources are internet-reachable by design and cannot currently be confined to a VPC: a backend’s data API is a public HTTPS endpoint, Amplify’s control-plane API is a public AWS API endpoint, and AWS PrivateLink (VPC endpoints) is not available for Amplify backends today. See Infrastructure security in AWS Amplify for the full statement.