【问题标题】:AWS IOT Policy - limited to specified ClientIDAWS IOT 策略 - 仅限于指定的 ClientID
【发布时间】:2021-02-06 14:14:54
【问题描述】:

我创建了以下策略,用于限制 MQTT 客户端允许的 ClientID 连接。它应该限制为一个硬编码的 ClientID“测试”和一个作为 AWS 事物名称的 CLientID。使用 AWS Thing 的名称有效,但我的硬编码“测试”ClientId 不起作用?

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "iot:Connect",
      "Resource": "*",
      "Condition": {
        "Bool": {
          "iot:Connection.Thing.IsAttached": [
            "true"
          ]
        },
        "ForAnyValue:StringEquals": {
          "iot:ClientId": [
            "test",
            "${iot:Connection.Thing.ThingName}"
          ]
        }
      }
    },
    {
      "Effect": "Allow",
      "Action": "iot:Publish",
      "Resource": "arn:aws:iot:us-east-1:xxx:topic/$aws/things/${iot:Connection.Thing.ThingName}/*"
    },
    {
      "Effect": "Allow",
      "Action": "iot:Subscribe",
      "Resource": "arn:aws:iot:us-east-1:xxx:topicfilter/$aws/things/${iot:Connection.Thing.ThingName}/*"
    },
    {
      "Effect": "Allow",
      "Action": "iot:Receive",
      "Resource": "arn:aws:iot:us-east-1:xxx:topic/$aws/things/${iot:Connection.Thing.ThingName}/*"
    }
  ]
}

【问题讨论】:

    标签: aws-iot aws-iot-core


    【解决方案1】:

    由于您设置了"iot:Connection.Thing.IsAttached": ["true"],我相信名称为test 的Thing 需要在Thing Registry 中注册并附加主体。

    【讨论】:

    • 我认为 "iot:Connection.Thing.IsAttached" 确实使用了证书,但你可能是对的!
    • 是的,证书附加到注册表中的事物
    猜你喜欢
    • 1970-01-01
    • 2019-08-06
    • 2018-02-27
    • 2020-06-30
    • 2018-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多