sisaku-security/sisakulint

GitHub: sisaku-security/sisakulint

专为 GitHub Actions 工作流设计的快速静态分析器,通过语义分析检测并自动修复 CI/CD 安全漏洞。

Stars: 43 | Forks: 3

sisakulint logo # sisakulint **一款快速、安全优先的静态分析器,带有启发式自动修复功能,专为 GitHub Actions 工作流设计。** 在 `.github/workflows/` 中发现注入、凭据泄露、供应链和管道投毒漏洞——并使用 `-fix` 自动修复其中大部分问题。 [![Go 参考](https://pkg.go.dev/badge/github.com/sisaku-security/sisakulint.svg)](https://pkg.go.dev/github.com/sisaku-security/sisakulint) [![Go 报告卡](https://goreportcard.com/badge/github.com/sisaku-security/sisakulint)](https://goreportcard.com/report/github.com/sisaku-security/sisakulint) [![许可证](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) [![最新发布](https://img.shields.io/github/v/release/sisaku-security/sisakulint)](https://github.com/sisaku-security/sisakulint/releases/latest) [![GitHub 星标](https://img.shields.io/github/stars/sisaku-security/sisakulint?style=social)](https://github.com/sisaku-security/sisakulint/stargazers) [![BlackHat Arsenal 2025](https://img.shields.io/badge/BlackHat%20Arsenal-2025-black)](https://speakerdeck.com/4su_para/sisakulint-ci-friendly-static-linter-with-sast-semantic-analysis-for-github-actions)
## 为什么选择 sisakulint - **安全优先设计。** 全面覆盖 [OWASP Top 10 CI/CD 安全风险](https://owasp.org/www-project-top-10-ci-cd-security-risks/)——代码/环境/路径/输出注入、不受信任的检出、工件与缓存投毒、引用混淆、冒名提交等。 - **语义分析,而非正则式。** 真正的 AST + 表达式解析器 + Shell 污点分析器(`mvdan.cc/sh`)——而非字符串匹配。跨步骤和跨文件的污点传播,覆盖 `$GITHUB_ENV`、可复用工作流边界和 Shell 函数参数。 - **自动修复,直接创建 PR。** 27+ 条规则附带自动修复器。`sisakulint -fix on` 直接重写 YAML;`-fix dry-run` 先预览差异。 - **专为 CI 构建。** SARIF 输出可直接导入 [reviewdog](https://github.com/reviewdog/reviewdog),实现内联 PR 审查评论。 - **识别 AI 代理。** 检测 claude-code-action 及类似 AI 代理集成中的提示注入、危险工具暴露、不安全沙箱标志和执行顺序问题(*Clinejection* 攻击类)。 ### 对比 | | sisakulint | actionlint | zizmor | StepSecurity | CodeQL | | ---------------------------------------------- | :---------: | :--------: | :-----: | :------------: | :-----: | | 工作流语法 / Shell 代码检查 | ✅ | ✅ | 部分 | — | — | | OWASP CI/CD Top 10 覆盖 | 完整 | — | 部分 | 仅运行时 | 部分 | | 可复用工作流的跨文件污点 | ✅ | — | — | — | ✅ | | 通过 `$GITHUB_ENV` 的跨步骤/跨任务污点 | ✅ | — | — | 运行时 | ✅ | | Shell 感知的污点(含函数参数) | ✅ | — | — | — | 部分 | | AI 代理操作规则(Clinejection) | ✅ | — | — | — | — | | 自动修复 | 27+ 条规则 | — | — | N/A | ⚠️ | | SARIF + reviewdog | ✅ | — | ✅ | ✅ | ✅ | 静态分析工具位于运行时工具的上游——sisakulint 在 PR 审查阶段捕获错误,早于任何工作流运行。 ## 目录 - [快速开始](#quick-start) - [安装](#installation) - [检测内容](#what-it-detects) - [规则参考](#rule-reference) - [示例:检测真实漏洞](#example-detecting-real-vulnerabilities) - [自动修复](#auto-fix) - [SARIF + reviewdog 集成](#sarif--reviewdog-integration) - [配置](#configuration) - [架构](#architecture) - [BlackHat Arsenal 2025](#blackhat-arsenal-2025) - [贡献指南](#contributing) - [许可证](#license) - [引用](#citation) ## 快速开始 ``` # macOS brew tap sisaku-security/homebrew-sisakulint brew install sisakulint # 在任何包含 .github/workflows/ 目录的仓库中运行 sisakulint ``` 其他运行方式: ``` sisakulint .github/workflows/release.yml # one file sisakulint -fix dry-run # preview auto-fixes sisakulint -fix on # apply auto-fixes sisakulint -format "{{sarif .}}" # SARIF for CI sisakulint -enable-rule missing-timeout-minutes # opt-in rule ``` 退出码:`0` = 无问题,`1` = 发现问题,`2` = CLI 参数错误,`3` = 致命错误。 ## 安装 ### Homebrew(macOS / Linuxbrew) ``` brew tap sisaku-security/homebrew-sisakulint brew install sisakulint ``` ### `go install` ``` go install github.com/sisaku-security/sisakulint/cmd/sisakulint@latest ``` 需要 Go 1.25 或更高版本。 ### 预编译二进制(Linux / Windows) 从[发布页面](https://github.com/sisaku-security/sisakulint/releases/latest)下载并放置到 `$PATH` 中: ``` # Linux 示例 curl -sSL -o sisakulint https://github.com/sisaku-security/sisakulint/releases/latest/download/sisakulint-linux-amd64 chmod +x sisakulint sudo mv sisakulint /usr/local/bin/ ``` ### 从源码构建 ``` git clone https://github.com/sisaku-security/sisakulint.git cd sisakulint go build ./cmd/sisakulint ``` ### 作为 GitHub Action 使用 将 sisakulint 集成到 CI 最简便的方法是使用官方 [`sisaku-security/sisakulint-action`](https://github.com/sisaku-security/sisakulint-action)。它会安装二进制文件、运行扫描、将结果渲染为内联 PR 注释,并(可选)将 SARIF 上传到 GitHub Code Scanning。 ``` name: sisakulint on: pull_request: paths: [".github/workflows/**"] push: branches: [main] paths: [".github/workflows/**"] permissions: contents: read pull-requests: write # inline PR annotations security-events: write # only if upload-sarif: true jobs: scan: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: persist-credentials: false - uses: sisaku-security/sisakulint-action@596af4ab15e8c5b232c74aa97525a0302e7b7af4 # v1.0.0 with: fail-on: high # none | low | medium | high | critical upload-sarif: true # send SARIF to GitHub Code Scanning ``` 有用的输入参数:`version`、`working-directory`、`args`、`config-file`、`autofix`(`off` / `on` / `dry-run`)、`fail-on`、`upload-sarif`、`sarif-file`。完整列表请参阅该 Action 的 [README](https://github.com/sisaku-security/sisakulint-action)。
备选方案:将 SARIF 管道传输至 reviewdog 如果你更愿意使用 reviewdog 进行内联 PR 审查评论而非 GitHub 注释: ``` - uses: reviewdog/action-setup@v1 - name: sisakulint + reviewdog env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | curl -sSL -o sisakulint \ https://github.com/sisaku-security/sisakulint/releases/latest/download/sisakulint-linux-amd64 chmod +x sisakulint ./sisakulint -format "{{sarif .}}" \ | reviewdog -f=sarif -reporter=github-pr-review -filter-mode=nofilter ```
## 检测内容 ### OWASP Top 10 CI/CD 安全风险覆盖 | OWASP 风险 | 描述 | sisakulint 规则 | |:-----------|:------------|:-----------------| | [CICD-SEC-01][owasp-01] | 不充分的流程控制机制 | [improper-access-control][r-iac], [bot-conditions][r-bot], [unsound-contains][r-uc], [ai-action-unrestricted-trigger][r-aaut] | | [CICD-SEC-02][owasp-02] 不充分的身份与访问管理 | [permissions][r-perm] | | [CICD-SEC-03][owasp-03] | 依赖链滥用 | [known-vulnerable-actions][r-kva], [archived-uses][r-au], [impostor-commit][r-ic], [ref-confusion][r-rc], [reusable-workflow-taint][r-rwt] | | [CICD-SEC-04][owasp-04] | 投毒的管道执行(PPE) | [dangerous-triggers-*][r-dt-c], [code-injection-*][r-ci], [envvar-injection-*][r-evi], [envpath-injection-*][r-epi], [output-clobbering-*][r-oc], [argument-injection-*][r-ai], [untrusted-checkout-*][r-uco], [request-forgery-*][r-rf], [ai-action-prompt-injection][r-aapi] | | [CICD-SEC-05][owasp-05] | 不充分的 PBAC | [self-hosted-runners][r-shr], [ai-action-excessive-tools][r-aaet], [ai-action-unsafe-sandbox][r-aaus], [ai-action-execution-order][r-aaeo] | | [CICD-SEC-06][owasp-06] | 不充分的凭据卫生 | [credentials][r-cred], [artipacked][r-ap], [secrets-in-artifacts][r-sia], [secret-exfiltration][r-sef], [secret-exposure][r-se], [unmasked-secret-exposure][r-use], [secrets-inherit][r-si], [secret-in-log][r-sil] | | [CICD-SEC-07][owasp-07] | 不安全的系统配置 | [timeout-minutes][r-tm], [deprecated-commands][r-dc], [cache-bloat][r-cb] | | [CICD-SEC-08][owasp-08] | 第三方服务的无监管使用 | [action-list][r-al], [commit-sha][r-sha], [unpinned-images][r-ui], [dependabot-github-actions][r-dga] | | [CICD-SEC-09][owasp-09] | 不正确的工件完整性验证 | [artifact-poisoning-*][r-apc], [cache-poisoning-*][r-cp] | | [CICD-SEC-10][owasp-10] | 不充分的日志记录与可见性 | [obfuscation][r-ob] | **完整文档:** ## 规则参考 50+ 条规则,涵盖语法、配置、凭据、注入、检出、供应链、投毒、访问控制和 AI 代理操作安全。
点击展开完整规则列表 | 类别 | 规则 | 严重程度 | 描述 | 修复 | 文档 | |:---------|:-----|:--------:|:------------|:---:|:----:| | **语法** | id | 低 | 任务/环境变量的 ID 冲突检测 | | [文档][r-id] | | | env-var | 低 | 环境变量名称验证 | | [文档][r-env] | | | permissions | 高 | 权限范围与值验证 | 是 | [文档][r-perm] | | | workflow-call | 中 | 可复用工作流调用验证 | | [文档][r-wc] | | | job-needs | 低 | 任务依赖验证 | | [文档][r-jn] | | | expression | 中 | 表达式语法验证 | | [文档][r-expr] | | | cond | 中 | 条件表达式验证 | 是 | [文档][r-cond] | | | deprecated-commands | 高 | 已弃用的工作流命令检测 | | [文档][r-dc] | | **配置** | timeout-minutes | 低 | 确保设置了 timeout-minutes(可选) | 是 | [文档][r-tm] | | | cache-bloat | 低 | 通过 restore/save 对导致的缓存膨胀 | 是 | [文档][r-cb] | | **凭据** | credentials | 高 | 硬编码凭据检测 | 是 | [文档][r-cred] | | | secret-exposure | 高 | 过度暴露 secrets 检测 | 是 | [文档][r-se] | | | unmasked-secret-exposure | 高 | 未掩码的派生 secrets 检测 | 是 | [文档][r-use] | | | artipacked | 严重 | 通过持久化检出导致的凭据泄露 | 是 | [文档][r-ap] | | | secrets-in-artifacts | 高 | 工件上传中的敏感数据 | 是 | [文档][r-sia] | | | secrets-inherit | 高 | 过度继承 secrets | 是 | [文档][r-si] | | | secret-exfiltration | 严重 | 通过网络命令外泄 secrets | | [文档][r-sef] | | | secret-in-log | 严重 | 将 secret 值打印到构建日志(污点追踪) | 是 | [文档][r-sil] | | **注入** | code-injection-critical | 严重 | 特权触发器中的不受信任输入 | 是 | [文档][r-ci] | | | code-injection-medium | 中 | 普通触发器中的不受信任输入 | 是 | [文档][r-cim] | | | envvar-injection-critical | 严重 | 向 $GITHUB_ENV 写入不受信任输入(特权) | 是 | [文档][r-evi] | | | envvar-injection-medium | 中 | 向 $GITHUB_ENV 写入不受信任输入(普通) | 是 | [文档][r-evim] | | | envpath-injection-critical | 严重 | 向 $GITHUB_PATH 写入不受信任输入(特权) | 是 | [文档][r-epi] | | | envpath-injection-medium | 中 | 向 $GITHUB_PATH 写入不受信任输入(普通) | 是 | [文档][r-epim] | | | output-clobbering-critical | 严重 | 向 $GITHUB_OUTPUT 写入不受信任输入(特权) | 是 | [文档][r-oc] | | | output-clobbering-medium | 中 | 向 $GITHUB_OUTPUT 写入不受信任输入(普通) | 是 | [文档][r-oc] | | | argument-injection-critical | 严重 | 命令行参数注入(特权) | 是 | [文档][r-ai] | | | argument-injection-medium | 中 | 命令行参数注入(普通) | 是 | [文档][r-ai] | | **检出** | untrusted-checkout | 严重 | 特权上下文中检出不受信任的 PR 代码 | 是 | [文档][r-uco] | | | untrusted-checkout-toctou-critical | 严重 | 带标记事件的 TOCTOU | 是 | [文档][r-toctou-c] | | | untrusted-checkout-toctou-high | 高 | 带部署环境的 TOCTOU | 是 | [文档][r-toctou-h] | | **供应链** | commit-sha | 高 | 操作版本固定验证 | 是 | [文档][r-sha] | | | action-list | 低 | 组织级允许列表/黑名单强制执行 | [文档][r-al] | | | impostor-commit | 严重 | 复刻网络中的冒名提交检测 | 是 | [文档][r-ic] | | | ref-confusion | 高 | 分支/标签名称冲突检测 | 是 | [文档][r-rc] | | | known-vulnerable-actions | 可变 | 通过 GitHub 安全公告检测已知 CVE | 是 | [文档][r-kva] | | | archived-uses | 中 | 已归档操作/工作流检测 | | [文档][r-au] | | | unpinned-images | 中 | 容器镜像摘要固定 | | [文档][r-ui] | | | dependabot-github-actions | 中 | dependabot.yaml 中缺少 github-actions 生态系统 | 是 | [文档][r-dga] | | | reusable-workflow-taint | 严重 | 可复用工作流调用中的不受信任输入 | 是 | [文档][r-rwt] | | **投毒** | artifact-poisoning-critical | 严重 | 工件投毒与路径遍历 | 是 | [文档][r-apc] | | | artifact-poisoning-medium | 中 | 在不受信任的触发器中下载第三方工件 | 是 | [文档][r-apm] | | | cache-poisoning | 高 | 使用不受信任输入的不安全缓存模式 | 是 | [文档][r-cp] | | | cache-poisoning-poisonable-step | 高 | 不安全检出后执行不受信任代码 | 是 | [文档][r-cpp] | | **访问控制** | improper-access-control | 高 | 基于标签的审批和 synchronize 事件 | 是 | [文档][r-iac] | | | bot-conditions | 高 | 可欺骗的机器人检测条件 | 是 | [文档][r-bot] | | | unsound-contains | 中 | 条件中可绕过的 contains() | 是 | [文档][r-uc] | | | dangerous-triggers-critical | 严重 | 无缓解措施的特权触发器 | 是 | [文档][r-dt-c] | | | dangerous-triggers-medium | 中 | 带有部分缓解措施的特权触发器 | 是 | [文档][r-dt-m] | | **其他** | obfuscation | 高 | 混淆的工作流模式检测 | 是 | [文档][r-ob] | | | self-hosted-runners | 高 | 自托管运行器安全风险 | | [文档][r-shr] | | | request-forgery-critical | 严重 | SSRF 漏洞(特权) | 是 | [文档][r-rf] | | | request-forgery-medium | 中 | SSRF 漏洞(普通) | 是 | [文档][r-rf] | | **AI 操作** | ai-action-unrestricted-trigger | 高 | 使用 `allowed_non_write_users: "*"` 的 AI 代理操作 | | [文档][r-aaut] | | | ai-action-excessive-tools | 高 | 在不受信任触发器下暴露危险工具(Bash/Write/Edit) | | [文档][r-aaet] | | | ai-action-prompt-injection | 高 | 将不受信任输入插入到 AI 代理提示中 | | [文档][r-aapi] | | | ai-action-unsafe-sandbox | 高 | 不安全的沙箱 / safety-strategy 设置 | | [文档][r-aaus] | | | ai-action-execution-order | 中 | AI 代理操作未放在任务最后一步 | | [文档][r-aaeo] |
## 示例:检测真实漏洞 给定一个包含多个常见安全错误的工作流: ``` name: PR Comment Handler on: pull_request_target: types: [opened, synchronize] issue_comment: types: [created] jobs: process-pr: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Echo PR title run: | echo "Processing PR: ${{ github.event.pull_request.title }}" - name: Run build run: npm install && npm run build ``` `sisakulint -enable-rule missing-timeout-minutes` 会标记每一行关键内容,并附带代码片段和规则文档链接: ``` .github/workflows/demo.yaml:1:1: workflow does not have explicit 'permissions' block. Follow the principle of least privilege. See https://sisaku-security.github.io/lint/docs/rules/permissions/ [permissions] 1 👈| name: PR Comment Handler .github/workflows/demo.yaml:4:3: dangerous trigger (critical): pull_request_target + issue_comment without any security mitigations. See https://sisaku-security.github.io/lint/docs/rules/dangeroustriggersrulecritical/ [dangerous-triggers-critical] 4 👈| pull_request_target: .github/workflows/demo.yaml:13:9: the action ref should be a full length commit SHA. [commit-sha] 13 👈| - uses: actions/checkout@v4 .github/workflows/demo.yaml:15:16: untrusted PR code checked out in pull_request_target context. See https://sisaku-security.github.io/lint/docs/rules/untrustedcheckout/ [untrusted-checkout] 15 👈| ref: ${{ github.event.pull_request.head.sha }} .github/workflows/demo.yaml:19:35: code injection (critical): github.event.pull_request.title is interpolated into an inline script. See https://sisaku-security.github.io/lint/docs/rules/codeinjectioncritical/ [code-injection-critical] 19 👈| echo "Processing PR: ${{ github.event.pull_request.title }}" [sisaku:🤔] Detected 7 errors in 1 file checked ``` | 发现项 | OWASP | 严重程度 | 自动修复 | |:--------|:------|:---------|:--------:| | 缺少权限块 | CICD-SEC-02 | 高 | 是 | | 危险的特权触发器 | CICD-SEC-01 | 严重 | 是 | | 操作未固定到 SHA | CICD-SEC-08 | 高 | 是 | | 凭据暴露(persist-credentials) | CICD-SEC-06 | 严重 | 是 | | 不受信任的检出 | CICD-SEC-04 | 严重 | 是 | | 代码注入 | CICD-SEC-04 | 严重 | 是 | | 缓存投毒 | CICD-SEC-09 | 高 | 是 | 运行 `sisakulint -fix on`,大部分问题将被就地修复。 ## 自动修复 27+ 条规则附带自动修复器。两种模式: ``` sisakulint -fix dry-run # show diff, don't write sisakulint -fix on # apply changes to YAML files ``` 当前支持自动修复的规则包括:`timeout-minutes`、`commit-sha`、`credentials`、`code-injection-*`、`envvar-injection-*`、`envpath-injection-*`、`output-clobbering-*`、`argument-injection-*`、`request-forgery-*`、`untrusted-checkout`、`untrusted-checkout-toctou-*`、`artifact-poisoning-*`、`cache-poisoning`、`cache-poisoning-poisonable-step`、`cache-bloat`、`artipacked`、`secrets-in-artifacts`、`secrets-inherit`、`secret-in-log`、`secret-exposure`、`unmasked-secret-exposure`、`improper-access-control`、`bot-conditions`、`unsound-contains`、`obfuscation`、`ref-confusion`、`impostor-commit`、`known-vulnerable-actions`、`dangerous-triggers-*`、`cond`、`permissions`、`dependabot-github-actions`、`reusable-workflow-taint`(跨文件的 `ChainFixer` 将被调用者的 `${{ inputs.X }}` 提升为步骤级 `env:`)。 几个代表性的修复:
代码注入 — 将不受信任输入移至 env: 修复前: ``` - run: echo "Processing PR: ${{ github.event.pull_request.title }}" ``` 修复后: ``` - env: PR_TITLE: ${{ github.event.pull_request.title }} run: echo "Processing PR: $PR_TITLE" ```
commit-sha — 将操作标签固定到完整 SHA,并在注释中保留原始标签 修复前: ``` - uses: actions/checkout@v4 - uses: actions/setup-node@v3 ``` 修复后: ``` - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3 ```
untrusted-checkout — 在特权上下文中添加显式 ref 修复前: ``` on: pull_request_target: types: [opened, synchronize] jobs: build: steps: - uses: actions/checkout@v4 ``` 修复后: ``` on: pull_request_target: types: [opened, synchronize] jobs: build: steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.base.ref }} ```
## SARIF + reviewdog 集成 ``` sisakulint -format "{{sarif .}}" # stdout sisakulint -format "{{sarif .}}" > results.sarif # to file sisakulint -format "{{sarif .}}" | reviewdog -f=sarif -reporter=github-pr-review ```
reviewdog showing sisakulint findings inline on a GitHub PR

