From 848b27a61ea562753e341cc4432598a7c10056b1 Mon Sep 17 00:00:00 2001 From: Jean-Francois Chevrette Date: Thu, 20 Feb 2025 09:17:38 -0500 Subject: [PATCH] mgmt-cluster: enable audit logging for AKS cluster --- .../configurations/mgmt-cluster.tmpl.bicepparam | 3 +++ dev-infrastructure/mgmt-pipeline.yaml | 4 ++++ dev-infrastructure/templates/mgmt-cluster.bicep | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/dev-infrastructure/configurations/mgmt-cluster.tmpl.bicepparam b/dev-infrastructure/configurations/mgmt-cluster.tmpl.bicepparam index df7b62de0..740866e65 100644 --- a/dev-infrastructure/configurations/mgmt-cluster.tmpl.bicepparam +++ b/dev-infrastructure/configurations/mgmt-cluster.tmpl.bicepparam @@ -51,3 +51,6 @@ param azureMonitoringWorkspaceId = '__azureMonitoringWorkspaceId__' param logsNamespace = '{{ .logs.namespace }}' param logsMSI = '{{ .logs.msiName }}' param logsServiceAccount = '{{ .logs.serviceAccountName }}' + +// Log Analytics Workspace ID will be passed from global pipeline if enabled in config +param logAnalyticsWorkspaceId = '__logAnalyticsWorkspaceId__' diff --git a/dev-infrastructure/mgmt-pipeline.yaml b/dev-infrastructure/mgmt-pipeline.yaml index ecee6b13b..6af587393 100644 --- a/dev-infrastructure/mgmt-pipeline.yaml +++ b/dev-infrastructure/mgmt-pipeline.yaml @@ -103,6 +103,10 @@ resourceGroups: input: step: region-output name: maestroEventGridNamespaceId + - name: logAnalyticsWorkspaceId + input: + step: global-output + name: logAnalyticsWorkspaceId dependsOn: - cx-oncert-public-kv-issuer - mgmt-oncert-private-kv-issuer diff --git a/dev-infrastructure/templates/mgmt-cluster.bicep b/dev-infrastructure/templates/mgmt-cluster.bicep index 760b36318..bf7d3497c 100644 --- a/dev-infrastructure/templates/mgmt-cluster.bicep +++ b/dev-infrastructure/templates/mgmt-cluster.bicep @@ -108,6 +108,9 @@ param logsMSI string @description('The service account name of the logs managed identity') param logsServiceAccount string +// Log Analytics Workspace ID will be passed from global pipeline if enabled in config +param logAnalyticsWorkspaceId string = '' + module mgmtCluster '../modules/aks-cluster-base.bicep' = { name: 'cluster' scope: resourceGroup() @@ -142,6 +145,7 @@ module mgmtCluster '../modules/aks-cluster-base.bicep' = { } }) aksKeyVaultName: aksKeyVaultName + logAnalyticsWorkspaceId: logAnalyticsWorkspaceId pullAcrResourceIds: [ocpAcrResourceId, svcAcrResourceId] userAgentMinCount: userAgentMinCount userAgentPoolAZCount: userAgentPoolAZCount