AKS With Authorized IP Ranges Disabled
- Query id: 2583fab1-953b-4fae-bd02-4a136a6c21f9
- Query name: AKS With Authorized IP Ranges Disabled
- Platform: AzureResourceManager
- Severity: Low
- Category: Networking and Firewall
- CWE: 284
- URL: Github
Description¶
Azure Kubernetes Service must have an authorized IP range for API Services enabled
Documentation
Code samples¶
Code samples with security vulnerabilities¶
Positive test num. 1 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2017-08-31' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
}
}
Positive test num. 2 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2017-08-31",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
}
}
}
]
}
Positive test num. 3 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
apiServerAccessProfile: {
authorizedIPRanges: []
}
}
}
Positive test num. 4 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
},
"apiServerAccessProfile": {
"authorizedIPRanges": []
}
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Positive test num. 5 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
}
}
Positive test num. 6 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2019-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
}
}
}
]
}
Positive test num. 7 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
apiServerAuthorizedIPRanges: []
}
}
Positive test num. 8 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2019-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
},
"apiServerAuthorizedIPRanges": []
}
}
]
}
Positive test num. 9 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
}
}
Positive test num. 10 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
}
}
}
]
}
Positive test num. 11 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
apiServerAccessProfile: {
authorizedIPRanges: []
}
}
}
Positive test num. 12 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
},
"apiServerAccessProfile": {
"authorizedIPRanges": []
}
}
}
]
}
Positive test num. 13 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2017-08-31' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
}
}
Positive test num. 14 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2017-08-31",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
}
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Positive test num. 15 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
}
}
Positive test num. 16 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2019-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
}
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Positive test num. 17 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
apiServerAuthorizedIPRanges: []
}
}
Positive test num. 18 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2019-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
},
"apiServerAuthorizedIPRanges": []
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Positive test num. 19 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
}
}
Positive test num. 20 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
}
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Code samples without security vulnerabilities¶
Negative test num. 1 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
apiServerAccessProfile: {
authorizedIPRanges: ['192.168.0.1', '192.168.0.18']
}
}
}
Negative test num. 2 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
},
"apiServerAccessProfile": {
"authorizedIPRanges": [
"192.168.0.1",
"192.168.0.18"
]
}
}
}
]
}
Negative test num. 3 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
apiServerAuthorizedIPRanges: ['192.168.0.1', '192.168.0.18']
}
}
Negative test num. 4 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2019-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
},
"apiServerAuthorizedIPRanges": [
"192.168.0.1",
"192.168.0.18"
]
}
}
]
}
Negative test num. 5 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2020-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
apiServerAccessProfile: {
authorizedIPRanges: ['192.168.0.1', '192.168.0.18']
}
}
}
Negative test num. 6 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
},
"apiServerAccessProfile": {
"authorizedIPRanges": [
"192.168.0.1",
"192.168.0.18"
]
}
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Negative test num. 7 - bicep file
resource aksCluster1 'Microsoft.ContainerService/managedClusters@2019-02-01' = {
name: 'aksCluster1'
location: resourceGroup().location
properties: {
kubernetesVersion: '1.15.7'
dnsPrefix: 'dnsprefix'
agentPoolProfiles: [
{
name: 'agentpool'
count: 2
vmSize: 'Standard_A1'
osType: 'Linux'
storageProfile: 'ManagedDisks'
}
]
linuxProfile: {
adminUsername: 'adminUserName'
ssh: {
publicKeys: [
{
keyData: 'keyData'
}
]
}
}
servicePrincipalProfile: {
clientId: 'servicePrincipalAppId'
secret: 'servicePrincipalAppPassword'
}
apiServerAuthorizedIPRanges: ['192.168.0.1', '192.168.0.18']
}
}
Negative test num. 8 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "aksCluster1",
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2019-02-01",
"location": "[resourceGroup().location]",
"properties": {
"kubernetesVersion": "1.15.7",
"dnsPrefix": "dnsprefix",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 2,
"vmSize": "Standard_A1",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "adminUserName",
"ssh": {
"publicKeys": [
{
"keyData": "keyData"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "servicePrincipalAppId",
"secret": "servicePrincipalAppPassword"
},
"apiServerAuthorizedIPRanges": [
"192.168.0.1",
"192.168.0.18"
]
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}