h3lium4u/taintflow-action

GitHub: h3lium4u/taintflow-action

一款基于上下文敏感污点分析的离线 SAST GitHub Action,用于在 CI/CD 流水线中检测 Java 和 Python 代码库的安全漏洞。

Stars: 0 | Forks: 0

# TaintFlow SAST GitHub Action 此 action 在您的 CI/CD pipeline 中运行 **TaintFlow SAST** 扫描器,以检测 Java 和 Python 代码库中上下文敏感的数据流和安全漏洞。 ## 🌟 功能 - **离线 SAST:** 不向任何外部服务器发送源代码或元数据。 - **上下文敏感的 Taint 分析:** 跨作用域跟踪复杂的变量流,将 source 解析到不安全的 sink。 - **多语言支持:** 完全支持 Java 和 Python。 - **标准化输出:** 支持控制台日志、JSON 报告,以及用于 GitHub Security 告警的 SARIF v2.1.0 输出。 - **Docker 驱动:** 在利用预构建的静态 Docker 二进制文件的轻量级、沙盒化 runner 环境中运行。 ## 🚀 用法 创建或更新 workflow 文件(例如 `.github/workflows/security-scan.yml`): ``` name: Security Scan on: pull_request: push: jobs: taintflow: runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 - name: Run TaintFlow SAST Scan uses: h3lium4u/taintflow-action@v1 with: path: '.' format: 'sarif' severity: 'LOW' output: 'taintflow.sarif' - name: Upload SARIF Report if: always() uses: github/codeql-action/upload-sarif@v3 with: sarif_file: taintflow.sarif ``` ## 📋 输入 | 输入 | 描述 | 必需 | 默认值 | | :--- | :--- | :--- | :--- | | **`path`** | 工作区内要扫描的相对路径。 | 否 | `.` | | **`format`** | 输出报告格式(`text`、`json`、`sarif`)。 | 否 | `text` | | **`severity`**| 最低严重性阈值(`LOW`、`MEDIUM`、`HIGH`)。 | 否 | `LOW` | | **`output`** | 输出报告文件路径。 | 否 | `""` | ## 📊 输出 | 输出 | 描述 | | :--- | :--- | | **`result`** | 扫描器的控制台输出。 | ## 🔒 GitHub Code Scanning 集成 TaintFlow SAST 支持与 GitHub Code Scanning 的原生集成。通过以 SARIF v2.1.0 格式输出分析结果,可以直接在您代码库的 **Security** 标签页中查看安全告警和过程间 taint 流图。 ### 设置 Workflow 示例 ``` name: TaintFlow Security Scan on: pull_request: push: branches: - main jobs: taintflow: runs-on: ubuntu-latest permissions: security-events: write contents: read steps: - uses: actions/checkout@v4 - name: Run TaintFlow uses: h3lium4u/taintflow-action@v1 with: path: . format: sarif output: taintflow-results.sarif - name: Upload SARIF uses: github/codeql-action/upload-sarif@v3 with: sarif_file: taintflow-results.sarif ``` ### 查看结果 漏洞将显示在 Security 中心: ![GitHub Security 告警界面占位图](https://raw.githubusercontent.com/h3lium4u/taintflow-action/main/docs/images/security_tab_preview.png)
标签:DevSecOps, IPv6支持, JS文件枚举, Python, 上游代理, 代码安全审计, 无后门, 请求拦截, 逆向工具, 静态应用安全测试