首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >亚马逊网络服务IoT政策过于宽松

亚马逊网络服务IoT政策过于宽松
EN

Stack Overflow用户
提问于 2020-07-17 13:22:02
回答 1查看 80关注 0票数 0

我正在尝试制定一项亚马逊网络服务的IoT策略,使其能够与亚马逊网络服务的IoT事物进行通信。然而,根据亚马逊网络服务IoT审计检查,该策略过于宽松:“策略允许广泛访问IoT数据平面操作:物联网:订阅、物联网:连接、物联网:发布。”我该如何解决这个问题呢?

代码语言:javascript
复制
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "iot:Connect",
      "Resource": "arn:aws:iot:us-east-1:<aws account id>:client/${iot:ClientId}"
    },
    {
      "Effect": "Allow",
      "Action": "iot:Publish",
      "Resource": "arn:aws:iot:us-east-1:<aws account id>:topic/$aws/things/*/shadow/get"
    },
    {
      "Effect": "Allow",
      "Action": [
        "iot:Subscribe"
      ],
      "Resource": [
        "arn:aws:iot:us-east-1:<aws account id>:topicfilter/$aws/events/presence/connected/*",
        "arn:aws:iot:us-east-1:<aws account id>:topicfilter/$aws/events/presence/disconnected/*",
        "arn:aws:iot:us-east-1:<aws account id>:topicfilter/$aws/things/*/shadow/update/accepted",
        "arn:aws:iot:us-east-1:<aws account id>:topicfilter/$aws/things/*/shadow/get/accepted"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "iot:Receive"
      ],
      "Resource": "arn:aws:iot:us-east-1:<aws account id>:topic/$aws/things/*"
    }
  ]
}
EN

回答 1

Stack Overflow用户

发布于 2020-08-12 04:31:44

这意味着您正在尝试一个过度暴露的策略,因为您没有提到确切的用法我认为此策略是最低权限的策略,即用例不允许您的策略具有更多限制如果不是这样,请将您的策略限制为以下内容:

arn:aws:iot:region:account-id:client/*到arn:aws:iot:region:account-id:client/${iot:ClientId}

其中,iot:ClientId是一个策略变量,指的是mqtt连接的clientId,也请参阅

https://docs.aws.amazon.com/iot/latest/developerguide/audit-chk-iot-policy-permissive.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62947566

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档