AWS Amplify hosts web apps and provides backend services. Security risks include environment variable exposure, API key leakage in JavaScript bundles, and build log secrets.
Hosts static websites and SSR apps. Connects to GitHub, GitLab, Bitbucket for CI/CD. Environment variables configured per branch. Builds run in AWS-managed containers.
Attack note: Build logs often contain secrets. Environment variables can be exposed via client-side JavaScript if prefixed wrong.
Provisions AppSync, Cognito, S3, Lambda backends. amplify-cli generates aws-exports.js with pool IDs, API endpoints. Gen 2 uses CDK under the hood.
Attack note: aws-exports.js bundled in client exposes Cognito pool IDs, GraphQL endpoints, S3 buckets - recon goldmine
Amplify apps often expose sensitive configuration in client bundles. Build environments may leak credentials. Connected repos provide source code access. Backend misconfigurations enable data theft.
aws amplify list-appsaws amplify get-app --app-id APP_IDaws amplify list-branches --app-id APP_IDaws amplify get-branch \
--app-id APP_ID --branch-name mainaws amplify list-jobs \
--app-id APP_ID --branch-name mainaws amplify get-branch \
--app-id APP_ID --branch-name main \
--query 'branch.environmentVariables'aws amplify get-job \
--app-id APP_ID --branch-name main \
--job-id JOB_ID --query 'job.steps[*].artifactsUrl'curl https://app.example.com/aws-exports.jscurl -X POST GRAPHQL_ENDPOINT \
-H "Content-Type: application/json" \
-d '{"query": "{ __schema { types { name } } }"}'aws amplify get-job \
--app-id APP_ID --branch-name main \
--job-id JOB_IDaws amplify start-job \
--app-id APP_ID --branch-name main \
--job-type RELEASE{
"Effect": "Allow",
"Action": "amplify:*",
"Resource": "*"
}Full Amplify access - can read env vars, trigger builds, modify apps
{
"Effect": "Allow",
"Action": [
"amplify:ListApps",
"amplify:GetApp"
],
"Resource": "*"
}Only list and describe apps - no env var or build access
{
"Effect": "Allow",
"Action": [
"amplify:GetBranch",
"amplify:UpdateBranch"
],
"Resource": "*"
}Can read and modify environment variables
{
"Effect": "Deny",
"Action": [
"amplify:GetBranch",
"amplify:UpdateBranch"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {"aws:PrincipalTag/team": "devops"}
}
}Only DevOps team can access branch settings
Store secrets in Secrets Manager, fetch at build time, don't expose to client.
aws secretsmanager get-secret-value --secret-id prod/dbNever prefix secrets with REACT_APP_, NEXT_PUBLIC_, or VITE_.
Use different secrets for preview vs production branches.
Audit build logs for secret exposure. Use secret masking.
Disable self-signup if not needed. Enable MFA. Use hosted UI.
Disable introspection in production AppSync APIs.
AWS Amplify Security Card • Toc Consulting
Always obtain proper authorization before testing