Framework/Configurations/ARMChecker/ARMControls.json

{
  "resourceControlSets": [
    {
      "featureName": "TrafficManager",
      "supportedResourceTypes": [ "Microsoft.Network/trafficManagerProfiles" ],
      "controls": [
        {
          "id": "TrafficManager120",
          "controlId": "Azure_TrafficManager_DP_Enable_HTTPS",
          "isEnabled": true,
          "description": "Traffic Manager profile should use HTTPS protocol for endpoint monitoring",
          "rationale": "",
          "recommendation": "",
          "severity": "Medium",
          "jsonPath": [ "$.properties.monitorConfig.protocol" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "HTTPS",
            "isCaseSensitive": false
          }
        }
      ]
    },
    {
      "featureName": "ServiceFabric",
      "supportedResourceTypes": [ "Microsoft.ServiceFabric/clusters" ],
      "controls": [
        {
          "id": "ServiceFabric300",
          "controlId": "Azure_ServiceFabric_SI_Set_Auto_Update_Cluster",
          "isEnabled": true,
          "description": "Upgrade mode should be set to automatic for cluster",
          "rationale": "Clusters with unsupported fabric version can become targets for compromise from various malware/trojan attacks that exploit known vulnerabilities in software.",
          "recommendation": "You can set your cluster to receive automatic fabric upgrades as they are released by Microsoft, for details please refer: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-upgrade",
          "severity": "Medium",
          "jsonPath": [ "$.properties.upgradeMode" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "Automatic",
            "isCaseSensitive": false
          }
        },
        {
          "id": "ServiceFabric220",
          "controlId": "Azure_ServiceFabric_AuthN_Client_AuthN_AAD_Only",
          "isEnabled": true,
          "description": "Client authentication must be performed only via Azure Active Directory",
          "rationale": "Using the native enterprise directory for authentication ensures that there is a built-in high level of assurance in the user identity established for subsequent access control. All Enterprise subscriptions are automatically associated with their enterprise directory (xxx.onmicrosoft.com) and users in the native directory are trusted for authentication to enterprise subscriptions.",
          "recommendation": "A Service Fabric cluster offers several entry points to its management functionality, including the web-based Service Fabric Explorer, Visual Studio and PowerShell. Access to the cluster must be controlled using AAD. Refer: https://docs.microsoft.com/en-in/azure/service-fabric/service-fabric-cluster-creation-setup-aad",
          "severity": "High",
          "jsonPath": [ "$.properties.azureActiveDirectory.tenantId" ],
          "matchType": "StringWhitespace",
          "data": {
            "value": false
          }
        },
        {
          "id": "ServiceFabric220",
          "controlId": "Azure_ServiceFabric_AuthN_Client_AuthN_AAD_Only",
          "isEnabled": true,
          "description": "Client authentication must be performed only via Azure Active Directory",
          "rationale": "Using the native enterprise directory for authentication ensures that there is a built-in high level of assurance in the user identity established for subsequent access control. All Enterprise subscriptions are automatically associated with their enterprise directory (xxx.onmicrosoft.com) and users in the native directory are trusted for authentication to enterprise subscriptions.",
          "recommendation": "A Service Fabric cluster offers several entry points to its management functionality, including the web-based Service Fabric Explorer, Visual Studio and PowerShell. Access to the cluster must be controlled using AAD. Refer: https://docs.microsoft.com/en-in/azure/service-fabric/service-fabric-cluster-creation-setup-aad",
          "severity": "High",
          "jsonPath": [ "$.properties.azureActiveDirectory.clusterApplication" ],
          "matchType": "StringWhitespace",
          "data": {
            "value": false
          }
        },
        {
          "id": "ServiceFabric220",
          "controlId": "Azure_ServiceFabric_AuthN_Client_AuthN_AAD_Only",
          "isEnabled": true,
          "description": "Client authentication must be performed only via Azure Active Directory",
          "rationale": "Using the native enterprise directory for authentication ensures that there is a built-in high level of assurance in the user identity established for subsequent access control. All Enterprise subscriptions are automatically associated with their enterprise directory (xxx.onmicrosoft.com) and users in the native directory are trusted for authentication to enterprise subscriptions.",
          "recommendation": "A Service Fabric cluster offers several entry points to its management functionality, including the web-based Service Fabric Explorer, Visual Studio and PowerShell. Access to the cluster must be controlled using AAD. Refer: https://docs.microsoft.com/en-in/azure/service-fabric/service-fabric-cluster-creation-setup-aad",
          "severity": "High",
          "jsonPath": [ "$.properties.azureActiveDirectory.clientApplication" ],
          "matchType": "StringWhitespace",
          "data": {
            "value": false
          }
        },
        {
          "id": "ServiceFabric230",
          "controlId": "Azure_ServiceFabric_DP_Set_Property_ClusterProtectionLevel",
          "isEnabled": true,
          "description": "The ClusterProtectionLevel property must be set to EncryptAndSign",
          "rationale": "With cluster protection level set to 'EncryptAndSign', all the node-to-node messages are encrypted and digitally signed. This protects the intra-cluster communication from eavesdropping/tampering/man-in-the-middle attacks on the network.",
          "recommendation": "Service Fabric provides three levels of protection (None, Sign and EncryptAndSign) for node to node communication using cluster primary certificate. The protection level can be specified using property 'ClusterProtectionLevel' inside Service Fabric ARM template. The value of 'ClusterProtectionLevel' must be set to 'EncryptAndSign' to ensure that all the node-to-node messages are encrypted and digitally signed. Configure 'ClusterProtectionLevel' using ARM template as follows: ARM Template --> Resources --> Select resource type 'Microsoft.ServiceFabric/clusters' --> 'fabricSettings' --> Add 'ClusterProtectionLevel' property with value 'EncryptAndSign'.",
          "severity": "High",
          "jsonPath": [ "$.properties.fabricSettings[0].name" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "Security",
            "isCaseSensitive": false
          }
        },
        {
          "id": "ServiceFabric230",
          "controlId": "Azure_ServiceFabric_DP_Set_Property_ClusterProtectionLevel",
          "isEnabled": true,
          "description": "The ClusterProtectionLevel property must be set to EncryptAndSign",
          "rationale": "With cluster protection level set to 'EncryptAndSign', all the node-to-node messages are encrypted and digitally signed. This protects the intra-cluster communication from eavesdropping/tampering/man-in-the-middle attacks on the network.",
          "recommendation": "Service Fabric provides three levels of protection (None, Sign and EncryptAndSign) for node to node communication using cluster primary certificate. The protection level can be specified using property 'ClusterProtectionLevel' inside Service Fabric ARM template. The value of 'ClusterProtectionLevel' must be set to 'EncryptAndSign' to ensure that all the node-to-node messages are encrypted and digitally signed. Configure 'ClusterProtectionLevel' using ARM template as follows: ARM Template --> Resources --> Select resource type 'Microsoft.ServiceFabric/clusters' --> 'fabricSettings' --> Add 'ClusterProtectionLevel' property with value 'EncryptAndSign'.",
          "severity": "High",
          "jsonPath": [ "$.properties.fabricSettings[0].parameters[0].name" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "ClusterProtectionLevel",
            "isCaseSensitive": false
          }
        },
        {
          "id": "ServiceFabric230",
          "controlId": "Azure_ServiceFabric_DP_Set_Property_ClusterProtectionLevel",
          "isEnabled": true,
          "description": "The ClusterProtectionLevel property must be set to EncryptAndSign",
          "rationale": "With cluster protection level set to 'EncryptAndSign', all the node-to-node messages are encrypted and digitally signed. This protects the intra-cluster communication from eavesdropping/tampering/man-in-the-middle attacks on the network.",
          "recommendation": "Service Fabric provides three levels of protection (None, Sign and EncryptAndSign) for node to node communication using cluster primary certificate. The protection level can be specified using property 'ClusterProtectionLevel' inside Service Fabric ARM template. The value of 'ClusterProtectionLevel' must be set to 'EncryptAndSign' to ensure that all the node-to-node messages are encrypted and digitally signed. Configure 'ClusterProtectionLevel' using ARM template as follows: ARM Template --> Resources --> Select resource type 'Microsoft.ServiceFabric/clusters' --> 'fabricSettings' --> Add 'ClusterProtectionLevel' property with value 'EncryptAndSign'.",
          "severity": "High",
          "jsonPath": [ "$.properties.fabricSettings[0].parameters[0].value" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "EncryptAndSign",
            "isCaseSensitive": false
          }
        }
      ]
    },
    {
      "featureName": "DataLakeStore",
      "supportedResourceTypes": [ "Microsoft.DataLakeStore/accounts" ],
      "controls": [
        {
          "id": "DataLakeStore180",
          "controlId": "Azure_DataLakeStore_DP_Encrypt_At_Rest",
          "isEnabled": true,
          "description": "Sensitive data must be encrypted at rest",
          "rationale": "Using this feature ensures that sensitive data is stored encrypted at rest. This minimizes the risk of data loss from physical theft and also helps meet regulatory compliance requirements.",
          "recommendation": "Ensure that encryption is not disabled when creating a new Data Lake Store. Refer: https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-security-overview#data-protection. Encryption cannot be enabled after the fact for Data Lake Store.",
          "severity": "High",
          "jsonPath": [ "$.properties.encryptionState" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "Enabled",
            "isCaseSensitive": false
          }
        }
      ]
    },
    {
      "featureName": "CDN",
      "supportedResourceTypes": [ "Microsoft.Cdn/profiles" ],
      "controls": [],
      "NestedResourcesControlSet": [
        {
 
          "featureName": "CDN",
          "supportedResourceTypes": [ "endpoints" ],
          "controls": [
            {
              "id": "CDN140",
              "controlId": "Azure_CDN_DP_Enable_Https",
              "isEnabled": true,
              "description": "CDN endpoints must use HTTPS protocol while providing data to the client browser/machine or while fetching data from the origin server",
              "rationale": "Use of HTTPS ensures server/service authentication and protects data in transit from network layer man-in-the-middle, eavesdropping, session-hijacking attacks.",
              "recommendation": "To enable HTTPS protocol: Go to Azure Portal --> your CDN Profile --> your CDN Endpoint --> Origin --> Select HTTPS --> Save. Else implement through PowerShell as follows: `$ce= Get-AzCdnEndpoint -EndpointName <EndpointName> ProfileName '<CDNprofile>' -ResourceGroupName '<RGName>'; `$ce.IsHttpAllowed =`$false; `$ce.IsHttpsAllowed =`$true; Set-AzCdnEndpoint -CdnEndpoint `$ce",
              "severity": "High",
              "jsonPath": [ "$.properties.isHttpsAllowed" ],
              "matchType": "Boolean",
              "data": {
                "value": true
              }
            }
          ]
        }
      ]
 
    },
    {
      "featureName": "RedisCache",
      "supportedResourceTypes": [ "Microsoft.Cache/Redis" ,"Microsoft.Cache/Redis/firewallRules"],
      "controls": [
        {
          "id": "RedisCache150",
          "controlId": "Azure_RedisCache_DP_Use_SSL_Port",
          "isEnabled": true,
          "description": "Non-SSL port must not be enabled",
          "rationale": "Use of HTTPS ensures server/service authentication and protects data in transit from network layer man-in-the-middle, eavesdropping, session-hijacking attacks.",
          "recommendation": "To disable Non-SSL port for Redis Cache, run command : Set-AzRedisCache -ResourceGroupName <String> -Name <String> -EnableNonSslPort `$false",
          "severity": "High",
          "jsonPath": [ "$.properties.enableNonSslPort" ],
          "matchType": "Boolean",
          "data": {
            "value": false
          }
        },
        {
          "id": "RedisCache140",
          "controlId": "Azure_RedisCache_BCDR_Use_RDB_Backup",
          "isEnabled": true,
          "description": "Redis Data Persistence should be enabled to back up Redis Cache data",
          "rationale": "Enabling backup on Redis Cache ensures that there is always a previous snapshot of data that can be leveraged towards recovery scenarios.",
          "recommendation": "Configure data persistence. Refer: https://docs.microsoft.com/en-us/azure/redis-cache/cache-configure#redis-data-persistence",
          "severity": "Medium",
          "jsonPath": [ "$.properties.redisConfiguration.rdb-backup-enabled" ],
          "matchType": "Boolean",
          "data": {
            "value": true
          }
        }
      ]
    },
    {
      "featureName": "CosmosDb",
      "supportedResourceTypes": [ "Microsoft.DocumentDB/databaseAccounts" ],
      "controls": [
        {
          "id": "CosmosDb110",
          "controlId": "Azure_CosmosDB_AuthZ_Enable_Firewall",
          "isEnabled": true,
          "description": "Cosmos DB firewall should be enabled",
          "rationale": "Using the firewall feature ensures that access to the data or the service is restricted to a specific set/group of clients. While this may not be feasible in all scenarios, when it can be used, it provides an extra layer of access control protection for critical assets.",
          "recommendation": "Azure Portal --> Resource --> Firewall. Turn 'ON' - 'Selected Networks' and provide required IP addresses and/or ranges in the IP tab and save. Note: In case the IP range is indeterminate (for instance, if the client is a PaaS endpoint), you may need to attest this control.",
          "severity": "High",
          "jsonPath": [ "$.properties.ipRangeFilter" ],
          "matchType": "StringWhitespace",
          "data": { "value": false }
        },
        {
          "id": "CosmosDb120",
          "controlId": "Azure_CosmosDB_AuthZ_Verify_IP_Range",
          "isEnabled": true,
          "description": "Configure only the required IP addresses on Cosmos DB firewall",
          "rationale": "",
          "recommendation": "Do not use high ranges like 0.0.0.0/0, 0.0.0.0/1, 128.0.0.0/1, etc. Maximum IPs in a range should be less than 256 and total IPs including all ranges should be less than 2048. To modify - Azure Portal --> Resource --> Firewall. Turn 'ON' - 'Enable IP Access Control' and add/or remove IP addresses and/or ranges and save. Note: In case the IP range is indeterminate (for instance, if the client is a PaaS endpoint), you may need to attest this control.",
          "severity": "High",
          "jsonPath": [ "$.properties.ipRangeFilter" ],
          "matchType": "VerifiableSingleToken",
          "data": {}
        },
        {
          "id": "CosmosDb130",
          "controlId": "Azure_CosmosDB_Config_Default_Consistency",
          "isEnabled": true,
          "description": "Do not use 'Eventual' consistency",
          "rationale": "",
          "recommendation": "Using Eventual consistency might cause undesired effects due to its ordering guarantees. To modify - Azure Portal --> Resource --> Default consistency. Select 'Session' and save. Refer: https://docs.microsoft.com/en-in/azure/cosmos-db/consistency-levels",
          "severity": "High",
          "jsonPath": [ "$.properties.consistencyPolicy.defaultConsistencyLevel" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "NotAllow",
            "value": "Eventual",
            "isCaseSensitive": false
          }
        },
        {
          "id": "CosmosDb140",
          "controlId": "Azure_CosmosDB_Deploy_Use_Replication",
          "isEnabled": true,
          "description": "Use global replication",
          "rationale": "",
          "recommendation": "Replication ensures the continuity and rapid recovery during disasters. To add - Azure Portal --> Resource -> Replicate data globally. Select a secondary read region and save. Refer: https://docs.microsoft.com/en-in/azure/cosmos-db/distribute-data-globally",
          "severity": "Medium",
          "jsonPath": [ "$.properties.locations" ],
          "matchType": "ItemCount",
          "data": {
            "type": "GreaterThan",
            "value": 1
          }
        },
        {
          "id": "CosmosDb150",
          "controlId": "Azure_CosmosDB_Deploy_Use_Automatic_Failover",
          "isEnabled": true,
          "description": "Use automatic failover",
          "rationale": "",
          "recommendation": "Automatic failover ensures the continuity and auto recovery during disasters. To configure, you must have at least 1 secondary replica enabled. To enabled replica - Azure Portal --> Resource -> Replicate data globally. Select a secondary read region and save. To set automatic failover - Azure Portal --> Resource -> Replicate data globally --> Automatic Failover. Turn 'ON' - 'Enable Automatic Failover', set the priorities and click 'OK'.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.enableAutomaticFailover" ],
          "matchType": "Boolean",
          "data": { "value": true }
        }
      ]
    },
    {
      "featureName": "SqlServer",
      "supportedResourceTypes": [ "Microsoft.Sql/servers", "Microsoft.Sql/servers/databases", "Microsoft.Sql/servers/databases/transparentDataEncryption", "Microsoft.Sql/servers/databases/auditingSettings", "Microsoft.Sql/servers/auditingSettings", "Microsoft.Sql/servers/administrators", "Microsoft.Sql/servers/securityAlertPolicies", "Microsoft.Sql/servers/firewallrules" ],
      "controls": [
        {
          "id": "SQLDatabase120",
          "apiVersions": [ "2014-04-01-preview" ],
          "controlId": "Azure_SQLDatabase_AuthZ_Use_AAD_Admin",
          "isEnabled": true,
          "description": "Enable Azure AD admin for the SQL Database",
          "rationale": "",
          "recommendation": "",
          "severity": "High",
          "jsonPath": [ "$.properties.administratorType" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "ActiveDirectory",
            "isCaseSensitive": false
          }
        },
        {
          "id": "SQLDatabase160",
          "apiVersions": [ "2015-05-01-preview" ],
          "controlId": "Azure_SQLDatabase_Audit_Enable_Threat_Detection_Server",
          "isEnabled": true,
          "description": "Enable SQL Server threat detection with email admins option. Do not exclude any detection types",
          "rationale": "",
          "recommendation": "",
          "severity": "High",
          "jsonPath": [ "$.properties.state" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "Enabled",
            "isCaseSensitive": false
          }
        },
        {
          "id": "SQLDatabase160",
          "apiVersions": [ "2015-05-01-preview" ],
          "controlId": "Azure_SQLDatabase_Audit_Enable_Threat_Detection_Server",
          "isEnabled": true,
          "description": "Enable SQL Server threat detection with email admins option. Do not exclude any detection types",
          "rationale": "",
          "recommendation": "",
          "severity": "High",
          "jsonPath": [ "$.properties.emailAccountAdmins" ],
          "matchType": "Boolean",
          "data": { "value": true }
        },
        {
          "id": "SQLDatabase160",
          "apiVersions": [ "2015-05-01-preview" ],
          "controlId": "Azure_SQLDatabase_Audit_Enable_Threat_Detection_Server",
          "isEnabled": true,
          "description": "Enable SQL Server threat detection with email admins option. Do not exclude any detection types",
          "rationale": "",
          "recommendation": "",
          "severity": "High",
          "jsonPath": [ "$.properties.emailAddresses" ],
          "matchType": "StringWhitespace",
          "data": {
            "value": false
          }
        },
        {
          "id": "SQLDatabase160",
          "apiVersions": [ "2015-05-01-preview" ],
          "controlId": "Azure_SQLDatabase_Audit_Enable_Threat_Detection_Server",
          "isEnabled": true,
          "description": "Enable SQL Server threat detection with email admins option. Do not exclude any detection types",
          "rationale": "",
          "recommendation": "",
          "severity": "High",
          "jsonPath": [ "$.properties.disabledAlerts" ],
          "matchType": "StringWhitespace",
          "data": {
            "value": true
          }
        },
        {
          "id": "SQLDatabase150",
          "apiVersions": [ "2014-04-01-preview" ],
          "controlId": "Azure_SQLDatabase_DP_Enable_TDE",
          "isEnabled": true,
          "description": "Transparent data encryption (TDE) must be enabled",
          "rationale": "",
          "recommendation": "",
          "severity": "High",
          "jsonPath": [ "$.properties.status" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "Enabled",
            "isCaseSensitive": false
          }
        }
 
      ]
    },
    {
      "featureName": "Storage",
      "supportedResourceTypes": [ "Microsoft.Storage/storageAccounts", "Microsoft.Storage/storageAccounts/blobServices" ],
      "controls": [
        {
          "id": "AzureStorage160",
          "controlId": "Azure_Storage_DP_Encrypt_In_Transit",
          "isEnabled": true,
          "description": "HTTPS protocol must be used for accessing Storage Account resources",
          "rationale": "Use of HTTPS ensures server/service authentication and protects data in transit from network layer man-in-the-middle, eavesdropping, session-hijacking attacks. When enabling HTTPS one must remember to simultaneously disable access over plain HTTP else data can still be subject to compromise over clear text connections.",
          "recommendation": "Run command 'Set-AzStorageAccount -ResourceGroupName <RGName> -Name <StorageAccountName> -EnableHttpsTrafficOnly `$true'. Run 'Get-Help Set-AzStorageAccount -full' for more help.",
          "severity": "High",
          "jsonPath": [ "$.properties.supportsHttpsTrafficOnly" ],
          "matchType": "Boolean",
          "data": { "value": true }
        },
        {
          "id": "AzureStorage250",
          "controlId": "Azure_Storage_DP_Restrict_CORS_Access",
          "isEnabled": false,
          "description": "Ensure that CORS access is granted to a minimal set of trusted origins and only required verbs are supported.",
          "rationale": "CORS enables applications running under one domain to access a resource under another domain. Using '*' (allow all) for CORS setting means that an application running under any domain can have access to your application's resources and data. Restricting allowed origins to the specific set that needs access aligns with the principle of least privilege.",
          "recommendation": "Go to Azure Portal --> your Storage service --> Settings --> CORS --> for each of the Storage services i.e. Blob/File/Table/Queue --> Add --> Provide the specific domain names and other CORS details that should be allowed to make cross-origin calls. Note: No action is needed if you are not using CORS for your service.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.cors.corsRules" ],
          "matchType": "ItemCount",
          "data": {
            "type": "Equals",
            "value": 0
          }
        },
        {
          "id": "AzureStorage270",
          "controlId": "Azure_Storage_BCDR_Enable_Soft_Delete",
          "isEnabled": true,
          "description": "Soft delete should be enabled to allow recovery of deleted blobs or blob snapshots",
          "rationale": "Enabling soft delete feature on Storage acts as a safety measure to recover inadvertently or maliciously deleted blobs or blob snapshots. If your data is critical, this can be a valuable BC/DR mechanism.",
          "recommendation": "Refer: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-soft-delete to enable soft delete feature on Storage.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.deleteRetentionPolicy.enabled" ],
          "matchType": "VerifiableBooleanSingleToken",
          "data": {
            "value": "true",
            "Type": "",
            "IfNoPropertyFound": "Verify",
            "ControlDesiredState": "Passed"
          }
        },
        {
          "id": "AzureStorage260",
          "controlId": "Azure_Storage_AuthZ_Restrict_Network_Access",
          "isEnabled": false,
          "description": "Ensure that Firewall and Virtual Network access is granted to a minimal set of trusted origins",
          "rationale": "Restricting access using firewall/virtual network config reduces network exposure of a storage account by limiting access only to expected range/set of clients. Note that this depends on the overall service architecture and may not be possible to implement in all scenarios.",
          "recommendation": "Go to Azure Portal --> your Storage service --> Settings --> Firewalls and virtual networks --> Selected Network. Provide the specific IP address and Virtual Network details that should be allowed to access storage account.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.networkAcls.defaultAction" ],
          "matchType": "MatchStringSingleToken",
          "data": {
            "value": "Allow",
            "Type": "Allow",
            "IfNoPropertyFound": "Verify",
            "ControlDesiredState": "Verify"
          }
        }
      ]
    },
    {
      "featureName": "AppService",
      "supportedResourceTypes": [ "Microsoft.Web/sites", "Microsoft.Web/serverfarms", "Microsoft.Web/sites/config" ],
      "controls": [
        {
          "id": "AppService270",
          "apiVersions": [ "2016-09-01" ],
          "controlId": "Azure_AppService_BCDR_Use_Multiple_Instances",
          "isEnabled": true,
          "description": "App Service must be deployed on a minimum of two instances to ensure availability",
          "rationale": "App Service deployed on multiple instances ensures that the App Service remains available even if an instance is down.",
          "recommendation": "Run command 'Set-AzAppServicePlan -Name '<AppServicePlanName>' -ResourceGroupName '<RGName>' -NumberofWorkers '<NumberofInstances>''. Run 'Get-Help Set-AzAppServicePlan -full' for more help.",
          "severity": "Medium",
          "jsonPath": [ "$.sku.capacity" ],
          "matchType": "IntegerValue",
          "data": {
            "type": "GreaterThan",
            "value": 1
          }
        },
        {
          "id": "AppService210",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_Config_Disable_Remote_Debugging",
          "isEnabled": true,
          "description": "Remote debugging must be turned off for App Service",
          "rationale": "Remote debugging requires inbound ports to be opened on App Service. These ports become easy targets for compromise from various internet based attacks.",
          "recommendation": "Go to Azure Portal --> your App Service --> Settings --> Application Settings --> Remote Debugging --> Click on 'OFF'.",
          "severity": "High",
          "jsonPath": [ "$.properties.siteConfig.remoteDebuggingEnabled", "$.properties.remoteDebuggingEnabled" ],
          "matchType": "Boolean",
          "data": { "value": false }
        },
        {
          "id": "AppService220",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_Config_Disable_Web_Sockets",
          "isEnabled": true,
          "description": "Web Sockets should be disabled for App Service",
          "rationale": "",
          "recommendation": "Run command 'Set-AzWebApp -Name '<WebAppName>' -ResourceGroupName '<RGName>' -WebSocketsEnabled `$false'. Run 'Get-Help Set-AzWebApp -full' for more help. Refer: https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/HTML5_Security_Cheat_Sheet.md#websockets",
          "severity": "High",
          "jsonPath": [ "$.properties.siteConfig.webSocketsEnabled", "$.properties.webSocketsEnabled" ],
          "matchType": "Boolean",
          "data": { "value": false }
        },
        {
          "id": "AppService230",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_BCDR_Use_AlwaysOn",
          "isEnabled": true,
          "description": "'Always On' should be configured for App Service",
          "rationale": "By default, websites are unloaded if they have been idle for some period of time. However, this may not be ideal for 'high availability' requirements. Configuring 'Always On' can help prevent app services from getting timed out.",
          "recommendation": "Go to Azure Portal --> your App Service --> Settings --> Application Settings --> Always On --> Click on 'ON'.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.siteConfig.alwaysOn", "$.properties.alwaysOn" ],
          "matchType": "Boolean",
          "data": { "value": true }
        },
        {
          "id": "AppService240",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_Deploy_Use_Latest_Version",
          "isEnabled": true,
          "description": "The latest version of .NET framework version should be used for App Service",
          "rationale": "",
          "recommendation": "Run command 'Set-AzWebApp -Name '<WebAppName>' -ResourceGroupName '<RGName>' -NetFrameworkVersion 'v4.7''. Run 'Get-Help Set-AzWebApp -full' for more help.",
          "severity": "Low",
          "jsonPath": [ "$.properties.siteConfig.netFrameworkVersion", "$.properties.netFrameworkVersion" ],
          "matchType": "RegExpressionSingleToken",
          "data": {
            "type": "Allow",
            "pattern": "^(v4.0|v4.7)$",
            "isCaseSensitive": false
          }
        },
        {
          "id": "AppService290",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_Audit_Enable_Logging_and_Monitoring",
          "isEnabled": true,
          "description": "Auditing and Monitoring must be enabled for App Service",
          "rationale": "Auditing enables log collection of important system events pertinent to security. Regular monitoring of audit logs can help to detect any suspicious and malicious activity early and respond in a timely manner.",
          "recommendation": "Run command 'Set-AzWebApp -Name '<WebAppName>' -ResourceGroupName '<RGName>' -DetailedErrorLoggingEnabled `$true -HttpLoggingEnabled `$true -RequestTracingEnabled `$true'. Run 'Get-Help Set-AzWebApp -full' for more help.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.siteConfig.requestTracingEnabled", "$.properties.requestTracingEnabled" ],
          "matchType": "Boolean",
          "data": { "value": true }
        },
        {
          "id": "AppService290",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_Audit_Enable_Logging_and_Monitoring",
          "isEnabled": true,
          "description": "Auditing and Monitoring must be enabled for App Service",
          "rationale": "Auditing enables log collection of important system events pertinent to security. Regular monitoring of audit logs can help to detect any suspicious and malicious activity early and respond in a timely manner.",
          "recommendation": "Run command 'Set-AzWebApp -Name '<WebAppName>' -ResourceGroupName '<RGName>' -DetailedErrorLoggingEnabled `$true -HttpLoggingEnabled `$true -RequestTracingEnabled `$true'. Run 'Get-Help Set-AzWebApp -full' for more help.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.siteConfig.httpLoggingEnabled", "$.properties.httpLoggingEnabled" ],
          "matchType": "Boolean",
          "data": { "value": true }
        },
        {
          "id": "AppService290",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_Audit_Enable_Logging_and_Monitoring",
          "isEnabled": true,
          "description": "Auditing and Monitoring must be enabled for App Service",
          "rationale": "Auditing enables log collection of important system events pertinent to security. Regular monitoring of audit logs can help to detect any suspicious and malicious activity early and respond in a timely manner.",
          "recommendation": "Run command 'Set-AzWebApp -Name '<WebAppName>' -ResourceGroupName '<RGName>' -DetailedErrorLoggingEnabled `$true -HttpLoggingEnabled `$true -RequestTracingEnabled `$true'. Run 'Get-Help Set-AzWebApp -full' for more help.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.siteConfig.detailedErrorLoggingEnabled", "$.properties.detailedErrorLoggingEnabled" ],
          "matchType": "Boolean",
          "data": { "value": true }
        },
        {
          "id": "AppService310",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_DP_Dont_Allow_HTTP_Access",
          "isEnabled": true,
          "description": "App Service must only be accessible over HTTPS",
          "rationale": "Use of HTTPS ensures server/service authentication and protects data in transit from network layer eavesdropping attacks.",
          "recommendation": "",
          "severity": "High",
          "jsonPath": [ "$.properties.httpsOnly" ],
          "matchType": "Boolean",
          "data": {
            "value": true
          }
        },
        {
          "id": "AppService130",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_AuthN_Use_AAD_for_Client_AuthN",
          "isEnabled": true,
          "description": "App Service must authenticate users using Azure Active Directory backed credentials",
          "rationale": "Using the native enterprise directory for authentication ensures that there is a built-in high level of assurance in the user identity established for subsequent access control.All Enterprise subscriptions are automatically associated with their enterprise directory (xxx.onmicrosoft.com) and users in the native directory are trusted for authentication to enterprise subscriptions.",
          "recommendation": "",
          "severity": "High",
          "jsonPath": [ "$.properties.siteConfig.siteAuthEnabled", "$.properties.siteAuthEnabled" ],
          "matchType": "Boolean",
          "data": {
            "value": true
          }
        },
        {
          "id": "AppService130",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_AuthN_Use_AAD_for_Client_AuthN",
          "isEnabled": true,
          "description": "App Service must authenticate users using Azure Active Directory backed credentials",
          "rationale": "Using the native enterprise directory for authentication ensures that there is a built-in high level of assurance in the user identity established for subsequent access control.All Enterprise subscriptions are automatically associated with their enterprise directory (xxx.onmicrosoft.com) and users in the native directory are trusted for authentication to enterprise subscriptions.",
          "recommendation": "",
          "severity": "High",
          "jsonPath": [ "$.properties.siteConfig.siteAuthSettings.clientId", "$.properties.siteAuthSettings.clientId" ],
          "matchType": "StringWhitespace",
          "data": {
            "value": false
          }
 
        },
        {
          "id": "AppService400",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_AuthN_Use_Managed_Service_Identity",
          "isEnabled": true,
          "description": "Use Managed Service Identity (MSI) for accessing other AAD-protected resources from the app service.",
          "rationale": "Managed Service Identity (MSI) allows your app to easily access other AAD-protected resources such as Azure Key Vault. The identity is managed by the Azure platform and eliminates the need to provision/manage/rotate any secrets thus reducing the overall risk.",
          "recommendation": "Go to Azure Portal --> your App Service --> Settings --> Managed Service Identity --> Register with AAD --> ON",
          "severity": "Medium",
          "jsonPath": [ "$.identity.type" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "SystemAssigned",
            "isCaseSensitive": false
          }
        },
        {
          "id": "AppService420",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_DP_Use_Secure_TLS_Version",
          "isEnabled": true,
          "description": "Use approved version of TLS for the App Service",
          "rationale": "TLS provides privacy and data integrity between client and server. Using approved TLS version significantly reduces risks from security design issues and security bugs that may be present in older versions.",
          "recommendation": "Go to Azure Portal --> your App Service --> Settings --> TLS/SSL --> Minimum TLS version --> set to org approved version (see detailed logs).",
          "severity": "High",
          "jsonPath": [ "$.properties.siteConfig.minTlsVersion", "$.properties.minTlsVersion" ],
          "matchType": "VersionSingleToken",
          "data": {
            "type": "GreaterThanOrEqual",
            "value": "1.2",
            "isCaseSensitive": false
          }
        },
        {
          "id": "AppService450",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_DP_Review_CORS_Request_Credential",
          "isEnabled": true,
          "description": "Review use of credentials in CORS request for App Service",
          "rationale": "CORS enables applications running under one domain to access a resource under another domain. Allowing cross-origin credentials is a security risk. A website at another domain can send a signed-in user's credentials to the app on the user's behalf without the user's knowledge.",
          "recommendation": "Go to Azure Portal --> your App Service --> API --> CORS --> Request Credentials --> Review if you need to enable 'Access-Control-Allow-Credentials'. Note: No action is needed if you are not using CORS for your app.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.siteConfig.cors.supportCredentials", "$.properties.cors.supportCredentials" ],
          "matchType": "VerifiableBooleanSingleToken",
          "data": {
            "value": "false",
            "Type": "",
            "IfNoPropertyFound": "Passed",
            "ControlDesiredState": "Passed"
          }
        },
 
        {
          "id": "AppService380",
          "apiVersions": [ "2016-08-01" ],
          "controlId": "Azure_AppService_DP_Restrict_CORS_Access",
          "isEnabled": false,
          "description": "Ensure that CORS access is granted to a limited set of trusted origins.",
          "rationale": "CORS enables applications running under one domain to access a resource under another domain. Using '*' (allow all) for CORS setting means that an application running under any domain can have access to your application's resources and data. Restricting allowed origins to the specific set that needs access aligns with the principle of least privilege.",
          "recommendation": "Go to Azure Portal --> your App Service --> API --> CORS --> Provide the specific domain names that should be allowed to make cross-origin calls. Note: No action is needed if you are not using CORS for your app.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.siteConfig.cors.allowedOrigins", "$.properties.cors.allowedOrigins" ],
          "matchType": "VerifiableItemCount",
          "data": {
            "type": "All",
            "value": 0,
            "IfNoPropertyFound": "Verify"
          }
        }
      ]
    },
    {
      "featureName": "KubernetesService",
      "supportedResourceTypes": [ "Microsoft.ContainerService/ManagedClusters" ],
      "controls": [
        {
          "id": "KubernetesService150",
          "controlId": "Azure_KubernetesService_Deploy_Use_Latest_Version",
          "isEnabled": true,
          "description": "The latest version of Kubernetes should be used",
          "rationale": "Running on older versions could mean you are not using latest security classes. Usage of such old classes and types can make your application vulnerable.",
          "recommendation": "Refer: https://docs.microsoft.com/en-us/azure/aks/upgrade-cluster.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.kubernetesVersion" ],
          "matchType": "VersionSingleToken",
          "data": {
            "type": "GreaterThanOrEqual",
            "value": "1.14.6",
            "isCaseSensitive": false
          }
        },
        {
          "id": "KubernetesService120",
          "controlId": "Azure_KubernetesService_AuthN_Enabled_AAD",
          "isEnabled": true,
          "description": "AAD should be enabled in Kubernetes Service",
          "rationale": "Using the native enterprise directory for authentication ensures that there is a built-in high level of assurance in the user identity established for subsequent access control.All Enterprise subscriptions are automatically associated with their enterprise directory (xxx.onmicrosoft.com) and users in the native directory are trusted for authentication to enterprise subscriptions.",
          "recommendation": "Refer: https://docs.microsoft.com/en-us/azure/aks/aad-integration to configure AAD in Kubernetes Service.",
          "severity": "High",
          "jsonPath": [ "$.properties.aadProfile" ],
          "matchType": "ItemCount",
          "data": {
            "type": "GreaterThan",
            "value": 1
          }
        },
        {
          "id": "KubernetesService110",
          "controlId": "Azure_KubernetesService_Deploy_Enable_Cluster_RBAC",
          "isEnabled": true,
          "description": "Cluster RBAC must be enabled in Kubernetes Service",
          "rationale": "Enabling RBAC in a cluster lets you finely control access to various operations at the cluster/node/pod/namespace scopes for different stakeholders. Without RBAC enabled, every user has full access to the cluster which is a violation of the principle of least privilege. Note that Azure Kubernetes Service does not currently support other mechanisms to define authorization in Kubernetes (such as Attribute-based Access Control authorization or Node authorization).",
          "recommendation": "RBAC flag must be enabled while creating the Kubernetes Service. Existing non-RBAC enabled Kubernetes Service clusters cannot currently be updated for RBAC use. Refer: https://docs.microsoft.com/en-us/azure/aks/aad-integration.",
          "severity": "High",
          "jsonPath": [ "$.properties.enableRBAC" ],
          "matchType": "Boolean",
          "data": {
            "value": true
          }
        },
        {
          "id": "KubernetesService220",
          "controlId": "Azure_KubernetesService_Audit_Enable_Monitoring",
          "isEnabled": true,
          "description": "Monitoring must be enabled for Azure Kubernetes Service",
          "rationale": "Auditing enables log collection of important system events pertinent to security. Regular monitoring of audit logs can help to detect any suspicious and malicious activity early and respond in a timely manner.",
          "recommendation": "Refer: https://docs.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-overview.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.addonProfiles.omsagent.enabled" ],
          "matchType": "Boolean",
          "data": {
            "value": true
          }
        }
      ]
    },
    {
      "featureName": "LogicApps",
      "supportedResourceTypes": [ "Microsoft.Logic/workflows" ],
      "controls": [
        {
          "id": "LogicApps150",
          "controlId": "Azure_LogicApps_AuthZ_Provide_Triggers_Access_Control",
          "isEnabled": true,
          "description": "If Logic App fires on an HTTP Request (e.g. Request or Webhook) then provide IP ranges for triggers to prevent unauthorized access",
          "rationale": "Specifying the IP range ensures that the triggers can be invoked only from a restricted set of endpoints.",
          "recommendation": "Do not add IP range $($this.ControlSettings.UniversalIPRange) as this means access to all IPs. Note: In case the IP range is indeterminate (for instance, if the client is a PaaS endpoint), you may need to attest this control. Please refer https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-securing-a-logic-app#set-ip-ranges---logic-app-deployment-template",
          "severity": "High",
          "jsonPath": [ "$.properties.accessControl.triggers.allowedCallerIpAddresses.addressRange" ],
          "matchType": "VerifiableSingleToken",
          "data": {}
        },
        {
          "id": "LogicApps160",
          "controlId": "Azure_LogicApps_AuthZ_Provide_Contents_Access_Control",
          "isEnabled": true,
          "description": "Must provide IP ranges for contents to prevent unauthorized access to inputs/outputs data of Logic App run history",
          "rationale": "Using the firewall feature ensures that access to the data or the service is restricted to a specific set/group of clients. While this may not be feasible in all scenarios, when it can be used, it provides an extra layer of access control protection for critical assets.",
          "recommendation": "Do not add IP range $($this.ControlSettings.UniversalIPRange) as this means access to all IPs. Note: In case the IP range is indeterminate (for instance, if the client is a PaaS endpoint), you may need to attest this control. Please refer https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-securing-a-logic-app#set-ip-ranges---logic-app-deployment-template-1",
          "severity": "High",
          "jsonPath": [ "$.properties.accessControl.contents.allowedCallerIpAddresses.addressRange" ],
          "matchType": "VerifiableSingleToken",
          "data": {}
        }
      ]
    },
    {
      "featureName": "ContainerRegistry",
      "supportedResourceTypes": [ "Microsoft.ContainerRegistry/registries","Microsoft.ContainerRegistry/registries/webhooks" ],
      "controls": [
        {
          "id": "ContainerRegistry110",
          "controlId": "Azure_ContainerRegistry_AuthZ_Disable_Admin_Account",
          "isEnabled": true,
          "description": "The Admin account in Container Registry should be disabled",
          "rationale": "The Admin user account is designed for a single user to access the registry. Multiple users authenticating with the admin account appear as just one user to the registry. This leads to loss of auditability. Using AAD-based identity ensures that there is a built-in high level of assurance in the user identity established for subsequent access control.",
          "recommendation": "Run command 'Update-AzContainerRegistry -DisableAdminUser -Name '<ContainerRegistryName>' -ResourceGroupName '<RGName>'. Run 'Get-Help Update-AzContainerRegistry -full' for more help. You can add AAD-based SPNs or user accounts to the appropriate RBAC role instead.",
          "severity": "High",
          "jsonPath": [ "$.properties.adminUserEnabled" ],
          "matchType": "Boolean",
          "data": {
            "value": false
          }
        },
        {
          "id": "ContainerRegistry150",
          "controlId": "Azure_ContainerRegistry_Configure_Webhook_For_Vuln_Scan",
          "isEnabled": true,
          "description": "Image vulnerability scan should be configured through webhook when images are pushed to Container Registry",
          "rationale": "Container image(s) having vulnerabilities (e.g., missing OS patches in base image, open ports, etc.) can lead to attacks and subsequent loss of sensitive enterprise data.",
          "recommendation": "Configure a vulnerability scanner using guidance here: https://github.com/Azure/acr/blob/master/docs/acr-roadmap.md#vulnerability-scanning-integration, https://docs.microsoft.com/en-in/azure/container-registry/container-registry-webhook",
          "severity": "Medium",
          "jsonPath": [
            "$.type"
          ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "Microsoft.ContainerRegistry/registries/webhooks",
            "isCaseSensitive": false
          }
        },
        {
          "id": "ContainerRegistry170",
          "controlId": "Azure_ContainerRegistry_DP_Enable_Content_Trust",
          "isEnabled": true,
          "description": "Content trust must be enabled for the Container Registry",
          "rationale": "Content trust gives the ability to verify both the integrity and the publisher of all the image content received from a registry over any channel. If a container image is served from an untrusted registry, the image itself may not be trustworthy/stable. Running such a compromised image can lead to loss of sensitive enterprise data.",
          "recommendation": "Go to Azure Portal --> your Container Registry --> Content Trust --> Enabled. This feature is currently available only in Premium SKU. After enabling Content Trust, push only trusted images in the repositories. Refer: https://aka.ms/acr/content-trust.",
          "severity": "Medium",
          "jsonPath": [
            "$.properties.policies.trustPolicy.status"
          ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "enabled",
            "isCaseSensitive": false
          }
        }
      ]
    },
    {
      "featureName": "KeyVault",
      "supportedResourceTypes": [ "Microsoft.KeyVault/vaults" ],
      "controls": [
        {
          "id": "KeyVault140",
          "controlId": "Azure_KeyVault_AuthZ_Grant_Min_Access_policies",
          "isEnabled": true,
          "Description": "All Key Vault access policies must be defined with minimum required permissions to keys and secrets",
          "Rationale": "Granting minimum access by defining Key Vault access policies ensures that applications/users are granted just enough permissions to perform their tasks. This minimizes exposure of the resources in case of user/service account compromise.",
          "Recommendation": "Use command Set-AzKeyVaultAccessPolicy -VaultName '{VaultName}' -ResourceGroupName '{ResourceGroupName}' -PermissionsToKeys '{PermissionsToKeys}' -PermissionsToSecrets '{PermissionsToSecrets}' -PermissionsToCertificates '{PermissionsToCertificates}' -ObjectId '{ObjectId}'. Refer: https://docs.microsoft.com/en-us/powershell/module/az.keyvault/Set-AzKeyVaultAccessPolicy",
          "severity": "High",
          "jsonPath": [ "$.properties.accessPolicies" ],
          "matchType": "VerifiableSingleToken",
          "data": {}
        },
        {
          "id": "KeyVault150",
          "controlId": "Azure_KeyVault_AuthZ_Configure_Advanced_Access_Policies",
          "isEnabled": true,
          "Description": "Advanced access policies must be configured on a need basis",
          "Rationale": "Advanced access policy allows Azure services (Azure Resource Manager, Virtual Machine, Disk Encryption etc.) to seamlessly access Key Vault. To avoid unintentional access to Key Vault from Azure services, advanced access policies must be configured only as required.",
          "Recommendation": "Remove any advanced policies that are not required using the command: Remove-AzKeyVaultAccessPolicy -VaultName '{VaultName}' -ResourceGroupName '{ResourceGroupName}' -EnabledForDeployment -EnabledForTemplateDeployment -EnabledForDiskEncryption. Refer: https://docs.microsoft.com/en-us/powershell/module/az.keyvault/Remove-AzKeyVaultAccessPolicy",
          "severity": "Medium",
          "jsonPath": [ "$.properties.enabledForDeployment" ],
          "matchType": "Boolean",
          "data": {
            "value": false
          }
        },
        {
          "id": "KeyVault150",
          "controlId": "Azure_KeyVault_AuthZ_Configure_Advanced_Access_Policies",
          "isEnabled": true,
          "Description": "Advanced access policies must be configured on a need basis",
          "Rationale": "Advanced access policy allows Azure services (Azure Resource Manager, Virtual Machine, Disk Encryption etc.) to seamlessly access Key Vault. To avoid unintentional access to Key Vault from Azure services, advanced access policies must be configured only as required.",
          "Recommendation": "Remove any advanced policies that are not required using the command: Remove-AzKeyVaultAccessPolicy -VaultName '{VaultName}' -ResourceGroupName '{ResourceGroupName}' -EnabledForDeployment -EnabledForTemplateDeployment -EnabledForDiskEncryption. Refer: https://docs.microsoft.com/en-us/powershell/module/az.keyvault/Remove-AzKeyVaultAccessPolicy",
          "severity": "Medium",
          "jsonPath": [ "$.properties.enabledForDiskEncryption" ],
          "matchType": "Boolean",
          "data": {
            "value": false
          }
        },
        {
          "id": "KeyVault150",
          "controlId": "Azure_KeyVault_AuthZ_Configure_Advanced_Access_Policies",
          "isEnabled": true,
          "Description": "Advanced access policies must be configured on a need basis",
          "Rationale": "Advanced access policy allows Azure services (Azure Resource Manager, Virtual Machine, Disk Encryption etc.) to seamlessly access Key Vault. To avoid unintentional access to Key Vault from Azure services, advanced access policies must be configured only as required.",
          "Recommendation": "Remove any advanced policies that are not required using the command: Remove-AzKeyVaultAccessPolicy -VaultName '{VaultName}' -ResourceGroupName '{ResourceGroupName}' -EnabledForDeployment -EnabledForTemplateDeployment -EnabledForDiskEncryption. Refer: https://docs.microsoft.com/en-us/powershell/module/az.keyvault/Remove-AzKeyVaultAccessPolicy",
          "severity": "Medium",
          "jsonPath": [ "$.properties.enabledForTemplateDeployment" ],
          "matchType": "Boolean",
          "data": {
            "value": false
          }
 
        },
        {
          "id": "KeyVault230",
          "controlId": "Azure_KeyVault_SI_Enable_SoftDelete",
          "isEnabled": true,
          "Description": "Soft delete must be enabled to allow recovery of deleted Key Vault and any objects (keys, secrets, etc.) contained in it.",
          "Rationale": "Enabling soft delete feature on Key Vault acts as a safety measure to recover inadvertently or maliciously deleted Key Vault and any objects (keys, secrets, etc.) contained in it.",
          "Recommendation": "Refer: https://docs.microsoft.com/en-us/azure/key-vault/key-vault-soft-delete-powershell to enable soft delete feature on Key Vault.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.enableSoftDelete" ],
          "matchType": "Boolean",
          "data": {
            "value": true
          }
        }
      ]
    },
    {
      "featureName": "VirtualNetworkInterface",
      "supportedResourceTypes": [ "Microsoft.Network/networkInterfaces"],
      "controls": [
        {
          "id": "VirtualNetwork120",
          "controlId": "Azure_VNet_NetSec_Justify_IPForwarding_for_NICs",
          "isEnabled": true,
          "Description": "Use of IP Forwarding on any NIC in a virtual network should be scrutinized",
          "Rationale": "Enabling IP Forwarding on a VM NIC allows the VM to receive traffic addressed to other destinations. IP forwarding is required only in rare scenarios (e.g., using the VM as a network virtual appliance) and those should be reviewed with the network security team.",
          "Recommendation": "Disable IP Forwarding unless it has been reviewed and approved by network security team. Go to Azure Portal --> Navigate to VM NIC (where IP Forwarding is enabled) --> IP Configurations --> IP Forwarding settings --> Click on 'Disabled'.",
          "Severity": "High",
          "jsonPath": [ "$.properties.enableIPForwarding" ],
          "matchType": "Boolean",
          "data": {
            "value": false
          }
        },
        {
          "id": "VirtualNetwork130",
          "controlId": "Azure_VNet_NetSec_Configure_NSG",
          "isEnabled": true,
          "Description": "NSG should be used for subnets in a virtual network to permit traffic only on required inbound/outbound ports. NSGs should not have a rule to allow any-to-any traffic",
          "Rationale": "Restricting inbound and outbound traffic via NSGs limits the network exposure of the subnets within a virtual network and limits the attack surface.",
          "Recommendation": "Configure NSG rules to be as restrictive as possible via: (a) Azure Portal -> Network security groups -> <Your NSG> -> Inbound security rules -> Edit 'Allow' action rules. (b) Azure Portal -> Network security groups. -> <Your NSG> -> Outbound security rules -> Edit 'Allow' action rules.",
          "Severity": "Medium",
          "jsonPath": [ "$.properties.networkSecurityGroup.id" ],
          "matchType": "StringWhitespace",
          "data": {
            "value": false
          }
        }
      ]
    },
    {
      "featureName": "VirtualNetwork",
      "supportedResourceTypes": ["Microsoft.Network/virtualNetworks" ],
      "controls": [
        {
          "id": "VirtualNetwork130",
          "controlId": "Azure_VNet_NetSec_Justify_Peering",
          "isEnabled": true,
          "Description": "Use of any virtual network peerings should be justified",
          "Rationale": "Resources in the peered virtual networks can communicate with each other directly. If the two peered networks are on different sides of a security boundary (e.g., corpnet v. private vNet), this can lead to exposure of corporate data. Hence any VNet peerings should be closely scrutinized and approved by the network security team",
          "Recommendation": "You can remove any virtual network peerings using the Remove-AzVirtualNetworkPeering command (unless their presence has been approved by network security team). Run 'Get-Help Remove-AzVirtualNetworkPeering -full' for more help.",
          "Severity": "High",
          "jsonPath": [ "$.properties.virtualNetworkPeerings" ],
          "matchType": "ItemCount",
          "data": {
              "type": "Equals",
              "value": 0
          }
        }
      ]
    },
    {
      "featureName": "ContainerInstances",
      "supportedResourceTypes": [ "Microsoft.ContainerInstance/containerGroups" ],
      "controls": [
          {
              "Id": "ContainerInstances110",
              "ControlID": "Azure_ContainerInstances_NetSec_Justify_PublicIP_and_Ports",
              "isEnabled": true,
              "Description": "Use of public IP address and ports should be carefully reviewed",
              "Rationale": "Public IP address provides direct access over the internet exposing the container to all type of attacks over the public network.",
              "Recommendation": "Add public IP address and ports to a container only as required. Ensure that the resulting data flows are carefully reviewed.",
              "Severity": "High",
              "jsonPath": [ "$.properties.ipAddress" ],
              "matchType": "NullableSingleToken",
              "data": {}
          },
          {
              "Id": "ContainerInstances140",
              "ControlID": "Azure_ContainerInstances_AuthZ_Container_Segregation",
              "isEnabled": true,
              "Description": "A container group must contain only containers which trust each other",
              "Rationale": "Containers hosted in the same container group can monitor traffic of other containers within the group and can also access the file system of the host OS. Hence a container group must not host containers which do not trust each other. In other words, do not mix containers across trust boundaries in the same group.",
              "Recommendation": "Carefully review the role and privileges required by each container in a container group. If the privilege levels and access requirements are different, then consider segregating the containers into separate groups.",
              "Severity": "High",
              "jsonPath": [ "$.properties.containers" ],
              "matchType": "ItemCount",
              "data": {
                  "type": "LesserThan",
                  "value": 2
              }
          }
      ]
    },
    {
      "featureName": "EventHub",
      "supportedResourceTypes": [ "Microsoft.EventHub/namespaces","Microsoft.EventHub/namespaces/AuthorizationRules","Microsoft.EventHub/namespaces/eventhubs/authorizationRules" ],
      "controls": [
        {
          "ControlID": "Azure_EventHub_AuthZ_Use_Min_Permissions_Access_Policies",
          "Description": "Access policies must be defined with minimum required permissions to the Event Hub",
          "Id": "EventHub140",
          "ControlSeverity": "Medium",
          "Automated": "Yes",
          "MethodName": "CheckEventHubAuthorizationRule",
          "Rationale": "Granting minimum access ensures that users are granted just enough permissions to perform their tasks. This minimizes the set of operations that can be preformed on the resource by an attacker in case of access policy key compromise.",
          "Recommendation": "Ensure that client apps use shared access policies with the least required privilege and at the Event Hub scope. For instance, if the client app is only reading events from the event hub (as opposed to sending), then the policy used must only include the 'Listen' claim. Refer: https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-authentication-and-security-model-overview",
          "severity": "Medium",
          "jsonPath": [ "$.properties.rights" ],
          "matchType": "ItemCount",
          "data": {
            "type":"LesserThan",
            "value":2
          }
        }
     ]
    },
    {
      "featureName": "Search",
      "supportedResourceTypes": [ "Microsoft.Search/searchServices" ],
      "controls": [
        {
          "id": "Search170",
          "controlId": "Azure_Search_Availability_Configure_Three_Replicas",
          "isEnabled": true,
          "description": "Search service must have at least three replicas for high availability",
          "rationale": "High availability can be achieved by adding replicas. Each replica has one copy of an index, so adding one more replica translates to one more index that can be used to service query requests. Minimum of three replicas are required since the azure team has specified three to be the borderline value for the same",
          "recommendation": "Go to Azure Portal --> your Search service --> Settings --> Scale --> Replicas. Ensure that at least 3 replicas are setup.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.replicaCount" ],
          "matchType": "IntegerValue",
          "data": {
            "type": "GreaterThan",
            "value": 2
          }
        },
        {
         "id": "Search190",
          "controlId": "Azure_Search_AuthN_Use_Managed_Service_Identity",
          "isEnabled": true,
          "description": "Use Managed Service Identity (MSI) for accessing other AAD-protected resources from the search service.",
          "rationale": "Managed Service Identity (MSI) allows your app to easily access other AAD-protected resources such as Azure Key Vault. The identity is managed by the Azure platform and eliminates the need to provision/manage/rotate any secrets thus reducing the overall risk.",
          "recommendation": "Go to Azure Portal --> your Search Service --> Settings --> Identity --> Status --> ON",
          "severity": "Medium",
          "jsonPath": [ "$.identity.type" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "SystemAssigned",
            "isCaseSensitive": false
          }
        }
 
      ]
    },
    {
      "featureName": "APIManagement",
      "supportedResourceTypes": [ "Microsoft.ApiManagement/service", "Microsoft.ApiManagement/service/apis"],
      "controls": [
        {
          "id": "APIManagement220",
          "controlId": "Azure_APIManagement_NetSec_Configure_Virtual_Network_For_APIM",
          "isEnabled": true,
          "description": "Consider hosting APIM within a virtual network for improved isolation",
          "rationale": "Azure Virtual Network (VNet) deployment provides enhanced security and isolation for API management instance, as well as backend service, access control policies, and other features to further restrict access.",
          "recommendation": "Where feasible/practical, host the APIM and APIs within an isolated network. For steps to deploy Azure API Management inside a Virtual Network, refer: https://docs.microsoft.com/en-us/azure/api-management/api-management-using-with-vnet.",
          "severity": "Medium",
          "jsonPath": [ "$.properties.virtualNetworkType" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "NotAllow",
            "value": "None",
            "isCaseSensitive": false
          }
        },
        {
          "id": "APIManagement340",
          "controlId": "Azure_APIManagement_AuthN_Use_Managed_Service_Identity",
          "isEnabled": true,
          "description": "Use Managed Service Identity (MSI) for accessing other AAD-protected resources from the API management instance",
          "rationale": "Managed Service Identity (MSI) allows your API Management instance to easily access other AAD-protected resources, such as Azure Key Vault. The identity is managed by the Azure platform and eliminates the need to provision/manage/rotate any secrets thus reducing the overall risk.",
          "recommendation": "Go to Azure Portal --> your API management instance --> Settings --> Managed Service Identity --> Register with AAD --> ON",
          "severity": "Medium",
          "jsonPath": [ "$.identity.type" ],
          "matchType": "StringSingleToken",
          "data": {
            "type": "Allow",
            "value": "SystemAssigned",
            "isCaseSensitive": false
          }
        },
        {
          "id": "APIManagement140",
          "controlId": "Azure_APIManagement_DP_Use_HTTPS_URL_Scheme",
          "isEnabled": true,
          "description": "Backend API(s) must be accessible only over HTTPS via API Management service",
          "rationale": "Use of HTTPS ensures server/service authentication and protects data in transit from network layer eavesdropping attacks.",
          "recommendation": "Run command: Set-AzApiManagementApi -Context {APIContextObject} -Protocols 'Https' -Name '{APIName}' -ApiId '{APIId}' -ServiceUrl '{ServiceURL}'. Run command : Get-AzApiManagementApi -Context '{APIContextObject}' to get the details of existing APIs. Refer https://docs.microsoft.com/en-us/powershell/module/az.apimanagement/set-azapimanagementapi",
          "severity": "High",
          "jsonPath": [ "$.properties.protocols" ],
          "matchType": "StringMultiToken",
          "data": {
            "type": "Equals",
            "value": ["https"],
            "isCaseSensitive": false
          }
        }
      ]
    },
    {
      "featureName": "HDInsight",
      "supportedResourceTypes": [ "Microsoft.HDInsight/clusters" ],
      "controls": [
        {
          "id": "HDInsight110",
          "controlId": "Azure_HDInsight_Deploy_Supported_Cluster_Version",
          "isEnabled": true,
          "description": "HDInsight must have supported HDI cluster version",
          "rationale": "Being on the latest/supported HDInsight version significantly reduces risks from security bugs or updates that may be present in older or retired cluster versions.",
          "recommendation": "Refer: https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-component-versioning?#supported-hdinsight-versions https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-upgrade-cluster",
          "severity": "High",
          "jsonPath": [ "$.properties.clusterVersion" ],
          "matchType": "VersionSingleToken",
          "data": {
            "type": "GreaterThanOrEqual",
            "value": "3.6.0",
            "isCaseSensitive": false
          }
        }
      ]
    },
    {
      "featureName": "AnalysisService",
      "supportedResourceTypes": [ "Microsoft.AnalysisServices/servers" ],
      "controls": [
        {
          "id": "AnalysisServices170",
          "controlId": "Azure_AnalysisServices_BCDR_Plan",
          "isEnabled": true,
          "description": "Backup and Disaster Recovery must be planned for Analysis Services",
          "rationale": "Azure Analysis Service does not offer features to cover backup/disaster recovery out-of-the-box. As a result, when processing critical workloads, a team must have adequate backups of the data.",
          "recommendation": "Go To Azure Portal => Analysis Services => Select Analysis Service => Go To Settings => Select Backups => Select Storage account details and enable backups, Refer: https://docs.microsoft.com/en-us/azure/analysis-services/analysis-services-backup",
          "severity": "Medium",
          "jsonPath": [ "$.properties.backupBlobContainerUri" ],
          "matchType": "ItemCount",
          "data": {
            "type": "GreaterThan",
            "value": 0
          }
        },
 
        {
          "id": "AnalysisServices120",
          "controlId": "Azure_AnalysisServices_AuthZ_Min_Admin",
          "isEnabled": true,
          "description": "Backup and Disaster Recovery must be planned for Analysis Services",
          "rationale": "Analysis Service admins have full access on the server to perform any operation. Each additional person in the admin role increases the attack surface for the server. The number of members in these roles should be kept to as low as possible.",
          "recommendation": "Minimize the number of Analysis Service admins. Run command Set-AzAnalysisServicesServer -Name '{AnalysisServicesServerName}' -ResourceGroupName '{ResourceGroupName}' -Administrator '{Administrator}'. Refer: https://docs.microsoft.com/en-us/powershell/module/az.analy sisservices/Set-AzAnalysisServicesServer",
          "severity": "Medium",
          "jsonPath": [ "$.properties.asAdministrators.members" ],
          "matchType": "VerifiableItemCount",
          "data": {
            "type": "Limit",
            "value": 2
          }
        }
 
      ]
    },
 
 
    {
      "featureName": "DataBricks",
      "supportedResourceTypes": [ "Microsoft.Databricks/workspaces" ],
      "controls": [
        {
          "id": "DataBricks180",
          "controlId": "Azure_Databricks_AuthZ_Enable_Workspace_Access_Control",
          "isEnabled": true,
          "description": "Workspace access control should be enabled",
          "rationale": "Enabling workspace access control allows an admin to manage fine-grained user permissions and ensures that users can perform only intended operations. This minimizes exposure of data in case of user account compromise.",
          "recommendation": "To enable and configure workspace access control, refer: https://docs.azuredatabricks.net/administration-guide/admin-settings/workspace-acl.html",
          "severity": "Medium",
          "jsonPath": [ "$.sku.name" ],
          "matchType": "MatchStringSingleToken",
          "data": {
            "type": "Allow",
            "value": "premium",
            "isCaseSensitive": false,
            "ControlDesiredState": "Verify"
          }
        },
 
        {
          "id": "DataBricks190",
          "controlId": "Azure_Databricks_AuthZ_Enable_Cluster_Access_Control",
          "isEnabled": true,
          "description": "Cluster access control should be enabled",
          "rationale": "Enabling cluster access control allows admin to provide restricted access to user over cluster so that users can perform only intended operations. This minimizes exposure of data in case of user/service account compromise.",
          "recommendation": "To enable and configure cluster access control, refer: https://docs.azuredatabricks.net/administration-guide/admin-settings/cluster-acl.html",
          "severity": "Medium",
          "jsonPath": [ "$.sku.name" ],
          "matchType": "MatchStringSingleToken",
          "data": {
            "type": "Allow",
            "value": "premium",
            "isCaseSensitive": false,
            "ControlDesiredState": "Verify"
          }
        },
 
        {
          "id": "DataBricks200",
          "controlId": "Azure_Databricks_AuthZ_Enable_Job_Access_Control",
          "isEnabled": true,
          "description": "Job access control should be enabled",
          "rationale": "Enabling job access control ensures that users are granted just enough permissions to perform their tasks. This minimizes exposure of data in case of user/service account compromise.",
          "recommendation": "To enable and configure job access control, refer: https://docs.azuredatabricks.net/administration-guide/admin-settings/jobs-acl.html",
          "severity": "Medium",
          "jsonPath": [ "$.sku.name" ],
          "matchType": "MatchStringSingleToken",
          "data": {
            "type": "Allow",
            "value": "premium",
            "isCaseSensitive": false,
            "ControlDesiredState": "Verify"
          }
        }
 
      ]
    },
    {
      "featureName": "DBforPostgreSQL",
      "supportedResourceTypes": [ "Microsoft.DBforPostgreSQL/servers" , "Microsoft.DBforPostgreSQL/servers/configurations" , "Microsoft.DBforPostgreSQL/servers/firewallRules"],
      "controls": [
        {
          "id": "DBforPostgreSQL120",
          "controlId": "Azure_DBforPostgreSQL_AuthZ_Enable_SSL_Connection",
          "isEnabled": true,
          "description": "SSL connection must be enabled for Azure Database for PostgreSQL",
          "rationale": "Enforcing SSL connections between your database server and your client applications helps protect against 'man-in-the-middle' attacks by encrypting the data stream between the server and your application.",
          "recommendation": "To enable SSL connection for Azure Database for PostgreSQL server, refer https://docs.microsoft.com/en-us/azure/postgresql/concepts-ssl-connection-security.",
          "severity": "High",
          "jsonPath": [ "$.properties.sslEnforcement" ],
          "matchType": "MatchStringSingleToken",
          "data": {
            "value": "Enabled",
            "Type": "Allow",
            "IfNoPropertyFound": "Passed",
            "isCaseSensitive": false,
            "ControlDesiredState": "Passed"
          }
        },
        {
          "id": "DBforPostgreSQL130",
          "controlId": "Azure_DBforPostgreSQL_AuthZ_Verify_IP_Range",
          "isEnabled": true,
          "description": "Configure only the required IP addresses on PostgreSQL server. Do not use 'Any-to-Any' IP range",
          "rationale": "Using the firewall feature ensures that access to the data or the service is restricted to a specific set/group of clients. NOTE: While this control does provide an extra layer of access control protection, it may not always be feasible to implement in all scenarios.",
          "recommendation": "Do not configure 'Any to Any' firewall IP address. Refer: https://docs.microsoft.com/en-us/azure/postgresql/concepts-firewall-rules.",
          "severity": "High",
          "jsonPath": [ "$.properties.startIpAddress", "$.properties.endIpAddress" ],
          "matchType": "ValidateIPRangeSingleTokens",
          "data": {
            "startIP": "0.0.0.0",
            "endIP" : "255.255.255.255",
            "IfNoPropertyFound": "Passed",
            "ControlDesiredState": "Failed"
          }
        },
        {
          "id": "DBforPostgreSQL130",
          "controlId": "Azure_DBforPostgreSQL_AuthZ_Review_AzureServices_Access",
          "isEnabled": true,
          "description": "Use the 'Allow access to Azure services' flag only if required",
          "rationale": "The 'Allow access to Azure services' setting configures a very broad range of IP addresses from Azure as permitted to access the PostgreSQL Server. Please make sure your scenario really requires this setting before enabling it. Turning it ON exposes your PostgreSQL Server to risk of attacks from resources (IPs) owned by others in the Azure region.",
          "recommendation": "Turn 'OFF' the 'Allow access to Azure services' setting. Refer: https://docs.microsoft.com/en-us/azure/postgresql/concepts-firewall-rules#connecting-from-azure",
          "severity": "High",
          "jsonPath": [ "$.properties.startIpAddress", "$.properties.endIpAddress" ],
          "matchType": "ValidateIPRangeSingleTokens",
          "data": {
            "startIP": "0.0.0.0",
            "endIP" : "0.0.0.0",
            "IfNoPropertyFound": "Passed",
            "ControlDesiredState": "Verify"
          }
        }
 
      ]
    },
    {
      "featureName": "DBforMySQL",
      "supportedResourceTypes": [ "Microsoft.DBforMySQL/servers" , "Microsoft.DBforMySQL/servers/firewallRules" ],
      "controls": [
        {
          "id": "DBforMySQL120",
          "controlId": "Azure_DBforMySQL_Authz_Enable_SSL_Connection",
          "isEnabled": true,
          "description": "SSL connection must be enabled for Azure Database for MySQL",
          "rationale": "Enforcing SSL connections between your database server and your client applications helps protect against 'man in the middle' attacks by encrypting the data stream between the server and your application.",
          "recommendation": "To enable SSL connection for Azure Database for MySQL server, refer https://docs.microsoft.com/en-us/azure/mysql/concepts-ssl-connection-security.",
          "severity": "High",
          "jsonPath": [ "$.properties.sslEnforcement" ],
          "matchType": "MatchStringSingleToken",
          "data": {
            "value": "Enabled",
            "Type": "Allow",
            "IfNoPropertyFound": "Passed",
            "isCaseSensitive": false,
            "ControlDesiredState": "Passed"
          }
        },
        {
          "id": "DBforMySql110",
          "controlId": "Azure_DBforMySQL_AuthZ_Verify_IP_Range",
          "isEnabled": true,
          "description": "Configure only the required IP addresses on MySQL server. Do not use 'Any-to-Any' IP range.",
          "rationale": "Using the firewall feature ensures that access to the data or the service is restricted to a specific set/group of clients. NOTE: While this control does provide an extra layer of access control protection, it may not always be feasible to implement in all scenarios.",
          "recommendation": "Do not configure 'Any to Any' firewall IP address. Refer: https://docs.microsoft.com/en-us/azure/mysql/concepts-firewall-rules.",
          "severity": "High",
          "jsonPath": [ "$.properties.startIpAddress", "$.properties.endIpAddress" ],
          "matchType": "ValidateIPRangeSingleTokens",
          "data": {
            "startIP": "0.0.0.0",
            "endIP" : "255.255.255.255",
            "IfNoPropertyFound": "Passed",
            "ControlDesiredState": "Failed"
          }
        },
        {
          "id": "DBforMySQL120",
          "controlId": "Azure_DBforMySQL_AuthZ_Review_AzureServices_Access",
          "isEnabled": true,
          "description": "Use the 'Allow access to Azure services' flag or IP range only if required",
          "rationale": "The 'Allow access to Azure services' setting configures a very broad range of IP addresses from Azure as permitted to access the MySQL Server. Please make sure your scenario really requires this setting before enabling it. Turning it ON exposes your MySQL Server to risk of attacks from resources (IPs) owned by others in the Azure region.",
          "recommendation": "1. Turn 'OFF' the 'Allow access to Azure services' setting. 2. Remove IP range from firewall rules. Refer: https://docs.microsoft.com/en-us/azure/mysql/concepts-firewall-rules#connecting-from-azure",
          "severity": "High",
          "jsonPath": [ "$.properties.startIpAddress", "$.properties.endIpAddress" ],
          "matchType": "ValidateIPRangeSingleTokens",
          "data": {
            "startIP": "0.0.0.0",
            "endIP" : "0.0.0.0",
            "IfNoPropertyFound": "Passed",
            "ControlDesiredState": "Verify"
          }
        }
 
      ]
    },
    {
      "featureName": "VirtualMachineScaleSet",
      "supportedResourceTypes": [ "Microsoft.Compute/virtualMachineScaleSets" ],
      "controls": [
        {
          "id": "VirtualMachineScaleSet110",
          "controlId": "Azure_VirtualMachineScaleSet_Deploy_Monitoring_Agent",
          "isEnabled": true,
          "description": "Log analytics agent should be installed on Virtual Machine Scale Set",
          "rationale": "Installing the Log Analytics extension for Windows and Linux allows Azure Monitor to collect data from your Azure VM Scale Sets which can be used for detailed analysis and correlation of events.",
          "recommendation": "Run following commands: 1- `$allVersions= (Get-AzVMExtensionImage -Location 'eastus' -PublisherName 'Microsoft.EnterpriseCloud.Monitoring' -Type 'MicrosoftMonitoringAgent or OmsAgentForLinux').Version 2- `$versionString = `$allVersions[(`$allVersions.count)-1].Split('.')[0] + '.' + `$allVersions[(`$allVersions.count)-1].Split('.')[1] 3- `$VMSS = Get-AzVmss -ResourceGroupName <VMSS RG Name> -VMScaleSetName <VMSS Name> 4- Add-AzVmssExtension -VirtualMachineScaleSet `$VMSS -Name 'MicrosoftMonitoringAgent' -Publisher 'Microsoft.EnterpriseCloud.Monitoring' -Type 'MicrosoftMonitoringAgent or OmsAgentForLinux' -TypeHandlerVersion `$versionString -Setting '{'workspaceId': '<your workspace ID here>'}' -ProtectedSetting '{'workspaceKey': '<your workspace key here>'}' 5- Update-AzVmss -ResourceGroupName <VMSS RG Name> -Name <VMSS Name> -VirtualMachineScaleSet `$VMSS ",
          "severity": "Medium",
          "jsonPath": [ "$.properties.virtualMachineProfile.extensionProfile.extensions" ],
          "matchType": "ItemProperties",
          "data": {
            "KeyPath": "$.properties.type",
            "value": "MicrosoftMonitoringAgent",
            "type": "Allow"
          }
        },
        {
          "id": "VirtualMachineScaleSet110",
          "controlId": "Azure_VirtualMachineScaleSet_Deploy_Monitoring_Agent",
          "isEnabled": true,
          "description": "Log analytics agent should be installed on Virtual Machine Scale Set",
          "rationale": "Installing the Log Analytics extension for Windows and Linux allows Azure Monitor to collect data from your Azure VM Scale Sets which can be used for detailed analysis and correlation of events.",
          "recommendation": "Run following commands: 1- `$allVersions= (Get-AzVMExtensionImage -Location 'eastus' -PublisherName 'Microsoft.EnterpriseCloud.Monitoring' -Type 'MicrosoftMonitoringAgent or OmsAgentForLinux').Version 2- `$versionString = `$allVersions[(`$allVersions.count)-1].Split('.')[0] + '.' + `$allVersions[(`$allVersions.count)-1].Split('.')[1] 3- `$VMSS = Get-AzVmss -ResourceGroupName <VMSS RG Name> -VMScaleSetName <VMSS Name> 4- Add-AzVmssExtension -VirtualMachineScaleSet `$VMSS -Name 'MicrosoftMonitoringAgent' -Publisher 'Microsoft.EnterpriseCloud.Monitoring' -Type 'MicrosoftMonitoringAgent or OmsAgentForLinux' -TypeHandlerVersion `$versionString -Setting '{'workspaceId': '<your workspace ID here>'}' -ProtectedSetting '{'workspaceKey': '<your workspace key here>'}' 5- Update-AzVmss -ResourceGroupName <VMSS RG Name> -Name <VMSS Name> -VirtualMachineScaleSet `$VMSS ",
          "severity": "Medium",
          "jsonPath": [ "$.properties.virtualMachineProfile.extensionProfile.extensions" ],
          "matchType": "ItemProperties",
          "data": {
            "KeyPath": "$.properties.publisher",
            "value": "Microsoft.EnterpriseCloud.Monitoring",
            "type": "Allow"
          }
        },
        {
          "id": "VirtualMachineScaleSet120",
          "controlId": "Azure_VirtualMachineScaleSet_SI_Enable_Antimalware",
          "isEnabled": true,
          "description": "Antimalware must be enabled with real time protection on Virtual Machine Scale Set",
          "rationale": "Installing the Log Analytics extension for Windows and Linux allows Azure Monitor to collect data from your Azure VM Scale Sets which can be used for detailed analysis and correlation of events.",
          "recommendation": "To install antimalware, Go to Azure Portal --> VMSS --> Settings --> Extensions --> Add 'Microsoft Antimalware' --> Enable Real-Time Protection and Scheduled Scan --> Click Ok. To turn on antimalware using powershell,refer: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-faq#how-do-i-turn-on-antimalware-in-my-virtual-machine-scale-set",
          "severity": "High",
          "jsonPath": [ "$.properties.virtualMachineProfile.extensionProfile.extensions" ],
          "matchType": "ItemProperties",
          "data": {
            "KeyPath": "$.properties.type",
            "value": "IaaSAntimalware",
            "type": "Allow"
          }
        },
        {
          "id": "VirtualMachineScaleSet120",
          "controlId": "Azure_VirtualMachineScaleSet_SI_Enable_Antimalware",
          "isEnabled": true,
          "description": "Antimalware must be enabled with real time protection on Virtual Machine Scale Set",
          "rationale": "Installing the Log Analytics extension for Windows and Linux allows Azure Monitor to collect data from your Azure VM Scale Sets which can be used for detailed analysis and correlation of events.",
          "recommendation": "To install antimalware, Go to Azure Portal --> VMSS --> Settings --> Extensions --> Add 'Microsoft Antimalware' --> Enable Real-Time Protection and Scheduled Scan --> Click Ok. To turn on antimalware using powershell,refer: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-faq#how-do-i-turn-on-antimalware-in-my-virtual-machine-scale-set",
          "severity": "High",
          "jsonPath": [ "$.properties.virtualMachineProfile.extensionProfile.extensions" ],
          "matchType": "ItemProperties",
          "data": {
            "KeyPath": "$.properties.publisher",
            "value": "Microsoft.Azure.Security",
            "type": "Allow"
          }
        },
        {
          "id": "VirtualMachineScaleSet210",
          "controlId": "Azure_VirtualMachineScaleSet_SI_Enable_Auto_OS_Upgrade",
          "isEnabled": true,
          "description": "Enable automatic OS image upgrade on Virtual Machine Scale Set",
          "rationale": "Being on the latest OS version significantly reduces risks from security design issues and security bugs that may be present in previous versions.",
          "recommendation": "To configure auto OS image upgarde on VM Scale Set, please refer: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-upgrade",
          "severity": "Medium",
          "jsonPath": [ "$.properties.upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade" ],
          "matchType": "Boolean",
          "data": {
            "value": true
          }
        },
        {
          "id": "VirtualMachineScaleSet160",
          "controlId": "Azure_VirtualMachineScaleSet_SI_Latest_Model_Applied",
          "isEnabled": true,
          "description": "All VMs in VM Scale Set must be up-to-date with the latest scale set model",
          "rationale": "All the security configurations applied on VM Scale Set will be effective only if all the individual VM instances in Scale Set is up-to-date with the latest overall Scale Set model.",
          "recommendation": "Please refer: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-upgrade-scale-set#how-to-bring-vms-up-to-date-with-the-latest-scale-set-model.",
          "severity": "High",
          "jsonPath": [ "$.properties.upgradePolicy.mode" ],
          "matchType": "MatchStringSingleToken",
          "data": {
            "value": "Manual",
            "type": "NotAllow",
            "isCaseSensitive": false,
            "ControlDesiredState": "Passed"
          }
        }
      ]
    }
 
  ]
}