AWS Amplify 不安全吗?

Is AWS Amplify insecure?

我的任务是在 React Native 应用程序中实现用户 登录/注册 流程。这个应用程序没有什么特别之处。通常的登录、注册(使用短信验证)和密码重置屏幕就足够了。所以我去寻找身份提供者。 Auth0 和 AWS Cognito 是最合适的发现。我的经理认为 Auth0 太贵了,所以我们放弃了它。这让我有了 Cognito 选项。

根据 docs, it is possible to completely replace the default UI (which is something that pleases the UI/UX team) but still using the underlying infrastructure. One thing that concerns our team very much is security. According to this and this, authorization requests should only be made through external agents (mobile user browsers). So I went digging into the aws-amplify's source code and found that ultimately what it does(如果我在这里错了,请纠正我)只是一个简单的 API 向 AWS 身份验证端点请求传递我的 ClientId 和其他属性。

这让我有点担心与 AWS 交互的安全性。由于 AWS 端点是安全的,我知道中间人攻击已被丢弃。

但是是什么让攻击者反编译我的移动应用程序、访问 ClientId 并直接向 AWS 发出请求? AWS Amplify 真的那么不安全还是我遗漏了什么?

有很多可能的攻击,但在高级别 3 中脱颖而出
凭据泄露
社会工程学
DoS

凭据泄露
您的帐户凭据不应公开,STS 凭据有时间限制,需要您专门授予池访问 aws 服务的权限
https://docs.aws.amazon.com/cognito/latest/developerguide/role-based-access-control.html 您需要给予最低权限,请遵循此处概述的方法
https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege

社会工程学攻击
我想可以使用来自反编译源的暴露的 ClientId,但需要与其他用户数据结合,因此作为一般规则,锁定链接到您帐户的所有内容,这些内容可能与社交攻击中的 Client Id 结合

DOS
AWS 在池中提供它所谓的 "Advanced Security" https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-advanced-security.html

在构建全面的 Cognito 应用程序时,这应该是必需的

安全威胁不断演变,AWS做的不错,用起来有安全优势
云端
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/security.html

CloudTrail
https://aws.amazon.com/cloudtrail/