AWS IAM元数据API?

时间:2018-05-07 18:16:04

标签: amazon-web-services aws-sdk aws-iam

我希望看看是否有官方API用于检索与IAM权限,服务等相关的信息的元数据。

策略模拟器控制台几乎拥有我需要的一切。查看所发出的HTTP请求,有些请求返回,看起来像是一个定义良好的JSON对象。

例如,要检索所有可用服务,它会调用:

https://policysim.aws.amazon.com/home/data/resource

并返回(简称为简称):

[
  {
    "name": "Amazon EC2",
    "actionPrefix": "ec2",
    "hasResource": true,
    "arnFormat": "arn:aws:ec2:<region>:<account>:<resourceType>/<resourcePath>"
  },
  {
    "name": "Amazon Sumerian",
    "actionPrefix": "sumerian",
    "hasResource": false,
    "arnFormat": "arn:aws:sumerian:<region>:<account-id>:<resource-type>/<resource_name>"
  },
  {
    "name": "Amazon Comprehend",
    "actionPrefix": "comprehend",
    "hasResource": false,
    "arnFormat": "arn:${Partition}:comprehend:${Region}:${AccountId}:${ResourceType}/${ResourceName}"
  },

 ...

  {
    "name": "AWS Elemental MediaStore",
    "actionPrefix": "mediastore",
    "hasResource": true,
    "arnFormat": "arn:aws:mediastore:<Region>:<Account>:<Resource>"
  }
]

然后例如,API Gateway,调用

https://policysim.aws.amazon.com/home/data/action?serviceName=Amazon+API+Gateway&servicePrefix=execute-api

返回:

[
  {
    "name": "InvalidateCache",
    "evaluated": false,
    "allowed": false,
    "prefix": "execute-api",
    "service": "Amazon API Gateway",
    "serviceAware": true,
    "resourceEnabled": true,
    "deniedByOrganization": false,
    "requiredResourceNames": [
      "execute-api-general"
    ],
    "supportedResources": [
      {
        "Name": "execute-api-general",
        "ARN": "arn:aws:execute-api:${Region}:${Account}:${ApiId}/${Stage}/${Method}/${ApiSpecificResourcePath}",
        "RegEx": "^arn:aws:execute-api:.+",
        "isRequired": true
      }
    ],
    "scenarios": [],
    "contextKeys": []
  },
  {
    "name": "Invoke",
    "evaluated": false,
    "allowed": false,
    "prefix": "execute-api",
    "service": "Amazon API Gateway",
    "serviceAware": true,
    "resourceEnabled": true,
    "deniedByOrganization": false,
    "requiredResourceNames": [
      "execute-api-general"
    ],
    "supportedResources": [
      {
        "Name": "execute-api-general",
        "ARN": "arn:aws:execute-api:${Region}:${Account}:${ApiId}/${Stage}/${Method}/${ApiSpecificResourcePath}",
        "RegEx": "^arn:aws:execute-api:.+",
        "isRequired": true
      }
    ],
    "scenarios": [],
    "contextKeys": []
  }
]

这是我追求的所有信息。服务名称列表,然后是每个服务名称的操作,以及其他一些元数据。

显然,我想使用支持IAM凭据和策略的官方API,但无法在受支持的基本SimulatePolicy和与上下文相关的API端点之外找到任何内容。

谢谢!

粉红色

1 个答案:

答案 0 :(得分:0)

根据AWS支持,如果有人正在寻找同样的事情,那么目前还没有官方或支持的API来检索此信息。