Key Vault


The presented resiliency recommendations in this guidance include Key Vault and associated settings.

Summary of Recommendations

Recommendations Details

KV-1 - Key vaults で論理的な削除を有効にする必要があります

Category: Disaster Recovery

Impact: High

Guidance

Key Vault の論理的な削除機能を使用すると、論理的な削除と呼ばれる、削除されたコンテナーと削除されたキー コンテナー オブジェクト (キー、シークレット、証明書など) を回復できます。論理的な削除が有効な場合、削除されたリソースとしてマークされたリソースは、指定された期間 (既定では 90 日間) 保持されます。このサービスはさらに、削除されたオブジェクトを回復し、基本的に削除を元に戻すためのメカニズムを提供します

Resources

Resource Graph Query

// Azure Resource Graph Query
// This Resource Graph query will return all Key Vaults that do not have soft delete enabled.
resources
| where type == "microsoft.keyvault/vaults"
| where isnull(properties.enableSoftDelete) or properties.enableSoftDelete != "true"
| project recommendationId = "kv-1", name, id, tags, param1 = "EnableSoftDelete: Disabled"



KV-2 - Key vaults で削除保護を有効にする必要があります

Category: Disaster Recovery

Impact: High

Guidance

Key vault を悪意を持って削除すると、データが完全に失われる可能性があります。組織内の悪意のある内部関係者は、key vaults を削除して消去する可能性があります。消去保護は、論理的に削除された key vaults に必須の保持期間を適用することで、インサイダー攻撃から保護します。組織内のユーザーや Microsoft は、論理的な削除の保持期間中に key vaults を消去することはできません。

Resources

Resource Graph Query

// Azure Resource Graph Query
// This resource graph query will return all Key Vaults that do not have Purge Protection enabled.
resources
| where type == "microsoft.keyvault/vaults"
| where isnull(properties.enablePurgeProtection) or properties.enablePurgeProtection != "true"
| project recommendationId = "kv-2", name, id, tags, param1 = "EnablePurgeProtection: Disabled"



Category: Networking

Impact: High

Guidance

Azure Private Link サービスを使用すると、仮想ネットワーク内のプライベート エンドポイント経由で Azure Key Vault と Azure でホストされているお客様/パートナー サービスにアクセスできます。Azure プライベート エンドポイントは、Azure Private Link を利用したサービスにプライベートかつ安全に接続するネットワーク インターフェイスです。プライベート エンドポイントは、VNet のプライベート IP アドレスを使用して、サービスを効果的に VNet に取り込みます。サービスへのすべてのトラフィックはプライベート エンドポイント経由でルーティングできるため、ゲートウェイ、NAT デバイス、ExpressRoute または VPN 接続、パブリック IP アドレスは必要ありません。仮想ネットワークとサービス間のトラフィックは Microsoft のバックボーン ネットワークを経由するため、パブリック インターネットからの露出が排除されます。Azure リソースのインスタンスに接続して、アクセス制御の最高レベルの粒度を実現できます。

Resources

Resource Graph Query

// Azure Resource Graph Query
// This resource graph query will return all Key Vaults that does not have a Private Endpoint Connection or where a private endpoint exists but public access is enabled

resources
| where type == "microsoft.keyvault/vaults"
| where isnull(properties.privateEndpointConnections) or properties.privateEndpointConnections[0].properties.provisioningState != ("Succeeded") or (isnull(properties.networkAcls) and properties.publicNetworkAccess == 'Enabled')
| extend param1 = strcat('Private Endpoint: ', iif(isnotnull(properties.privateEndpointConnections),split(properties.privateEndpointConnections[0].properties.privateEndpoint.id,'/')[8],'No Private Endpoint'))
| extend param2 = strcat('Access: ', iif(properties.publicNetworkAccess == 'Disabled', 'Public Access Disabled', iif(isnotnull(properties.networkAcls), 'NetworkACLs in place','Public Access Enabled')))
| project recommendationID = "kv-3", name, id, tags, param1, param2



KV-4 - 環境ごとアプリケーションごとに個別の Key vaults を使用します

Category: Governance

Impact: High

Guidance

Key vaults は、格納されているシークレットのセキュリティ境界を定義します。シークレットを同じ vault にグループ化すると、攻撃によって懸念事項全体のシークレットにアクセスできる可能性があるため、セキュリティ イベントの影響範囲が広がります。懸念事項間のアクセスを軽減するには、特定のアプリケーションがアクセスできるシークレットを検討し、この線引きに基づいて key vaults を分離します。アプリケーションごとに key vaults を分離することは、最も一般的な境界です。ただし、セキュリティ境界は、たとえば、関連するサービスのグループごとなど、大規模なアプリケーションに対してより詳細に設定できます。

Resources

Resource Graph Query

// under-development



KV-5 - Key Vault の診断ログを有効にする必要があります

Category: Monitoring

Impact: Low

Guidance

ログを有効にし、アラートを設定し、保持要件に従って保持します。これにより、key vaults がいつ、どのように、誰によってアクセスされたかを監視できます。

Resources

Resource Graph Query

// Azure Resource Graph Query
// This resource graph query will return all Key Vaults that does not have Diagnostic logs enabled

policyresources
|wheretype=='microsoft.policyinsights/policystates'
|whereproperties.complianceState=='NonCompliant'
| extend policyDefinitionId = tostring(tolower(properties.policyDefinitionId)),resourceId = tostring(tolower(properties.resourceId)), PolicyAssignmentName = properties.policyAssignmentName, policySetDefinitionId = tostring(tolower(properties.policySetDefinitionId))
| project resourceId,policySetDefinitionId,policyDefinitionId
| join kind=inner(
    policyresources
    |where type == 'microsoft.authorization/policydefinitions'
    | extend displayName = tostring(properties.displayName)
    | where displayName contains "Resource logs in Key Vault should be enabled"
    | project policyDefinitionId=tostring(tolower(id)),displayName
) on policyDefinitionId
| project resourceId,policySetDefinitionId,policyDefinitionId
| join kind=inner(
    policyresources
    |where type == 'microsoft.authorization/policysetdefinitions'
    | extend displayName = tostring(properties.displayName)
    | where displayName contains "Microsoft cloud security benchmark"
    | project policySetDefinitionId=tostring(tolower(id)),displayName
) on policySetDefinitionId
| join kind=inner(
  resources
  | where type == 'microsoft.keyvault/vaults'
  | project resourceId = tostring(tolower(id)),name,tags
)on resourceId
| project-away resourceId1,policySetDefinitionId1,policySetDefinitionId,policyDefinitionId,displayName
| project recommendationID = "kv-5",id=resourceId,name,tags