steadytao/planwright
GitHub: steadytao/planwright
Planwright 是一个本地优先的基础设施规划引擎,将强类型计划与 IaC 制品转换为架构图并生成验证、安全和成本等证据产物。
Stars: 2 | Forks: 0
[](#readme)
[](#installation "安装说明")
[](https://github.com/sponsors/steadytao "赞助")
[](LICENSE "许可证")
[](https://github.com/steadytao/planwright/actions/workflows/ci-main.yml "CI 状态")
[](https://goreportcard.com/report/github.com/steadytao/planwright "Go Report Card")
[](https://www.bestpractices.dev/en/projects/13072 "OpenSSF 最佳实践")
[](https://scorecard.dev/viewer/?uri=github.com/steadytao/planwright "OpenSSF Scorecard")
[](https://github.com/steadytao/planwright/commits "提交历史")
Planwright 是一个本地优先的基础设施规划引擎。它将强类型计划和选定的基础设施即代码制品转换为可审查的架构图,然后生成证据:验证结果、安全说明、成本说明、丢失报告、图表和部署包。
Planwright 将基础设施转换视为迁移和证据问题,而不是语法转换问题。
- [安装说明](#installation)
- [发布文件](#release-files)
- [更新](#update)
- [依赖项](#dependencies)
- [编译](#compile)
- [快速验证路径](#quick-proof-path)
- [用法与选项](#usage-and-options)
- [示例](#examples)
- [Planwright 不适用的场景](#what-planwright-is-not)
- [当前范围](#current-scope)
- [兼容性](#compatibility)
- [安全边界](#safety-boundaries)
- [文档](#documentation)
- [开发](#development)
- [贡献](#contributing)
- [治理](#governance)
- [支持](#support)
- [安全](#security)
- [赞助](#sponsoring)
- [许可证](#licence)
- [更新日志](#changelog)
# 安装说明
[](https://github.com/steadytao/planwright/releases/latest/download/planwright_windows_amd64.exe "Windows x64")
[](https://github.com/steadytao/planwright/releases/latest/download/planwright_linux_amd64 "Linux x64")
[](https://github.com/steadytao/planwright/releases/latest/download/planwright_darwin_arm64 "macOS Arm64")
[](https://github.com/steadytao/planwright/tarball/main "源码 TAR 包")
[](#alternatives "备用下载")
[](https://github.com/steadytao/planwright/releases "所有版本")
您可以使用发布的二进制文件或通过从源码编译来安装 Planwright。
## 发布文件
#### 推荐
文件 | 描述
:--- | :---
[planwright_windows_amd64.exe](https://github.com/steadytao/planwright/releases/latest/download/planwright_windows_amd64.exe) | Windows x64 独立可执行文件,推荐用于 Windows x64
[planwright_linux_amd64](https://github.com/steadytao/planwright/releases/latest/download/planwright_linux_amd64) | Linux x64 独立可执行文件,推荐用于 Linux x64
[planwright_darwin_arm64](https://github.com/steadytao/planwright/releases/latest/download/planwright_darwin_arm64) | macOS Apple Silicon 独立可执行文件,推荐用于 Apple Silicon Mac
#### 备选
文件 | 描述
:--- | :---
[planwright_windows_arm64.exe](https://github.com/steadytao/planwright/releases/latest/download/planwright_windows_arm64.exe) | Windows Arm64 独立可执行文件
[planwright_linux_arm64](https://github.com/steadytao/planwright/releases/latest/download/planwright_linux_arm64) | Linux Arm64 独立可执行文件
[planwright_darwin_amd64](https://github.com/steadytao/planwright/releases/latest/download/planwright_darwin_amd64) | macOS Intel 独立可执行文件
[planwright_linux_amd64_desktop.zip](https://github.com/steadytao/planwright/releases/latest/download/planwright_linux_amd64_desktop.zip) | 包含 Planwright 图标的 Linux x64 桌面元数据包
[planwright_linux_arm64_desktop.zip](https://github.com/steadytao/planwright/releases/latest/download/planwright_linux_arm64_desktop.zip) | 包含 Planwright 图标的 Linux Arm64 桌面元数据包
[planwright_darwin_amd64_app.zip](https://github.com/steadytao/planwright/releases/latest/download/planwright_darwin_amd64_app.zip) | 包含 Planwright 图标的 macOS Intel `.app` 包
[planwright_darwin_arm64_app.zip](https://github.com/steadytao/planwright/releases/latest/download/planwright_darwin_arm64_app.zip) | 包含 Planwright 图标的 macOS Apple Silicon `.app` 包
#### 杂项
文件 | 描述
:--- | :---
[SHA2-256SUMS](https://github.com/steadytao/planwright/releases/latest/download/SHA2-256SUMS) | SHA-256 校验清单
[SHA2-256SUMS.sig](https://github.com/steadytao/planwright/releases/latest/download/SHA2-256SUMS.sig) | `SHA2-256SUMS` 的 OpenPGP 签名
[SHA2-512SUMS](https://github.com/steadytao/planwright/releases/latest/download/SHA2-512SUMS) | SHA-512 校验清单
[SHA2-512SUMS.sig](https://github.com/steadytao/planwright/releases/latest/download/SHA2-512SUMS.sig) | `SHA2-512SUMS` 的 OpenPGP 签名
[public.key](https://github.com/steadytao/planwright/releases/latest/download/public.key) | 发布公钥的便捷副本
[planwright_sbom.spdx.json](https://github.com/steadytao/planwright/releases/latest/download/planwright_sbom.spdx.json) | SPDX JSON SBOM
[planwright_sbom.cdx.json](https://github.com/steadytao/planwright/releases/latest/download/planwright_sbom.cdx.json) | CycloneDX JSON SBOM
Planwright 使用由维护者控制的 OpenPGP 发布密钥对校验清单进行签名。请将 [docs/releases/signing.md](docs/releases/signing.md) 中记录的指纹、维护者控制的公告或其他受信任的渠道作为信任根;`public.key` 仅为方便下载的发布资产。
在 Linux 上验证的示例:
```
curl -LO https://github.com/steadytao/planwright/releases/latest/download/public.key
curl -LO https://github.com/steadytao/planwright/releases/latest/download/SHA2-256SUMS
curl -LO https://github.com/steadytao/planwright/releases/latest/download/SHA2-256SUMS.sig
gpg --import ./public.key
gpg --verify ./SHA2-256SUMS.sig ./SHA2-256SUMS
sha256sum -c ./SHA2-256SUMS --ignore-missing
gh attestation verify ./planwright_linux_amd64 -R steadytao/planwright
```
在 Windows 上验证的示例:
```
Invoke-WebRequest -Uri "https://github.com/steadytao/planwright/releases/latest/download/public.key" -OutFile "public.key"
Invoke-WebRequest -Uri "https://github.com/steadytao/planwright/releases/latest/download/SHA2-256SUMS" -OutFile "SHA2-256SUMS"
Invoke-WebRequest -Uri "https://github.com/steadytao/planwright/releases/latest/download/SHA2-256SUMS.sig" -OutFile "SHA2-256SUMS.sig"
gpg --import .\public.key
gpg --verify .\SHA2-256SUMS.sig .\SHA2-256SUMS
(Get-FileHash .\planwright_windows_amd64.exe -Algorithm SHA256).Hash.ToLower()
Select-String -Path .\SHA2-256SUMS -Pattern "planwright_windows_amd64.exe"
gh attestation verify .\planwright_windows_amd64.exe -R steadytao/planwright
```
# 更新
Planwright 目前不包含自更新命令。请在验证校验清单后,下载新的发布二进制文件并替换旧的可执行文件。
# 依赖项
Planwright 发布的二进制文件旨在无需安装 Terraform、OpenTofu、AWS CLI、kubectl、Helm、Kustomize、OPA 或 Rego 的情况下运行。这些工具目前不会被 Planwright 调用;但在 Planwright 周围,它们在准备输入文件或审查生成的输出时可能仍然有用。
对于从源码构建,请安装:
- [go.mod](go.mod) 中声明的 Go 版本
- Git
- 如果您想验证发布清单,请安装 OpenPGP 工具,例如 GnuPG
# 编译
从源码构建 CLI:
```
git clone https://github.com/steadytao/planwright.git
cd planwright
go build -o planwright ./cmd/planwright
./planwright version
```
在 Windows 上:
```
git clone https://github.com/steadytao/planwright.git
cd planwright
go build -o planwright.exe ./cmd/planwright
.\planwright.exe version
```
# 快速验证路径
Planwright 最快且实用的路径是 AWS Web 应用示例:
```
go run ./cmd/planwright validate examples/aws-webapp-basic/planwright.yaml
go run ./cmd/planwright risks examples/aws-webapp-basic/planwright.yaml
go run ./cmd/planwright cost-notes examples/aws-webapp-basic/planwright.yaml
go run ./cmd/planwright generate terraform examples/aws-webapp-basic/planwright.yaml --out ./generated/terraform
go run ./cmd/planwright generate mermaid examples/aws-webapp-basic/planwright.yaml --out ./generated/diagrams
go run ./cmd/planwright pack examples/aws-webapp-basic/planwright.yaml --out ./planwright-pack
```
该路径会产生:
- 验证输出
- Markdown 安全和成本说明
- 面向 Terraform/OpenTofu 的审查文件
- Mermaid 架构图
- 一个基于目录的 Planwright 包,包含清单、图、报告、生成的文件和图表
请在 [examples/aws-webapp-basic/README.md](examples/aws-webapp-basic/README.md) 中阅读完整的演练。
# 用法与选项
Planwright 是 CLI 优先的。当前的命令接口包含:
```
planwright validate 标签:EVTX分析, Go语言, 成本分析, 文档结构分析, 日志审计, 本地化, 架构图, 程序破解, 自动化验证