atensecurity/terraform-provider-thoth
GitHub: atensecurity/terraform-provider-thoth
Aten Security 官方提供的 Terraform Provider,用于以基础设施即代码的方式管理 Thoth 无头 AI 治理控制平面的租户策略、端点安全、合规治理和证据收集。
Stars: 2 | Forks: 0
# terraform-provider-thoth
用于 Aten Security Thoth 无头 AI 治理控制平面的 Terraform provider。
- Provider 源:`registry.terraform.io/atensecurity/thoth`
- Terraform 版本:`>= 1.5`
- Plugin Framework 实现
## 文档
- Terraform Registry:https://github.com/atensecurity/terraform-provider-thoth/tree/main/examples/basic
- Aten Security 文档:./PUBLIC_ARCHITECTURE_BOUNDARY.md
- 基础示例:./CONTRIBUTING.md
此 provider 暴露了由 GovAPI 支持的资源,用于管理:
- 租户治理设置
- MDM provider 集成与同步任务
- 浏览器策略 provider/策略/注册
- JIT API 密钥
- Webhook 投递测试执行
对于运行时证据导出,请使用 Thoth 证据链 API:
- `GET /:tenant-id/thoth/evidence/chain`
- `GET /:tenant-id/thoth/sessions/:sessionId/evidence-bundle`
或等效的 CLI 命令:
- `thothctl evidence chain --tenant-id --json`
- `thothctl evidence bundle --tenant-id --session-id --output `
## 快速开始
```
terraform {
required_version = ">= 1.5"
required_providers {
thoth = {
source = "atensecurity/thoth"
version = ">= 0.1.10"
}
}
}
provider "thoth" {
tenant_id = var.tenant_id
apex_domain = "atensecurity.com" # optional, defaults to atensecurity.com
org_api_key = var.org_api_key
request_timeout_seconds = 30
}
resource "thoth_governance_settings" "this" {
compliance_profile = "soc2"
regulatory_regimes = ["soc2"]
shadow_low = "allow"
shadow_medium = "step_up"
shadow_high = "block"
shadow_critical = "block"
}
resource "thoth_webhook_settings" "webhook" {
webhook_enabled = true
webhook_url = var.webhook_url
webhook_secret = var.webhook_secret
}
```
`compliance_profile` 是用于基线默认值的高层预设。
`regulatory_regimes` 是用于自动加载监管包的明确义务列表。
如果省略 `regulatory_regimes`,GovAPI 会回退到源自 profile 的默认值,然后是 `["soc2"]`。
当省略 `api_base_url` 时,provider 将其推导为:
`https://grid..`。
有关完整的端到端示例,请参阅 [`examples/basic`](./SECURITY.md)。
对于传统的交互式工作流,依然支持 `admin_bearer_token` 和
`admin_bearer_token_file`。
对于 CI/CD,您可以导出 `THOTH_API_KEY`(必须是组织范围的密钥)并
省略显式身份验证字段。
当导出了 `THOTH_TENANT_ID` 时,也可以省略 `tenant_id`。
## Provider 资源
- `thoth_governance_settings`
- `thoth_webhook_settings`
- `thoth_siem_settings`
- `thoth_pam_settings`
- `thoth_mdm_provider`
- `thoth_mdm_sync`
- `thoth_browser_provider`
- `thoth_browser_policy`
- `thoth_browser_enrollment`
- `thoth_fleet_api_key`
- `thoth_endpoint_api_key`
- `thoth_agent_api_key`
- `thoth_fleet`
- `thoth_endpoint`
- `thoth_webhook_test`
- `thoth_evidence_backfill`
- `thoth_decision_field_backfill`
- `thoth_policy_sync`
- `thoth_policy_bundle`
- `thoth_approval_decision`
- `thoth_pack_assignment`
- `thoth_pack_assignment_bulk`
### 通过 Terraform 实现确定性控制
`thoth_pack_assignment` 和 `thoth_pack_assignment_bulk` 均支持一流的
确定性控制属性:
- `mismatch_boost`
- `delegation_boost`
- `trust_floor`
- `critical_threshold`
这些属性被转换为 `behavioral_controls` 下的策略包覆盖,并在包分配期间通过 GovAPI 应用。
对于框架原生的 sidecar 策略,使用 `thoth_policy_bundle` 从内联策略或由 URI 支持的策略对象管理
带版本的 OPA/Cedar 包,
支持可选的版本固定和哈希验证(`source_uri`、
`s3_version_id`、`expected_hash`)。默认情况下,包面向所有分配
并以 `enforce` 模式运行。您可以选择通过以下方式限定分配范围:
- `all`(默认)
- `agent:`
- ``(直接匹配)
## Provider 数据源
- `thoth_approvals`
- `thoth_api_key_authorization`
- `thoth_api_keys`
- `thoth_billing_pricing`
- `thoth_billing_monthly_cost`
- `thoth_billing_invoices`
- `thoth_billing_artifacts`
- `thoth_billing_artifact`
- `thoth_billing_reports`
- `thoth_billing_report`
- `thoth_evidence_chain`
- `thoth_evidence_verify`
- `thoth_evidence_bundle`
- `thoth_fleets`
- `thoth_fleet`
- `thoth_tenant_settings`
- `thoth_endpoints`
- `thoth_endpoint_stats`
- `thoth_governance_feed`
- `thoth_governance_packs`
- `thoth_governance_pack_rules`
- `thoth_governance_pack_rule_versions`
- `thoth_governance_runtime_status`
- `thoth_governance_day7_report`
- `thoth_governance_reports_overview`
- `thoth_governance_cost_report`
- `thoth_report_data`
- `thoth_policy_bundles`
- `thoth_effective_policy_bundles`
- `thoth_governance_tools`
- `thoth_governance_evidence_slos`
- `thoth_api_key_metrics`
- `thoth_mdm_providers`
- `thoth_mdm_sync_job`
- `thoth_browser_providers`
- `thoth_browser_policies`
- `thoth_browser_enrollments`
## 本地开发
```
env GOCACHE=/tmp/gocache go mod tidy
env GOCACHE=/tmp/gocache go build ./...
env GOCACHE=/tmp/gocache go test ./...
```
## 发布自动化
Provider 的发布自动化在公共 provider 仓库中定义于:
- `.goreleaser.yml`(provider 包/归档/签名布局)
- `.github/workflows/release.yml`(由标签触发的 GitHub 发布流程)
工作流支持的标签格式:
- `v0.1.4`
- `v0.1.4-rc1`
## 治理与知识产权
- [公共架构边界](./TRADEMARKS.md)
- [贡献]( )
- [安全策略]( )
- [商标声明]( )
## 备注
- `thoth_mdm_provider`、`thoth_browser_provider`、`thoth_browser_policy` 和 `thoth_browser_enrollment` 使用 API upsert 语义。
- 对于没有硬删除 endpoint 的资源,删除操作会停止在 Terraform 中的管理,并在可能的情况下执行安全的禁用/停用调用。
标签:AI治理, API管理, Aten Security, CISA项目, DevSecOps, EC2, EVTX分析, Go语言, Headless Control Plane, IaC, JIT API密钥, MDM集成, Plugin Framework, Shadow AI, SOC2, Terraform Provider, Terraform Registry, Terraform 插件, Thoth, Webhook, 上游代理, 力导向图, 合规性管理, 安全策略, 影子AI, 提示词设计, 无头控制平面, 日志审计, 浏览器策略, 移动设备管理, 程序破解, 自动化运维, 证据链