Skip to content

Commit f94ec8b

Browse files
feat: Add security rules for AKS ingress and Azure Load Balancer in virtual network module
1 parent f6b4d88 commit f94ec8b

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

infra/modules/virtualNetwork.bicep

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,50 @@ param subnets subnetType[] = [
7676
addressPrefixes: ['10.0.6.0/23']
7777
networkSecurityGroup: {
7878
name: 'nsg-aks'
79-
securityRules: []
79+
securityRules: [
80+
{
81+
name: 'AllowHttpHttpsInbound'
82+
properties: {
83+
access: 'Allow'
84+
direction: 'Inbound'
85+
priority: 1000
86+
protocol: 'Tcp'
87+
sourcePortRange: '*'
88+
destinationPortRanges: ['80', '443']
89+
sourceAddressPrefix: 'Internet'
90+
destinationAddressPrefix: '*'
91+
description: 'Allow HTTP and HTTPS traffic from Internet for AKS ingress'
92+
}
93+
}
94+
{
95+
name: 'AllowAzureLoadBalancer'
96+
properties: {
97+
access: 'Allow'
98+
direction: 'Inbound'
99+
priority: 1100
100+
protocol: '*'
101+
sourcePortRange: '*'
102+
destinationPortRange: '*'
103+
sourceAddressPrefix: 'AzureLoadBalancer'
104+
destinationAddressPrefix: '*'
105+
description: 'Allow Azure Load Balancer traffic'
106+
}
107+
}
108+
{
109+
name: 'AllowVnetInbound'
110+
properties: {
111+
access: 'Allow'
112+
direction: 'Inbound'
113+
priority: 1200
114+
protocol: '*'
115+
sourcePortRange: '*'
116+
destinationPortRange: '*'
117+
sourceAddressPrefix: 'VirtualNetwork'
118+
destinationAddressPrefix: 'VirtualNetwork'
119+
description: 'Allow traffic within the virtual network'
120+
}
121+
}
122+
]
80123
}
81124
}
82125
{

0 commit comments

Comments
 (0)