【问题标题】:AWS Pinpoint updating user attributes when unauthenticated - security issue?AWS Pinpoint 在未经身份验证时更新用户属性 - 安全问题?
【发布时间】:2021-05-22 06:51:49
【问题描述】:

我正在考虑使用 AWS Pinpoint 将推送通知发送到我的 react 本机应用程序。然而,未经身份验证的用户似乎能够为他们希望的任何用户更新用户属性,即没有访问控制。我是移动开发的新手,但是将这样的东西放入前端不是安全问题吗?如果它是一个 Web 应用程序,人们将能够检查网络调用以获取凭据并拨打他们希望拨打updateEndpoint 的任何电话。这不适用于移动应用还是我误解了什么?

详情:

设置中有一个步骤显示Edit the IAM policy document for unauthenticated identities to allow permissions for the mobiletargeting:PutEvents and mobiletargeting:UpdateEndpoint actions

提供的 react native 代码 sn-p 如下:

import Analytics from '@aws-amplify/analytics';
import Auth from '@aws-amplify/auth';';

const amplifyConfig = {
  Auth: {
    identityPoolId: 'COGNITO_IDENTITY_POOL_ID',
    region: 'ap-south-1'
  }
}
//Initialize Amplify
Auth.configure(amplifyConfig);

const analyticsConfig = {
  AWSPinpoint: {
        // Amazon Pinpoint App Client ID
        appId: 'cd73a57d200e49e2bc4b97d6ebf63cd4',
        // Amazon service region
        region: 'ap-south-1',
        mandatorySignIn: false,
  }
}

Analytics.configure(analyticsConfig)

Analytics.updateEndpoint({
    attributes: {
        interests: ['science', 'politics', 'travel'],
        //..
    },
    userId: 'UserIdValue',
    userAttributes: {
        username: 'ilovethecloud'
    }
});

【问题讨论】:

    标签: amazon-web-services aws-pinpoint


    【解决方案1】:

    我不确定这是否会有所帮助,

    但是您有 2 个 IAM 策略(在 Cognito 身份池中),1 个用于经过身份验证的用户,1 个用于未验证用户。用户。

    您应该限制未授权用户的 IAM 政策,这样他们就无法编辑其他用户信息。

    此外,Cognito 为您提供的凭据是临时的,它们会过期(并由您的 react-native 应用程序更新),因此您是安全的。

    【讨论】:

      猜你喜欢
      • 2016-01-17
      • 2012-11-22
      • 1970-01-01
      • 2018-02-02
      • 1970-01-01
      • 1970-01-01
      • 2013-03-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多