Azure Bicep - 为云设置配置附加 Defender - [容器]

问题描述 投票:0回答:1

目前正在尝试通过 Bicep 中的模板设置不同的 Defender for Cloud 特定设置。 到目前为止,我已经能够在 Bicep 中配置很多设置作为资源。

例如,启用服务器无代理扫描:

resource serversPlan 'Microsoft.Security/pricings@2022-03-01' = {
  name: 'VirtualMachines'
  dependsOn: [
    cspmPlan
  ]
  properties: {
    pricingTier: 'Standard'
    subPlan: 'P2'
  }
}

resource agentlessScanningServers 'Microsoft.Security/VmScanners@2022-03-01-preview' = {
  name: 'default'
  dependsOn: [
      serversPlan
  ]
  properties: {
    scanningMode: 'Default'
    // You can add exclusion tags to Agentless scanning for machines feature
    exclusionTags: {}
    enabled: true
  }

但我很难找到任何有关启用/禁用与容器相关的 Defender for Cloud 设置的文档。 更具体地说:

  • Kubernetes 的无代理发现
  • 无代理容器漏洞评估

有人在 DfC for Containers in Bicep 中对特定设置进行过任何配置吗? 这可能吗?

浏览了“安全”选项卡中的全部内容 https://learn.microsoft.com/en-us/azure/templates/。找不到任何有关容器的信息。

azure containers azure-bicep
1个回答
0
投票

正如我在讨论中提到的,二头肌不太可能达到你的要求。

但是,容器二头肌中的资源 ManagedClusterSecurityProfileDefender

 下有一个名为 
Microsoft.ContainerService/managedClusters
 的配置文件设置可用。要启用与容器相关的 Defender 配置文件,您可以使用以下详细代码。

param location string = resourceGroup().location
resource ws 'Microsoft.OperationalInsights/workspaces@2023-09-01' existing = {
  name: 'newws'
}
resource clustercreate 'Microsoft.ContainerService/managedClusters@2024-01-02-preview' = {
  name: 'myclusterj'
  location: location
  sku: {
    name: 'Base'
    tier: 'Standard'
  }
  properties: {
    kubernetesVersion: '1.28.3'
    dnsPrefix: 'sdsd'
    servicePrincipalProfile: {
      clientId: '77xxxxxx45c'
      secret: 'Sgn8xxxx0cOq'
    }
    agentPoolProfiles: [
      {
        name: 'systempool'
        count: 1
        enableAutoScaling: true
        minCount: 1
        maxCount: 3
        vmSize: 'Standard_B2s'
        osType: 'Linux'
        mode: 'System'
      }
    ]
    securityProfile: {
      defender: {
        logAnalyticsWorkspaceResourceId: ws.id
        securityMonitoring: {
          enabled: true
        }
      }
    }
  }
}

部署成功:

enter image description here

enter image description here

如果您想使用 Azure 策略来满足特定要求,请参阅 MSDoc 并分配以下策略定义。

enter image description here

如果问题仍然存在,请通过门户检查容器的防御者文档。

© www.soinside.com 2019 - 2024. All rights reserved.