0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

アクセス権のない Azure Key Vault のシークレットに何があるか Azure REST API で確認してみた

Last updated at Posted at 2024-01-20

例えば、アクセスポリシーや RBAC でアクセス権を付与されていない Azure Key Vault があったとします。下記のように、シークレットにアクセスすると「このコンテンツを表示する権限がありません。」と表示される状態です。

azure-keyvault-secret-01.png

当然 Azure CLI で下記のように実行すると AccessDenied と表示されます。

bash
$ az keyvault secret list --vault-name mnrlabo
Inner error: {
    "code": "AccessDenied"
}

Azure REST API でシークレットに何があるか確認

helloworld というシークレットが 1 つあることが確認できます。また、シークレットの値はアクセス権がないと表示できません。

bash
$ az rest --url "https://management.azure.com/subscriptions/25695fc8-000-0000-0000-f98a857adbe2/resourceGroups/mnrlabo-rg/providers/Microsoft.KeyVault/vaults/mnrlabo/secrets?api-version=2015-06-01"
{
  "value": [
    {
      "id": "/subscriptions/25695fc8-000-0000-0000-f98a857adbe2/resourceGroups/mnrlabo-rg/providers/Microsoft.KeyVault/vaults/mnrlabo/secrets/helloworld",
      "location": "japaneast",
      "name": "helloworld",
      "properties": {
        "attributes": {
          "created": 1673483266,
          "enabled": true,
          "exp": 7980681854,
          "nbf": 1673481854,
          "updated": 1673483266
        },
        "contentType": "application/x-pkcs12",
        "secretUri": "https://mnrlabo.vault.azure.net/secrets/helloworld",
        "secretUriWithVersion": "https://mnrlabo.vault.azure.net/secrets/helloworld/fceba66c23d24b9a93121bbec3f9ae99"
      },
      "type": "Microsoft.KeyVault/vaults/secrets"
    }
  ]
}

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?