shieldly-io/action
GitHub: shieldly-io/action
Shieldly Action 是一个 AI 驱动的 GitHub Action,可在 Pull Request 中自动扫描和分析 AWS IAM 策略及 CloudFormation 模板的安全风险。
Stars: 0 | Forks: 0
# Shieldly — AI 驱动的安全分析 (GitHub Action)
阻止 pull request 中不安全的 AWS 基础设施。此 Action 运行对 IAM policy 和 CloudFormation 模板进行 **AI 驱动** 的分析,将结果作为 PR 评论发布,并在问题达到您的严重性阈值时使构建失败。由 [Shieldly](https://www.shieldly.io) 提供支持。
## 用法
```
name: Shieldly Security Check
on: [pull_request]
permissions:
contents: read
pull-requests: write
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: AI-Powered Security Analysis
uses: shieldly-io/action@v1
with:
api-key: ${{ secrets.SHIELDLY_API_KEY }}
scan-path: ./cdk.out
fail-on-severity: High
```
在 synth/package 步骤之后,将 `scan-path` 指向您的 IaC 输出 —— CDK 会写入到 `./cdk.out`(在执行 `cdk synth` 之后),Serverless Framework 会写入到 `./.serverless`。直接使用 `.json`/`.yaml` 文件路径也是可行的。当未找到 IaC 文件时,Action 会发布一条信息性评论并正常退出。
`api-key` 是**必需的** —— 在 CI 中不可用演示模式。请在 [shieldly.io/app/api](https://www.shieldly.io/app/api) 创建一个免费密钥,并将其存储为仓库 secret(`SHIELDLY_API_KEY`)。免费层级涵盖 IAM policy 和 CloudFormation 模板。若要在没有账户的情况下先试用 Shieldly,请在本地使用 [CLI](https://www.npmjs.com/package/@shieldly/cli) —— 它具有演示模式。
## 输入
| 输入 | 默认值 | 描述 |
| --- | --- | --- |
| `api-key` | `''` | **必需。** Shieldly API 密钥 (`sk_live_...`)。在 CI 中不可用演示模式。 |
| `scan-path` | `.` | 要扫描的目录或文件。 |
| `fail-on-severity` | `High` | 达到或超过此严重程度时失败:`Critical`、`High`、`Medium`、`Low`、`none`。 |
| `post-pr-comment` | `true` | 将结果作为 PR 评论发布。需要 `pull-requests: write` 权限。 |
| `github-token` | `''` | 用于 PR 评论的 token(默认为 `GITHUB_TOKEN`)。 |
| `api-url` | `https://api.shieldly.io` | API 基础 URL(用于开发的覆盖配置)。 |
## 输出
| 输出 | 描述 |
| --- | --- |
| `score` | 安全评分 (0–100)。 |
| `risk-level` | 总体风险:`Critical`、`High`、`Medium`、`Low`。 |
| `findings-count` | 发现结果总数。 |
| `critical-count` | Critical 级别的发现结果数量。 |
## 使用输出
```
- name: AI-Powered Security Analysis
id: shieldly
uses: shieldly-io/action@v1
with:
api-key: ${{ secrets.SHIELDLY_API_KEY }}
- run: echo "Score ${{ steps.shieldly.outputs.score }} (${{ steps.shieldly.outputs.risk-level }})"
```
## 隐私
Shieldly **不会**记录您的 policy 或模板输入。缓存键为单向 SHA-256 哈希值。
## 链接
- Web 应用与演示:https://www.shieldly.io
- API 参考:https://www.shieldly.io/docs/api
- CLI:https://github.com/shieldly-io/cli
## 许可证
MIT © Shieldly
*Amazon Web Services (AWS) 是 Amazon.com, Inc. 的商标。Shieldly 与 Amazon Web Services 没有关联,也未获得其认可或赞助。*
标签:AWS, DPI, GitHub Action, Homebrew安装, IAM, 人工智能, 用户模式Hook绕过, 自定义脚本, 静态代码扫描