Security in 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.
Security is the first priority at AWS, and AWS Amplify brings it to every app that you deploy. Your frontend, your backend, and your database run on one platform. The same protections cover all three from the first deployment. You don’t assemble a firewall, a certificate service, and a database vendor, and you don’t wait for a paid plan to be protected.
This chapter covers how Amplify protects your app and your AWS account. To sign in your app’s own users, see Auth.
This chapter also covers the firewall, identity and access management, data protection, compliance, resilience, and infrastructure security for Amplify.
Topics
Protected from the first deployment
Every app, on every plan, is served over HTTPS and protected against distributed denial of service (DDoS) attacks. The Amplify managed firewall inspects every request before it reaches your code. It blocks known exploits, malicious IP addresses, and common web attacks on your frontend and your backend alike. There is nothing to configure and no additional cost. For more information, see Firewall.
Your backend data is private until you choose to share it. A new table stays closed until you grant access to it. With row-level security, your app’s users see only the rows that your policies allow. Amplify encrypts your backend data at rest. For more information about row-level security and data protection, see Secure your data and Data protection in AWS Amplify.
Sign-in requests from a browser work only from your app’s own URLs and the origins that you add. For more information about the origins that your backend trusts, see Trusted origins.
Built on AWS security that you already trust
Amplify protects your app with AWS services that many organizations already use to secure their own workloads. If your organization already approves these services, you have no new security vendor to review.
-
AWS Web Application Firewall (AWS WAF) runs the Amplify managed firewall and your custom firewall.
-
AWS Certificate Manager (ACM) provisions and renews the certificates for your custom domains.
-
AWS Identity and Access Management (IAM) controls who can manage your app and its data.
-
AWS CloudTrail (CloudTrail) records the actions taken on your app and each database sign-in.
You stay in control, in your AWS account
Security controls live where your team already works. IAM policies decide who on your team can deploy, change settings, or read data. Database sign-in uses a token from your AWS identity that lasts up to an hour, instead of a stored password. CloudTrail records each sign-in. For more information about IAM policies and database sign-in, see Identity and access management for AWS Amplify and Database.
Firewall logs go to your own Amazon CloudWatch Logs log group, and you choose how long to keep them. For more information about firewall logs, see Firewall logs.
Stronger protection as your app grows
When your app needs more than the defaults, you can add the following controls without moving to another platform. Your Amplify plan sets which of these controls you can use. For more information about plans, see Pricing and spend limits.
-
A custom firewall lets you bring your own protection pack from AWS WAF. You can add rate limits, country blocks, CAPTCHA, and bot management. You can also add rules that protect WordPress, PHP, and SQL databases. For more information, see Add a custom firewall to your app.
-
Access control keeps an environment private to people who sign in with AWS IAM Identity Center or your own OpenID Connect (OIDC) provider.
-
Secrets keep API keys and passwords out of your code. For more information, see Manage secrets.
Shared responsibility for security
Amplify secures the platform that runs your app. You secure your app, including your code, your row-level security policies, your keys, and who has access to your AWS account.
Validate the input that your app receives. Keep server-only access out of browser code. Start new apps from the latest version of your framework, and keep your dependencies up to date.
Security is a shared responsibility between AWS and you. For more information, see the shared responsibility model on the AWS website
Shared responsibility for backends
An Amplify backend has three parts behind one endpoint. Database is managed PostgreSQL. Auth gives your app authentication, authorization, and user management, built into your backend, and runs on managed Better Auth. Data API is a PostgREST-compatible HTTPS API that reads and writes your tables. AWS runs all three parts for you, and you decide who can reach your data and what each caller can do with it.
AWS is responsible for the following:
-
Running Database, Auth, and the Data API for each branch of your backend, and patching their runtime, its operating system, and the database engine. You have nothing to patch.
-
Isolating each branch from other customers. Each branch runs in its own virtual machine and has its own Amazon Aurora cluster. For more information, see Infrastructure security in AWS Amplify.
-
Encrypting your data at rest and in transit. You can’t turn encryption off. For more information, see Data protection in AWS Amplify.
-
Keeping automated backups of each branch’s database in the backend’s AWS Region.
-
Checking the credentials of every request to your backend.
You are responsible for the following:
-
The grants and row level security (RLS) policies in your migrations. Your publishable key is public, so these policies decide what an anonymous caller can read and change. For more information, see Secure your data.
-
Which IAM principals hold
amplifygen3:Connect. A request that one of them signs runs asservice_role, which bypasses RLS. For more information, see Permissions for your app. -
Replacing and revoking your publishable keys. For more information, see API keys and roles.
-
Your Auth settings, such as the origins that your backend trusts, email verification, and the server that sends your auth email. For more information, see Auth configuration.
-
How long backups are kept, and any copy of your data outside its Region. For more information, see Backups and restore.
-
The data that you store in your backend, and your app’s code and dependencies.
-
Your local backend, which gives full access to any process that can reach its ports. Keep its ports on
127.0.0.1.
Before you launch, work through the Backend production checklist.