GoogleCloudPlatform/aactl
GitHub: GoogleCloudPlatform/aactl
一款用于将第三方漏洞报告与 SLSA/sigstore 证明导入 Google Artifact Analysis 的数据集成工具。
Stars: 12 | Forks: 8
# aactl
Google [Artifact Analysis (AA)](https://cloud.google.com/artifact-analysis/docs/artifact-analysis) 服务数据导入工具,支持 OSS 漏洞扫描器报告、SLSA 可追溯性以及 sigstore 证明。
AACTL 是一个示例工具,用于展示使用 Artifact Registry 的 Google Cloud 客户如何将受支持扫描工具检测到的漏洞导入 Artifact Analysis。 导入后,漏洞将与 Artifact Analysis 自身检测到的漏洞一同存储与管理。漏洞可在 Artifact Registry UI、SDS Security Insights、gcloud 以及 Artifact Analysis API(Container Analysis)中进行查看。
AACTL 还可以导入由 [SLSA GitHub Generator](https://github.com/slsa-framework/slsa-github-generator) 生成的 SLSA 构建可追溯性数据。
## 用法
`aactl` 支持导入两种数据类型:`vulnerability`(漏洞)和 `attestation`(证明)。
### 漏洞
要导入由 [grype](https://github.com/anchore/grype)、[snyk](https://github.com/snyk/cli) 或 [trivy](https://github.com/aquasecurity/trivy) 扫描器导出的漏洞报告,首先需将报告导出为 JSON 格式:
* [grype](https://github.com/anchore/grype)
`grype --add-cpes-if-none -s AllLayers -o json --file report.json $image`
* [snyk](https://github.com/snyk/cli)
`snyk container test --app-vulns --json-file-output=report.json $image`
* [trivy](https://github.com/aquasecurity/trivy)
`trivy image --format json --output report.json $image`
获取漏洞文件后,可使用 `aactl` 将该文件导入 AA:
```
aactl vulnerability --project $project \
--source $image \
--file report.json
```
要在 GCP 中查看已导入的漏洞:
```
gcloud artifacts docker images list $repo \
--show-occurrences \
--format json \
--occurrence-filter "kind=\"VULNERABILITY\" AND resource_url=\"https://$image\""
```
你也可以导航到 Artifact Registry 以在此处查看漏洞:

### 证明
除了漏洞,`aactl` 还可以导入 [sigstore](https://github.com/sigstore) 证明:
```
aactl attestation --project $project --source $image
```
导入的数据可通过 `gcloud` 访问:
```
gcloud artifacts docker images describe $image --show-provenance --format json
```
生成的 JSON 数据示例如下:

数据还可以在 Software Delivery Shield 侧边栏中查看:

## 贡献
仅接受错误修复,不接受全新示例。欢迎通过拉取(pull)请求或 GitHub 问题(issue)提交修复。
详见 [CONTRIBUTING.md](CONTRIBUTING.md) 了解贡献指南。
## 许可
本仓库代码根据 Apache 2.0 许可发布。详见 [LICENSE](LICENSE)。
标签:Artifact Analysis, Artifact Registry, EVTX分析, Google Cloud, Google Container Analysis, GPT, grype, OSS安全, sigstore attestations, SLSA provenance, snyk, trivy, 安全合规, 安全性扫描, 容器镜像扫描, 持续集成安全, 数据导入工具, 日志审计, 漏洞导入, 漏洞管理, 网络代理, 逆向工具