sisakulint findings rendered inline on a GitHub PR via reviewdog

完整的 GitHub Actions 配方位于[安装 → 作为 GitHub Action](#as-a-github-action-with-reviewdog)。 ## 配置 生成一个起始配置文件: ``` sisakulint -init # writes .github/action.yaml ``` 配置文件允许你设置仓库级别的允许列表、黑名单和规则覆盖。有用的标志: ``` sisakulint -ignore "permissions" -ignore "SC2086" # mute specific rules / patterns sisakulint -enable-rule missing-timeout-minutes # enable an opt-in rule sisakulint -boilerplate # print a hardened workflow skeleton sisakulint -debug # dump AST traversal + rule decisions ``` ### 编辑器自动补全的 JSON Schema 添加到 VS Code `settings.json`: ``` "yaml.schemas": { "https://github.com/sisaku-security/homebrew-sisakulint/raw/main/settings.json": "/.github/workflows/*.{yml,yaml}" } ``` - **始终审查更改**:即使自动修复是自动化的,也请始终在提交审查工作流文件的更改。 - **Commit SHA 修复需要网络**:`commit-sha` 规则需要从 GitHub 获取提交信息,因此需要活跃的网络连接。 - **速率限制**:Commit SHA 自动修复会调用 GitHub API,受速率限制。未认证的请求限制为**每小时 60 次**。设置令牌可将限制提升至 5,000 次/小时: - `SISAKULINT_GITHUB_TOKEN`(首选——作用域限定于此工具) - `GITHUB_TOKEN`(从进程环境读取;在 GitHub Actions 步骤中,你必须显式映射,例如 `env: GITHUB_TOKEN: ${{ github.token }}`——运行器不会自动将 `secrets.GITHUB_TOKEN` 导出到 `run:` 步骤) - `GH_TOKEN`(由 `gh auth login` 设置) - `-github-token "$(gh auth token)"`(CLI 标志,优先级最高) - 一个具有 `public_repo`(或对你固定的目标仓库仅有 `Metadata: Read-only`)的细粒度 PAT 就足够了。当 sisakulint 启动时未检测到令牌,现在会打印一个警告。如果运行中速率限制耗尽,sisakulint 将以非零退出码中止,并跳过写入受影响文件的部分输出,而不会在磁盘上留下部分固定和部分未固定的操作混合状态。 - **备份文件**:建议在运行自动修复之前提交更改或备份工作流文件。 - **并非所有规则都支持自动修复**:某些规则(如 `expression`、`permissions`、`issue-injection`、`cache-poisoning` 和 `deprecated-commands`)需要手动修复,因为它们依赖于你的具体用例。 - **自动修复能力**:目前,`timeout-minutes`、`commit-sha`、`credentials`、`untrusted-checkout` 和 `artifact-poisoning` 规则支持自动修复。未来版本中更多规则将支持自动修复。 ## 架构
sisakulint architecture diagram
``` .github/workflows/*.yml │ ▼ [ AST parser ] ──► [ Expression parser (${{ }}) ] │ │ ▼ ▼ [ Shell parser (mvdan.cc/sh) ] [ Taint propagator ] │ │ └───────────► [ Rule engine ] ◄───── 50+ rules │ ┌─────────────┴─────────────┐ ▼ ▼ [ Error formatter ] [ Auto-fixer ] │ │ ▼ ▼ SARIF / pretty text in-place YAML rewrite ``` - **AST 解析器** — `pkg/ast`、`pkg/core/parse_*.go` - **表达式解析器** — `pkg/expressions`(完整的 GitHub Actions `${{ }}` 语法) - **Shell 解析器与污点分析** — `pkg/shell`(作用域感知的 bash 语义、函数参数传播) - **规则引擎** — `pkg/core/*rule.go`,实现访问者模式 - **自动修复器** — `pkg/core/autofixer.go` ## BlackHat Arsenal 2025
sisakulint at BlackHat Arsenal 2025 **[▶️ 幻灯片](https://speakerdeck.com/4su_para/sisakulint-ci-friendly-static-linter-with-sast-semantic-analysis-for-github-actions)** · **[📥 PDF](https://files.speakerdeck.com/presentations/8047bdafc1db4bdb9a5dbc0a5825e5e2/BlackHatArsenal2025.pdf)** · **[📄 SecHack365 海报](https://sechack365.nict.go.jp/achievement/2023/pdf/14C.pdf)** · **[📺 演讲录像](https://www.youtube.com/watch?v=DhgqKOmzLSk)** Watch the sisakulint talk on YouTube
sisakulint 在 **BlackHat Asia 2025 Arsenal** 上展示。演讲涵盖了 SAST 设计、针对 GitHub Actions 安全的语义分析方法、自动修复流水线以及真实的 OWASP CI/CD Top 10 案例。最初是 NICT 旗下 [SecHack365](https://sechack365.nict.go.jp/) 2023 项目。 ## 贡献指南 欢迎提交 Bug 报告、规则建议和 PR。 - 在 提交问题 - 添加新规则:参见 [`docs/RULES_GUIDE.md`](docs/RULES_GUIDE.md) 和 [`script/actions/`](script/actions/) 下的示例工作流 - 运行测试套件:`go test ./...` - 对自带示例运行:`sisakulint script/actions/` 如果 sisakulint 帮助你了保障工作流安全,请为仓库点⭐️——这将帮助其他安全团队更容易发现它。 ## 许可证 [Apache License 2.0](LICENSE) © sisaku-security 贡献者。 ## 引用 如果在学术或行业工作中引用 sisakulint: ``` @software{sisakulint, title = {sisakulint: CI-friendly static linter with SAST semantic analysis for GitHub Actions}, author = {sisaku-security contributors}, year = {2025}, url = {https://github.com/sisaku-security/sisakulint} } ``` [r]: https://sisaku-security.github.io/lint/rules/code-injection
标签:CI/CD安全, DevSecOps, DoH影响, EVTX分析, GitHub Actions, Go语言, Llama, OWASP Top 10, SAST, Shell taint分析, XSS注入, 上游代理, 云安全监控, 凭证泄露, 可重用工作流, 安全修复, 安全扫描, 开源安全工具, 日志审计, 时序注入, 模块化设计, 注入检测, 盲注攻击, 程序破解, 管道安全, 自动修复, 自动化修复, 自动笔记, 表达式解析, 跨步骤分析, 逆向工程平台, 静态分析, 黑帽大会