feat(core): YAML policy format with transformation functions via `!` tags
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从现有的 JSON 策略验证和评估路径开始,然后跟踪 issue 中提到的 tirith lint 和 tirith fmt 入口,以及 #366 中的相关工作。完成的标准是:YAML 策略能够像 JSON 策略一样进行评估,已批准的标签能够转换值并报告每个值的错误,未知标签能够明确失败,lint/format 和 builder 往返转换能够正常工作,并且文档包含 JSON/YAML 对比。
由索引模型根据 Issue 内容生成。
描述
Policies are JSON-only today. Support YAML as a first-class policy format: the same schema (YAML is
a superset, so every existing policy has a 1:1 YAML twin), plus YAML custom tags — the ! prefix —
as declarative transformation functions inline in the policy:
meta:
version: v1
provider: stackguardian/terraform_plan
evaluators:
- id: task_def_count
provider_args:
operation_type: attribute
terraform_resource_type: aws_ecs_task_definition
terraform_resource_attribute: !json_decode container_definitions
condition:
type: LessThanEqualTo
value: !length
Design constraints
- Tags are data, not code: a fixed whitelist of transformation tags (e.g.
!length,
!json_decode,!lower) parsed with a safe YAML loader — an unknown tag is a validation error,
never an arbitrary constructor. This keeps the format Builder-friendly. - The tags are surface syntax over the same transformation pipeline planned for
condition.transform— one implementation, two spellings. A minimal function set can ship with
the format; the fuller coercion layer (dates, CIDR, sizes) extends it later. - Each transformation step wraps errors per value (a failed decode is a provider error on that
resource, not a crashed run). tirith lint/tirith fmt(#366) must accept and format YAML policies; validation and the
interactive builder round-trip both formats.
Acceptance. A .yaml policy evaluates identically to its JSON twin; ! tags apply the shared
transformations with per-value error handling; an unknown tag fails validation with a clear
message; tirith lint/fmt handle YAML; docs show a side-by-side JSON/YAML example.
- 主要语言
- Python
- 星标
- 176
- 派生
- 54
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 9
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
StackGuardian/tirith 的其他 Issue
-
chore: remove stale TODOs and commented-out code可能已有人在做 @krishna2707 于 3 天前认领。 未关闭chore good first issue hacktoberfest
难度 1/5 1 小时以内 新手友好度 82/100
StackGuardian/tirith#408 · 1 条评论 ·
维护者通常 1 天内回复
-
test(evaluators): edge cases for `Equals` and `NotEquals`可能已有人在做 @Ankit-cs 于 2 天前认领。 未关闭good first issue hacktoberfest tests
难度 2/5 1-3 小时 新手友好度 85/100
StackGuardian/tirith#406 ·
维护者通常 1 天内回复
-
test(kubernetes): cover the provider's main paths可能已有人在做 @afsuyadi 于 1 天前认领。 未关闭good first issue hacktoberfest tests
难度 2/5 1-3 小时 新手友好度 72/100
StackGuardian/tirith#405 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
fix(kubernetes): missing `kubernetes_kind` or `attribute_path` errors are dropped可能已有人在做 @Ankit-cs 于 1 天前认领。 未关闭bug good first issue hacktoberfest
难度 2/5 1-3 小时 新手友好度 78/100
StackGuardian/tirith#404 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
test: make pytest collect the infracost and sg_workflow tests可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭good first issue hacktoberfest tests
难度 1/5 1 小时以内 新手友好度 92/100
StackGuardian/tirith#403 ·
维护者通常 1 天内回复
查看 StackGuardian/tirith 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
sierra-research/tau2-bench#635 ·
维护者通常 1 天内回复
-
The add-ssm-model skill requires a Cython simulator; the contributing guide allows Python ones可能已有人在做 @fmuia 今天认领。 未关闭documentation skill
难度 2/5 1-3 小时 新手友好度 83/100
lnccbrown/ssm-simulators#406 ·
维护者通常 4 天内回复
-
难度 1/5 1 小时以内 新手友好度 95/100
btclib-org/btclib-ecc#309 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
jbacalso24/mimry#459 · 1 条评论 ·
维护者通常 1 天内回复
-
auth bug high-priority
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复