rules/findings/azure/keyvault/azure-keyvault-private-endpoint-disabled.json

{
    "provider": "Azure",
    "serviceType": "Azure KeyVault",
    "serviceName": "Storage",
    "displayName": "Ensure Private Endpoints are used to access Azure Key Vault",
    "description": "Use private endpoints to allow clients and services to securely access data located over a network via an encrypted Private Link. To do this, the private endpoint uses an IP address from the VNet for each service. Network traffic between disparate servicessecurely traverses encrypted over the VNet. This VNet can also link addressing space, extending your network and accessing resources on it. Similarly, it can be a tunnel through public networks to connect remote infrastructures together. This creates further security through segmenting network traffic and preventing outside sources from accessing it.\r\nPrivate endpoints will secure network traffic from Azure Key Vault to the resources requesting secrets and keys.",
    "rationale": "Private endpoints will keep network requests to Azure Key Vault limited to the endpoints attached to the resources that are whitelisted to communicate with each other. Assigning the Key Vault to a network without an endpoint will allow other resources on that network to view all traffic from the Key Vault to its destination. In spite of the complexity in configuration, this is recommended for high security secrets.",
    "impact": "Incorrect or poorly-timed changing of network configuration could result in service interruption. There are also additional costs tiers for running a private endpoint per petabyte or more of networking traffic.",
    "remediation": {
        "text": "",
        "code": {
            "powerShell": null,
            "iac": null,
            "terraform": null,
            "other": null
        }
    },
    "recommendation": null,
    "references": [
        "https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview",
        "https://learn.microsoft.com/en-us/azure/storage/common/storage-private-endpoints",
        "https://azure.microsoft.com/en-us/pricing/details/private-link/",
        "https://learn.microsoft.com/en-us/azure/key-vault/general/private-link-service?tabs=portal",
        "https://learn.microsoft.com/en-us/azure/virtual-network/quickstart-create-virtual-network?tabs=portal",
        "https://learn.microsoft.com/en-us/azure/private-link/tutorial-private-endpoint-storage-portal?tabs=dynamic-ip",
        "https://learn.microsoft.com/en-us/azure/bastion/bastion-overview",
        "https://learn.microsoft.com/en-us/azure/dns/private-dns-getstarted-cli#create-an-additional-dns-record",
        "https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-data-protection#dp-8-ensure-security-of-key-and-certificate-repository"
    ],
    "compliance": [
        {
            "name": "CIS Microsoft Azure Foundations",
            "version": "5.0.0",
            "reference": "8.3.8",
            "profile": [
                "Level 2"
            ]
        }
    ],
    "level": "medium",
    "tags": [
         
    ],
    "rule": {
        "path": "az_keyvault",
        "subPath": null,
        "selectCondition": {
             
        },
        "data": {
            "properties": {
                "id": "keyVaultId",
                "name": "name",
                "location":"location",
                "networking.privateEndpointConnections": "privateEndpoints"
            },
            "expandObject": null
        },
        "query": [
            {
                "filter": [
                    {
                        "conditions": [
                            [
                                "ne",
                                "id"
                            ],
                            [
                                "properties.provisioningState",
                                "eq",
                                "Succeeded"
                            ]
                        ],
                        "operator":"and",
                        "whereObject":"privateEndpoints",
                        "atLeast":1
                    }
                ]
            }
        ],
        "shouldExist": null,
        "returnObject": null,
        "removeIfNotExists": null
    },
    "output": {
        "html": {
            "data": {
                "properties": {
                    "name": "Key Vault Name",
                    "location": "Location",
                    "privateEndpoints.id": "Private Endpoint"
                },
                "expandObject": null
            },
            "table": "default",
            "decorate": [
                 
            ],
            "emphasis": [
                 
            ],
            "actions": {
                "objectData": {
                    "properties": [
                        "id",
                        "name",
                        "networking"
                    ],
                    "expandObject": null,
                    "limit": null
                },
                "showGoToButton": "true",
                "showModalButton": "true",
                "directLink": null
            }
        },
        "text": {
            "data": {
                "properties": {
                    "name": "Key Vault Name",
                    "location": "Location",
                    "networking.privateEndpointConnections.id": "Private Endpoint"
                },
                "expandObject": null
            },
            "status": {
                "keyName": ["name"],
                "message": "Ensure Private Endpoints are used to access {name} Key Vault",
                "defaultMessage": "Ensure Private Endpoints are used to access Azure Key Vault"
            },
            "properties": {
                "resourceName": "name",
                "resourceId": "id",
                "resourceType": "AzureKeyVault"
            },
            "onlyStatus": false
        }
    },
    "idSuffix": "azure_key_vault_private_endpoint_disabled",
    "notes": [
         
    ],
    "categories": [
         
    ],
    "immutable_properties": [
        "id"
    ],
    "id": "azure_keyvault_008"
}