-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bicep): make ARM AKS checks compatible with Bicep (#3836)
* make ARM AKS checks compatible with Bicep * fix linting
- Loading branch information
Showing
15 changed files
with
714 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
tests/bicep/checks/resource/azure/example_AKSApiServerAuthorizedIpRanges/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// pass | ||
|
||
resource enabled 'Microsoft.ContainerService/managedClusters@2022-08-03-preview' = { | ||
name: 'string' | ||
location: resourceGroup().location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
enableRBAC: true | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool' | ||
osDiskSizeGB: osDiskSizeGB | ||
osSKU: 'Ubuntu' | ||
osType: 'Linux' | ||
} | ||
] | ||
addonProfiles: { | ||
omsagent: { | ||
config: { | ||
logAnalyticsWorkspaceResourceID: logAnalyticsWorkspace.id | ||
} | ||
enabled: true | ||
} | ||
kubeDashboard: { | ||
enabled: false | ||
} | ||
} | ||
apiServerAccessProfile: { | ||
authorizedIPRanges: [ | ||
'10.0.0.0/8' | ||
] | ||
} | ||
networkProfile: { | ||
networkPlugin: 'azure' | ||
networkPolicy: 'azure' | ||
} | ||
linuxProfile: { | ||
adminUsername: linuxAdminUsername | ||
ssh: { | ||
publicKeys: [ | ||
{ | ||
keyData: sshRSAPublicKey | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
// fail | ||
|
||
resource default 'Microsoft.ContainerService/managedClusters@2022-08-03-preview' = { | ||
name: 'string' | ||
location: resourceGroup().location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool' | ||
osDiskSizeGB: osDiskSizeGB | ||
osSKU: 'Ubuntu' | ||
osType: 'Linux' | ||
} | ||
] | ||
addonProfiles: { | ||
omsagent: { | ||
config: { | ||
logAnalyticsWorkspaceResourceID: logAnalyticsWorkspace.id | ||
} | ||
enabled: true | ||
} | ||
kubeDashboard: { | ||
enabled: false | ||
} | ||
} | ||
apiServerAccessProfile: { | ||
disableRunCommand: true | ||
} | ||
networkProfile: { | ||
networkPlugin: 'azure' | ||
networkPolicy: 'azure' | ||
} | ||
linuxProfile: { | ||
adminUsername: linuxAdminUsername | ||
ssh: { | ||
publicKeys: [ | ||
{ | ||
keyData: sshRSAPublicKey | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
tests/bicep/checks/resource/azure/example_AKSDashboardDisabled/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// pass | ||
|
||
resource enabled 'Microsoft.ContainerService/managedClusters@2022-08-03-preview' = { | ||
name: 'string' | ||
location: resourceGroup().location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
enableRBAC: true | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool' | ||
osDiskSizeGB: osDiskSizeGB | ||
osSKU: 'Ubuntu' | ||
osType: 'Linux' | ||
} | ||
] | ||
addonProfiles: { | ||
omsagent: { | ||
config: { | ||
logAnalyticsWorkspaceResourceID: logAnalyticsWorkspace.id | ||
} | ||
enabled: true | ||
} | ||
kubeDashboard: { | ||
enabled: false | ||
} | ||
} | ||
apiServerAccessProfile: { | ||
authorizedIPRanges: [ | ||
'10.0.0.0/8' | ||
] | ||
} | ||
networkProfile: { | ||
networkPlugin: 'azure' | ||
networkPolicy: 'azure' | ||
} | ||
linuxProfile: { | ||
adminUsername: linuxAdminUsername | ||
ssh: { | ||
publicKeys: [ | ||
{ | ||
keyData: sshRSAPublicKey | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
// fail | ||
|
||
resource default 'Microsoft.ContainerService/managedClusters@2022-08-03-preview' = { | ||
name: 'string' | ||
location: resourceGroup().location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool' | ||
osDiskSizeGB: osDiskSizeGB | ||
osSKU: 'Ubuntu' | ||
osType: 'Linux' | ||
} | ||
] | ||
addonProfiles: { | ||
omsagent: { | ||
config: { | ||
logAnalyticsWorkspaceResourceID: logAnalyticsWorkspace.id | ||
} | ||
enabled: true | ||
} | ||
} | ||
apiServerAccessProfile: { | ||
disableRunCommand: true | ||
} | ||
networkProfile: { | ||
networkPlugin: 'azure' | ||
networkPolicy: 'azure' | ||
} | ||
linuxProfile: { | ||
adminUsername: linuxAdminUsername | ||
ssh: { | ||
publicKeys: [ | ||
{ | ||
keyData: sshRSAPublicKey | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
tests/bicep/checks/resource/azure/example_AKSLoggingEnabled/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// pass | ||
|
||
resource enabled 'Microsoft.ContainerService/managedClusters@2022-08-03-preview' = { | ||
name: 'string' | ||
location: resourceGroup().location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
enableRBAC: true | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool' | ||
osDiskSizeGB: osDiskSizeGB | ||
osSKU: 'Ubuntu' | ||
osType: 'Linux' | ||
} | ||
] | ||
addonProfiles: { | ||
omsagent: { | ||
config: { | ||
logAnalyticsWorkspaceResourceID: logAnalyticsWorkspace.id | ||
} | ||
enabled: true | ||
} | ||
kubeDashboard: { | ||
enabled: false | ||
} | ||
} | ||
apiServerAccessProfile: { | ||
authorizedIPRanges: [ | ||
'10.0.0.0/8' | ||
] | ||
} | ||
networkProfile: { | ||
networkPlugin: 'azure' | ||
networkPolicy: 'azure' | ||
} | ||
linuxProfile: { | ||
adminUsername: linuxAdminUsername | ||
ssh: { | ||
publicKeys: [ | ||
{ | ||
keyData: sshRSAPublicKey | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
// fail | ||
|
||
resource default 'Microsoft.ContainerService/managedClusters@2022-08-03-preview' = { | ||
name: 'string' | ||
location: resourceGroup().location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool' | ||
osDiskSizeGB: osDiskSizeGB | ||
osSKU: 'Ubuntu' | ||
osType: 'Linux' | ||
} | ||
] | ||
addonProfiles: { | ||
kubeDashboard: { | ||
enabled: false | ||
} | ||
} | ||
apiServerAccessProfile: { | ||
disableRunCommand: true | ||
} | ||
networkProfile: { | ||
networkPlugin: 'azure' | ||
networkPolicy: 'azure' | ||
} | ||
linuxProfile: { | ||
adminUsername: linuxAdminUsername | ||
ssh: { | ||
publicKeys: [ | ||
{ | ||
keyData: sshRSAPublicKey | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.