如何保护 AWS 的键值

How to protect key values for AWS

我的 android 应用与 AWS S3 兼容。我正在做这种无服务器架构,这意味着我的应用程序包含访问 AWS S3 资源所需的所有信息,包括访问密钥和秘密密钥。

显然这会导致安全问题,Proguard 对保护 String 格式的数据没有太大帮助。

如果你能分享你的智慧就太好了。我相信这个问题有一些通用的方法,因为我一定不是唯一使用无服务器架构的人。

您可以使用 AWS > System Manager > Parameter Store

As michael-sqlbot have mentioned the Cognito is the recommended authentication way for mobile apps, however, if you can't be bothered setup up Cognito and investigating how it works you can use AssumeRoleWithWebIdentity 不需要调用 AWS 凭据。 AssumeRoleWithWebIdentity 承担请求的角色并生成有效期为 1 小时(默认)的临时凭证。 所以唯一的问题是您需要针对任何与 OpenID Connect 兼容的身份提供者进行身份验证。