libre-devops/terraform-azurerm-sentinel-automation-rule
GitHub: libre-devops/terraform-azurerm-sentinel-automation-rule
一个 Terraform 模块,用于以类型化条件和验证操作在 plan 阶段安全地声明和管理 Azure Sentinel 自动化规则。
Stars: 0 | Forks: 0
## 要求
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.9.0, < 2.0.0 |
| [azurerm](#requirement\_azurerm) | >= 4.0.0, < 5.0.0 |
## Providers
| Name | Version |
|------|---------|
| [azurerm](#provider\_azurerm) | >= 4.0.0, < 5.0.0 |
## 模块
No modules.
## 资源
| Name | Type |
|------|------|
| [azurerm_sentinel_automation_rule.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/sentinel_automation_rule) | resource |
## 输入
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [automation\_rules](#input\_automation\_rules) | 以标签为键的自动化规则,除非设置了 display\_name,否则该标签也兼作显示名称。
Azure 要求规则的资源名必须是 UUID:该模块从
标签 (uuidv5) 中派生出一个确定性的名称,因此重新运行 Terraform 永远不会扰乱规则;设置 `name` 可改为接管现有的
UUID。
触发:`triggers_on` 默认为 Incidents,`triggers_when` 默认为 Created。条件是
类型化的属性条件(`conditions`,由模块进行 jsonencode)或原始的 `condition_json`
透传,用于高级形状(changed-property 条件和布尔容器),每个规则只能使用其中
一种。
操作:`action_incident`(修改 status、severity、owner、labels;关闭时
需要 classification),`action_incident_task`(添加任务),以及 `action_playbook`(按 ID 运行 Logic App
playbook)。每个规则至少需要一个操作。 |
更好的是,接受 sentinel 模块的 onboarding\_id(一个 onboardingStates ID):工作区 ID 会
从中被重新解析出来,采用 onboarding ID 可以使 Sentinel onboarding 依赖项变得明确。 | `string` | n/a | yes | ## 输出 | Name | Description | |------|-------------| | [automation\_rule\_ids](#output\_automation\_rule\_ids) | 规则标签到其 ID 的映射。 | | [automation\_rule\_ids\_zipmap](#output\_automation\_rule\_ids\_zipmap) | 规则标签到 { name, id } 的映射,方便与其他模块组合。 | | [automation\_rule\_names](#output\_automation\_rule\_names) | 规则标签到规则的 UUID 名称的映射(除非被覆盖,否则为确定性)。 | | [automation\_rules](#output\_automation\_rules) | 规则标签到完整自动化规则对象的映射。 | | [workspace\_id](#output\_workspace\_id) | 应用规则的 Log Analytics 工作区 ID(如果提供了 onboarding ID,则从中解析)。 |
Azure 要求规则的资源名必须是 UUID:该模块从
标签 (uuidv5) 中派生出一个确定性的名称,因此重新运行 Terraform 永远不会扰乱规则;设置 `name` 可改为接管现有的
UUID。
触发:`triggers_on` 默认为 Incidents,`triggers_when` 默认为 Created。条件是
类型化的属性条件(`conditions`,由模块进行 jsonencode)或原始的 `condition_json`
透传,用于高级形状(changed-property 条件和布尔容器),每个规则只能使用其中
一种。
操作:`action_incident`(修改 status、severity、owner、labels;关闭时
需要 classification),`action_incident_task`(添加任务),以及 `action_playbook`(按 ID 运行 Logic App
playbook)。每个规则至少需要一个操作。 |
map(object({
order = number
name = optional(string)
display_name = optional(string)
enabled = optional(bool, true)
expiration = optional(string)
triggers_on = optional(string, "Incidents")
triggers_when = optional(string, "Created")
conditions = optional(list(object({
property = string
operator = string
values = list(string)
})))
condition_json = optional(string)
action_incident = optional(list(object({
order = number
status = optional(string)
classification = optional(string)
classification_comment = optional(string)
labels = optional(list(string))
owner_id = optional(string)
severity = optional(string)
})), [])
action_incident_task = optional(list(object({
order = number
title = string
description = optional(string)
})), [])
action_playbook = optional(list(object({
order = number
logic_app_id = string
tenant_id = optional(string)
})), [])
})) | `{}` | no |
| [workspace\_id](#input\_workspace\_id) | 应用自动化规则的工作区。接受 Log Analytics 工作区 ID,或者更好的是,接受 sentinel 模块的 onboarding\_id(一个 onboardingStates ID):工作区 ID 会
从中被重新解析出来,采用 onboarding ID 可以使 Sentinel onboarding 依赖项变得明确。 | `string` | n/a | yes | ## 输出 | Name | Description | |------|-------------| | [automation\_rule\_ids](#output\_automation\_rule\_ids) | 规则标签到其 ID 的映射。 | | [automation\_rule\_ids\_zipmap](#output\_automation\_rule\_ids\_zipmap) | 规则标签到 { name, id } 的映射,方便与其他模块组合。 | | [automation\_rule\_names](#output\_automation\_rule\_names) | 规则标签到规则的 UUID 名称的映射(除非被覆盖,否则为确定性)。 | | [automation\_rules](#output\_automation\_rules) | 规则标签到完整自动化规则对象的映射。 | | [workspace\_id](#output\_workspace\_id) | 应用规则的 Log Analytics 工作区 ID(如果提供了 onboarding ID,则从中解析)。 |
标签:Azure, ECS, Microsoft Sentinel, Terraform, 安全运营, 扫描框架, 自动化规则