Gallery › Monitoring › Azure built-in policies
[Deprecated]: Network traffic data collection agent should be installed on Linux virtual machines
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.1.0-deprecated Deprecated
Deprecated. This policy is no longer enforced due to the planned retirement of the Dependency agent on June 30, 2028. There is no replacement for the Dependency Agent. For more information, see https://aka.ms/dependencyagentretirement.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASC_Dependency_Agent_Audit_Linux.json · 212 lines
{
"properties": {
"displayName": "[Deprecated]: Network traffic data collection agent should be installed on Linux virtual machines",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Deprecated. This policy is no longer enforced due to the planned retirement of the Dependency agent on June 30, 2028. There is no replacement for the Dependency Agent. For more information, see https://aka.ms/dependencyagentretirement.",
"metadata": {
"version": "1.1.0-deprecated",
"category": "Monitoring",
"deprecated": true
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Disabled",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable Dependency Agent for Linux VMs monitoring"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Compute/virtualMachines"
},
{
"anyOf": [
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "Canonical"
},
{
"field": "Microsoft.Compute/imageOffer",
"equals": "UbuntuServer"
},
{
"anyOf": [
{
"field": "Microsoft.Compute/imageSKU",
"in": [
"14.04.0-LTS",
"14.04.1-LTS",
"14.04.5-LTS"
]
},
{
"field": "Microsoft.Compute/imageSKU",
"in": [
"16.04-LTS",
"16.04.0-LTS"
]
},
{
"field": "Microsoft.Compute/imageSKU",
"in": [
"18.04-LTS"
]
}
]
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "RedHat"
},
{
"field": "Microsoft.Compute/imageOffer",
"in": [
"RHEL",
"RHEL-SAP-HANA"
]
},
{
"anyOf": [
{
"field": "Microsoft.Compute/imageSKU",
"like": "6.*"
},
{
"field": "Microsoft.Compute/imageSKU",
"like": "7*"
}
]
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "SUSE"
},
{
"field": "Microsoft.Compute/imageOffer",
"in": [
"SLES",
"SLES-HPC",
"SLES-HPC-Priority",
"SLES-SAP",
"SLES-SAP-BYOS",
"SLES-Priority",
"SLES-BYOS",
"SLES-SAPCAL",
"SLES-Standard"
]
},
{
"anyOf": [
{
"field": "Microsoft.Compute/imageSKU",
"in": [
"12-SP2",
"12-SP3",
"12-SP4"
]
}
]
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "OpenLogic"
},
{
"field": "Microsoft.Compute/imageOffer",
"in": [
"CentOS",
"Centos-LVM",
"CentOS-SRIOV"
]
},
{
"anyOf": [
{
"field": "Microsoft.Compute/imageSKU",
"like": "6.*"
},
{
"field": "Microsoft.Compute/imageSKU",
"like": "7*"
}
]
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "cloudera"
},
{
"field": "Microsoft.Compute/imageOffer",
"equals": "cloudera-centos-os"
},
{
"field": "Microsoft.Compute/imageSKU",
"like": "7*"
}
]
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Compute/virtualMachines/extensions",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.Compute/virtualMachines/extensions/type",
"equals": "DependencyAgentLinux"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/publisher",
"equals": "Microsoft.Azure.Monitoring.DependencyAgent"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/provisioningState",
"equals": "Succeeded"
}
]
}
}
}
},
"versions": [
"1.1.0",
"1.0.2-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/04c4380f-3fae-46e8-96c9-30193528f602",
"name": "04c4380f-3fae-46e8-96c9-30193528f602"
}Bylaw04c4380f-3fae-46e8-96c9-30193528f602.bylaw.ps1 · 84 lines
# Converted from ASC_Dependency_Agent_Audit_Linux.json by ConvertTo-Bylaw.
Policy '04c4380f-3fae-46e8-96c9-30193528f602' {
Properties @{
DisplayName = '[Deprecated]: Network traffic data collection agent should be installed on Linux virtual machines'
Description = 'Deprecated. This policy is no longer enforced due to the planned retirement of the Dependency agent on June 30, 2028. There is no replacement for the Dependency Agent. For more information, see https://aka.ms/dependencyagentretirement.'
Version = '1.1.0-deprecated'
Category = 'Monitoring'
Deprecated = $true
PolicyVersion = '1.1.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'Disabled'
DisplayName = 'Effect'
Description = 'Enable or disable Dependency Agent for Linux VMs monitoring'
}
Resource 'Microsoft.Compute/virtualMachines' {
Require 'imagePublisher, imageOffer and imageSKU are as required' {
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'Canonical' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -Be 'UbuntuServer' -IfPresent
AllOf {
Field 'Microsoft.Compute/imageSKU' | Must -Not -BeIn @('14.04.0-LTS', '14.04.1-LTS', '14.04.5-LTS') -IfPresent
Field 'Microsoft.Compute/imageSKU' | Must -Not -BeIn @('16.04-LTS', '16.04.0-LTS') -IfPresent
Field 'Microsoft.Compute/imageSKU' | Must -Not -BeIn @('18.04-LTS') -IfPresent
}
}
}
Require 'imagePublisher, imageOffer and imageSKU are as required' {
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'RedHat' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -BeIn @('RHEL', 'RHEL-SAP-HANA') -IfPresent
AllOf {
Field 'Microsoft.Compute/imageSKU' | Must -Not -BeLike '6.*' -IfPresent
Field 'Microsoft.Compute/imageSKU' | Must -Not -BeLike '7*' -IfPresent
}
}
}
Require 'imagePublisher, imageOffer and imageSKU are as required' {
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'SUSE' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -BeIn @('SLES', 'SLES-HPC', 'SLES-HPC-Priority', 'SLES-SAP', 'SLES-SAP-BYOS', 'SLES-Priority', 'SLES-BYOS', 'SLES-SAPCAL', 'SLES-Standard') -IfPresent
AllOf {
Field 'Microsoft.Compute/imageSKU' | Must -Not -BeIn @('12-SP2', '12-SP3', '12-SP4') -IfPresent
}
}
}
Require 'imagePublisher, imageOffer and imageSKU are as required' {
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'OpenLogic' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -BeIn @('CentOS', 'Centos-LVM', 'CentOS-SRIOV') -IfPresent
AllOf {
Field 'Microsoft.Compute/imageSKU' | Must -Not -BeLike '6.*' -IfPresent
Field 'Microsoft.Compute/imageSKU' | Must -Not -BeLike '7*' -IfPresent
}
}
}
Require 'imagePublisher, imageOffer and imageSKU are as required' {
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'cloudera' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -Be 'cloudera-centos-os' -IfPresent
Field 'Microsoft.Compute/imageSKU' | Must -Not -BeLike '7*' -IfPresent
}
}
}
AuditIfNotExists 'Microsoft.Compute/virtualMachines/extensions' -Effect (Param Effect) {
Require 'type, publisher and provisioningState are as required' {
Field 'Microsoft.Compute/virtualMachines/extensions/type' | Must -Be 'DependencyAgentLinux'
Field publisher | Must -Be 'Microsoft.Azure.Monitoring.DependencyAgent'
Field provisioningState | Must -Be 'Succeeded'
}
}
}Source: built-in-policies/policyDefinitions/Monitoring/ASC_Dependency_Agent_Audit_Linux.json in Azure/azure-policy, under the MIT licence.
Bylaw