Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR for User Stories 28607-28609-28620 #1339

Merged
merged 17 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/wiki/Whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [In this Section](#in-this-section)
- [Updates](#updates)
- [June 2023](#june-2023)
- [May 2023](#may-2023)
- [April 2023](#april-2023)
- [March 2023](#march-2023)
Expand Down Expand Up @@ -51,6 +52,13 @@ This article will be updated as and when changes are made to the above and anyth

Here's what's changed in Enterprise Scale/Azure Landing Zones:

### June 2023

#### Policy

- Added new custom policy for:
- 'User Defined Routes with 'Next Hop Type' set to 'Internet' or 'VirtualNetworkGateway' should be denied'

### May 2023

#### Policy
Expand All @@ -65,6 +73,9 @@ Here's what's changed in Enterprise Scale/Azure Landing Zones:
- Update initiative [`Deny-PublicPaaSEndpoints`](https://www.azadvertizer.net/azpolicyinitiativesadvertizer/Deny-PublicPaaSEndpoints.html) to replace deprecated policy `Deny-MachineLearning-PublicNetworkAccess` with builtin [`438c38d2-3772-465a-a9cc-7a6666a275ce`](https://www.azadvertizer.net/azpolicyadvertizer/438c38d2-3772-465a-a9cc-7a6666a275ce.html).
- Deprecated policy [`Deny-PublicEndpoint-MariaDB`](https://www.azadvertizer.net/azpolicyadvertizer/Deny-PublicEndpoint-MariaDB.html).
- Update initiative [`Deny-PublicPaaSEndpoints`](https://www.azadvertizer.net/azpolicyinitiativesadvertizer/Deny-PublicPaaSEndpoints.html) to replace deprecated policy `Deny-PublicEndpoint-MariaDB` with builtin [`fdccbe47-f3e3-4213-ad5d-ea459b2fa077`](https://www.azadvertizer.net/azpolicyadvertizer/fdccbe47-f3e3-4213-ad5d-ea459b2fa077.html) - special note: US Gov/Fairfax still uses the now deprecated policy as the builtin is not yet available.
- Added new custom policies for:
- 'Storage Accounts with SFTP enabled should be denied'
- 'Subnets without Private Endpoint Network Policies enabled should be denied'

#### Docs

Expand Down
312 changes: 159 additions & 153 deletions eslzArm/managementGroupTemplates/policyDefinitions/policies.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "Deny-Storage-SFTP",
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2021-06-01",
"scope": null,
"properties": {
"policyType": "Custom",
"mode": "Indexed",
"displayName": "Storage Accounts with SFTP enabled should be denied",
"description": "This policy denies the creation of Storage Accounts with SFTP enabled for Blob Storage.",
"metadata": {
"version": "1.0.0",
"category": "Storage",
"source": "https://github.com/Azure/Enterprise-Scale/",
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
]
},
"parameters": {
"effect": {
"type": "String",
"defaultValue": "Deny",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"field": "Microsoft.Storage/storageAccounts/isSftpEnabled",
"equals": "true"
}
]
},
"then": {
"effect": "[[parameters('effect')]"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"name": "Deny-Subnet-Without-Penp",
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2021-06-01",
"scope": null,
"properties": {
"policyType": "Custom",
"mode": "All",
"displayName": "Subnets without Private Endpoint Network Policies enabled should be denied",
"description": "This policy denies the creation of a subnet without Private Endpoint Netwotk Policies enabled. This policy is intended for 'workload' subnets, not 'central infrastructure' (aka, 'hub') subnets.",
"metadata": {
"version": "1.0.0",
"category": "Network",
"source": "https://github.com/Azure/Enterprise-Scale/",
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
]
},
"parameters": {
"effect": {
"type": "String",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Deny",
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
}
},
"excludedSubnets": {
"type": "Array",
"metadata": {
"displayName": "Excluded Subnets",
"description": "Array of subnet names that are excluded from this policy"
},
"defaultValue": [
"GatewaySubnet",
"AzureFirewallSubnet",
"AzureFirewallManagementSubnet",
"AzureBastionSubnet"
]
}
},
"policyRule": {
"if": {
"anyOf": [
{
"allOf": [
{
"equals": "Microsoft.Network/virtualNetworks",
"field": "type"
},
{
"count": {
"field": "Microsoft.Network/virtualNetworks/subnets[*]",
"where": {
"allOf": [
{
"field": "Microsoft.Network/virtualNetworks/subnets[*].privateEndpointNetworkPolicies",
"notEquals": "Enabled"
},
{
"field": "Microsoft.Network/virtualNetworks/subnets[*].name",
"notIn": "[[parameters('excludedSubnets')]"
}
]
}
},
"notEquals": 0
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/virtualNetworks/subnets"
},
{
"field": "name",
"notIn": "[[parameters('excludedSubnets')]"
},
{
"field": "Microsoft.Network/virtualNetworks/subnets/privateEndpointNetworkPolicies",
"notEquals": "Enabled"
}
]
}
]
},
"then": {
"effect": "[[parameters('effect')]"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"name": "Deny-UDR-With-Specific-NextHop",
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2021-06-01",
"scope": null,
"properties": {
"policyType": "Custom",
"mode": "All",
"displayName": "User Defined Routes with 'Next Hop Type' set to 'Internet' or 'VirtualNetworkGateway' should be denied",
"description": "This policy denies the creation of a User Defined Route with 'Next Hop Type' set to 'Internet' or 'VirtualNetworkGateway'.",
"metadata": {
"version": "1.0.0",
"category": "Network",
"source": "https://github.com/Azure/Enterprise-Scale/",
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
]
},
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Deny"
},
"excludedDestinations": {
"type": "Array",
"metadata": {
"displayName": "Excluded Destinations",
"description": "Array of route destinations that are to be denied"
},
"defaultValue": [
"Internet",
"VirtualNetworkGateway"
]
}
},
"policyRule": {
"if": {
"anyOf": [
{
"allOf": [
{
"equals": "Microsoft.Network/routeTables",
"field": "type"
},
{
"count": {
"field": "Microsoft.Network/routeTables/routes[*]",
"where": {
"field": "Microsoft.Network/routeTables/routes[*].nextHopType",
"in": "[[parameters('excludedDestinations')]"
}
},
"notEquals": 0
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/routeTables/routes"
},
{
"field": "Microsoft.Network/routeTables/routes/nextHopType",
"in": "[[parameters('excludedDestinations')]"
}
]
}
]
},
"then": {
"effect": "[[parameters('effect')]"
}
}
}
}
3 changes: 3 additions & 0 deletions src/templates/policies.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ var loadPolicyDefinitions = {
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-Sql-minTLS.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-SqlMi-minTLS.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-Storage-minTLS.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-Storage-SFTP.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-Subnet-Without-Nsg.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-Subnet-Without-Penp.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-Subnet-Without-Udr.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-UDR-With-Specific-NextHop.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-VNET-Peer-Cross-Sub.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-VNET-Peering-To-Non-Approved-VNETs.json')
loadTextContent('../resources/Microsoft.Authorization/policyDefinitions/Deny-VNet-Peering.json')
Expand Down