libre-devops/terraform-msgraph-alerts-and-incidents-utils

GitHub: libre-devops/terraform-msgraph-alerts-and-incidents-utils

通过 Terraform 和 Microsoft Graph API 实现对 Microsoft Defender 统一安全事件与告警的分类、评论、自定义检测规则管理及实验性创建的 IaC 模块。

Stars: 0 | Forks: 0

## 要求 | 名称 | 版本 | |------|---------| | [terraform](#requirement\_terraform) | >= 1.9.0, < 2.0.0 | | [msgraph](#requirement\_msgraph) | >= 0.1.0, < 1.0.0 | ## 提供程序 | 名称 | 版本 | |------|---------| | [msgraph](#provider\_msgraph) | >= 0.1.0, < 1.0.0 | ## 模块 无模块。 ## 资源 | 名称 | 类型 | |------|------| | [msgraph_resource.alerts](https://registry.terraform.io/providers/Microsoft/msgraph/latest/docs/resources/resource) | resource | | [msgraph_resource.incidents](https://registry.terraform.io/providers/Microsoft/msgraph/latest/docs/resources/resource) | resource | | [msgraph_resource.security_resources](https://registry.terraform.io/providers/Microsoft/msgraph/latest/docs/resources/resource) | resource | | [msgraph_resource_action.incident_comments](https://registry.terraform.io/providers/Microsoft/msgraph/latest/docs/resources/resource_action) | resource | | [msgraph_update_resource.alert_updates](https://registry.terraform.io/providers/Microsoft/msgraph/latest/docs/resources/update_resource) | resource | | [msgraph_update_resource.incident_updates](https://registry.terraform.io/providers/Microsoft/msgraph/latest/docs/resources/update_resource) | resource | ## 输入 | 名称 | 描述 | 类型 | 默认值 | 必填 | |------|-------------|------|---------|:--------:| | [alert\_updates](#input\_alert\_updates) | 要更新(分类处理)的现有警报 (alerts\_v2),以稳定的逻辑名称作为键。修补由
alert\_id 标识的警报。类型化字段涵盖了常见的可更新属性;对于
其他任何内容,请使用 body(合并在类型化字段之上)。 |
map(object({
alert_id = string
api_version = optional(string)
status = optional(string)
classification = optional(string)
determination = optional(string)
assigned_to = optional(string)
body = optional(any)
response_export_values = optional(map(string))
}))
| `{}` | no | | [alerts](#input\_alerts) | 要创建和管理的安全警报 (alerts\_v2),以稳定的逻辑名称作为键。实验性:
通过 Graph 创建警报是一项 beta、未公开记录的功能;请针对您的租户进行验证。
body 是原始的警报对象。api\_version 默认为 beta。 |
map(object({
body = any
api_version = optional(string)
update_method = optional(string)
response_export_values = optional(map(string))
}))
| `{}` | no | | [default\_api\_version](#input\_default\_api\_version) | 未设置自身版本的操作的默认 Microsoft Graph API 版本。取值为 "v1.0" 或
"beta" 之一。更新和评论操作在 v1.0(稳定版)上有文档记录并默认使用它。
创建操作(事件、警报)仅在 beta 上公开,因此除非您在条目上固定
api\_version,否则无论此值如何,它们都默认为 beta。 | `string` | `"v1.0"` | no | | [incident\_comments](#input\_incident\_comments) | 要添加到现有事件的评论,以稳定的逻辑名称作为键。每个条目向由 incident\_id 标识的事件发布一条评论。添加评论是一次性操作(在销毁时不会移除)。 |
map(object({
incident_id = string
comment = string
api_version = optional(string)
}))
| `{}` | no | | [incident\_updates](#input\_incident\_updates) | 要更新(分类处理)的现有安全事件,以稳定的逻辑名称作为键。修补
由 incident\_id 标识的事件。类型化字段涵盖了常见的可更新属性;
对于其他任何内容,请使用 body 进行设置(它会合并在类型化字段之上)。 |
map(object({
incident_id = string
api_version = optional(string)
status = optional(string)
classification = optional(string)
determination = optional(string)
assigned_to = optional(string)
custom_tags = optional(list(string))
body = optional(any)
response_export_values = optional(map(string))
}))
| `{}` | no | | [incidents](#input\_incidents) | 要创建和管理的安全事件,以稳定的逻辑名称作为键。实验性:通过 Graph
创建事件是一项 beta、未公开记录的功能;请针对您的租户进行验证。body
是原始的事件对象(例如 displayName、severity、status、classification、
determination、customTags)。api\_version 默认为 beta,因为创建仅在 beta 上可用。 |
map(object({
body = any
api_version = optional(string)
update_method = optional(string)
response_export_values = optional(map(string))
}))
| `{}` | no | | [security\_resources](#input\_security\_resources) | 使用完整的 CRUD 管理任意的 Graph 安全资源,以稳定的逻辑名称作为键。
url 是集合 URL(例如 "security/rules/detectionRules"),body 是资源
对象。将其用于上述没有一等输入的端点,尤其是自定义检测
规则,它会生成显示在 Defender 门户中的警报和事件。 |
map(object({
url = string
body = any
api_version = optional(string)
update_method = optional(string)
response_export_values = optional(map(string))
}))
| `{}` | no | ## 输出 | 名称 | 描述 | |------|-------------| | [alert\_ids](#output\_alert\_ids) | 警报键到已创建警报资源 ID 的映射(实验性创建路径)。 | | [alert\_update\_ids](#output\_alert\_update\_ids) | 警报更新键到目标警报资源 ID 的映射。 | | [alert\_update\_outputs](#output\_alert\_update\_outputs) | 警报更新键到其导出响应值的映射。 | | [alerts](#output\_alerts) | 警报键到其资源 URL 和导出响应值的映射(创建路径)。 | | [incident\_comment\_outputs](#output\_incident\_comment\_outputs) | 事件评论键到操作响应的映射。 | | [incident\_ids](#output\_incident\_ids) | 事件键到已创建事件资源 ID 的映射(仅适用于通过实验性创建路径创建的事件)。 | | [incident\_update\_ids](#output\_incident\_update\_ids) | 事件更新键到目标事件资源 ID 的映射。 | | [incident\_update\_outputs](#output\_incident\_update\_outputs) | 事件更新键到其导出响应值的映射。 | | [incidents](#output\_incidents) | 事件键到其资源 URL 和导出响应值的映射(创建路径)。 | | [security\_resources](#output\_security\_resources) | 安全资源键到其资源 URL 和导出响应值的映射。 |
标签:ECS, Microsoft Defender, Microsoft Graph, Terraform, 告警分诊, 安全运营, 扫描框架, 运维工具