Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/praetorian-inc/trajan
静态分析漏洞扫描器代码分析配置审计云安全DevSecOps秘密检测威胁情报供应链安全错误配置
GitHubpraetorian-inc/trajan

trajan

一个多平台的CI/CD漏洞检测与攻击自动化工具,用于识别管道配置中的安全弱点。

176135天前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
查看仓库
trajan

Trajan:CI/CD 安全扫描器

Trajan 扫描 CI/CD 流水线中的安全漏洞,这些漏洞常被攻击者用于攻陷软件供应链。它支持 GitHub Actions、GitLab CI、Azure DevOps、Jenkins 和 JFrog。

Go Version License

功能

Trajan 解析工作流 YAML 文件、构建依赖关系图、运行检测插件,并通过内置的攻击能力验证漏洞的可利用性。

  • 跨多个 CI/CD 平台的 32 个检测插件
  • 跨多个 CI/CD 平台的 24 个攻击插件
  • 基于图的污点追踪与门控检测分析
  • 基于浏览器的扫描器(通过 WebAssembly,无需后端)
  • 多阶段攻击链,自动传递上下文

[!NOTE] Trajan 正在积极开发中。部分功能可能不完整,存在不完善之处。如果遇到问题,请提出 issue。

安装

预编译的二进制文件可在发布页面获取。

root@kitploit:~
go install github.com/praetorian-inc/trajan/cmd/trajan@latest

或从源码构建:

root@kitploit:~
git clone https://github.com/praetorian-inc/trajan.git
cd trajan && make build

环境要求

  • Go 1.24 或更高版本
  • GitHub 个人访问令牌(私有仓库需 repo 权限,公开仓库仅需 public_repo 权限)

库 SDK(pkg/lib)

Trajan 可嵌入为 Go 库,用于编程式 CI/CD 安全扫描。pkg/lib 包提供了一个公共 SDK,将 Trajan 的内部平台注册表、检测引擎和扫描器封装为单个高级 API。

快速开始(库方式)

root@kitploit:~
import "github.com/praetorian-inc/trajan/pkg/lib"

result, err := lib.Scan(ctx, lib.ScanConfig{
    Platform:    "github",
    Token:       os.Getenv("GH_TOKEN"),
    Org:         "myorg",
    Repo:        "myrepo",
    Concurrency: 10,
    Timeout:     5 * time.Minute,
})
if err != nil {
    log.Fatal(err)
}

for _, f := range result.Findings {
    fmt.Printf("[%s] %s in %s: %s\n", f.Severity, f.Type, f.WorkflowFile, f.Evidence)
}

SDK API

ScanConfig

root@kitploit:~
type ScanConfig struct {
    Platform    string        // CI/CD 平台(必需)
    Token       string        // API 认证令牌
    BaseURL     string        // 自托管实例的自定义基础 URL
    Org         string        // 组织/所有者名称
    Repo        string        // 仓库名称(空表示扫描该组织所有仓库)
    Concurrency int           // 并行检测工作线程数(默认:10)
    Timeout     time.Duration // 最长扫描持续时间(默认:5m)
    LocalPath   string        // 离线扫描的本地文件系统路径(文件或目录)
}

ScanResult

root@kitploit:~
type ScanResult struct {
    Findings          []detections.Finding   // 检测到的安全漏洞
    Workflows         []platforms.Workflow   // 发现的 CI/CD 工作流文件
    Errors            []error                // 扫描过程中的非致命错误
    SkippedDetections []string               // LocalPath 模式下跳过的检测名称(仅 API 方式);API 模式扫描中始终为空
}

集成示例(Chariot 平台)

该 SDK 被 Chariot 攻击面管理平台使用,作为其 CI/CD 安全扫描能力:

root@kitploit:~
import trajanlib "github.com/praetorian-inc/trajan/pkg/lib"

result, err := trajanlib.Scan(ctx, trajanlib.ScanConfig{
    Platform: platformName,
    Token:    token,
    Org:      repo.Org,
    Repo:     repo.Name,
})
// 将 result.Findings → capmodel.Risk emissions

快速使用

root@kitploit:~
# 扫描 GitHub 仓库
export GH_TOKEN=ghp_your_token
trajan github scan --repo owner/repo

# 扫描 GitHub 组织
trajan github scan --org myorg --concurrency 20

# 扫描 GitLab 项目
export GITLAB_TOKEN=glpat_your_token
trajan gitlab scan --group mygroup

# 扫描 Azure DevOps
export AZURE_DEVOPS_PAT=your_pat
trajan ado scan --org myorg --repo myproject/myrepo

# 离线扫描:扫描本地工作流文件,无需 API 访问
trajan github scan --path ./my-repo
trajan github scan --path ./.github/workflows/ci.yml

# JSON 输出
trajan github scan --repo owner/repo -o json > results.json

详细用法、检测解释和攻击演练请参考Wiki。

平台覆盖

浏览器扩展

Trajan 也可编译为 WebAssembly 二进制文件,以单个 HTML 文件形式在浏览器中独立运行。它使用与 CLI 相同的检测引擎、攻击插件和枚举逻辑,仅编译为 WASM。Trajan 的 Web 版本可在评估期间以低摩擦方式交付到目标环境。

root@kitploit:~
make wasm       # 构建 browser/trajan.wasm
make wasm-dist  # 构建独立的 trajan-standalone.html

架构

root@kitploit:~
graph TD
    subgraph CLI
        CMD[Cobra Commands]
    end

    subgraph Platforms
        GH[GitHub]
        GL[GitLab]
        ADO[Azure DevOps]
        JK[Jenkins]
        JF[JFrog]
    end

    CMD --> GH & GL & ADO & JK & JF

    subgraph SF[Scan Flow]
        API[Platform API] --> |fetch workflows| YAML[Workflow YAML]
        YAML --> P

        subgraph P[Parser]
            direction LR
            GHP[GitHub] ~~~ GLP[GitLab] ~~~ ADP[Azure] ~~~ JKP[Jenkins]
        end

        P --> NW[Normalized Workflow]
        NW --> GB[Graph Builder]
        GB --> Graph[Workflow → Job → Step Graph]
    end

    subgraph AE[Analysis Engine]
        direction LR
        TT[Taint Tracker] --> Tagged[Tagged Graph]
        Tagged --> DP[Detection Plugins]
        DP --> GA[Gate Analysis]
        GA --> Findings
    end

    subgraph AF[Attack Flow]
        direction LR
        AP[Attack Plugins] --> |artifacts| Session[Session Tracker]
        Session --> Cleanup
    end

    Graph --> AE
    AE --> AF

路线图

其他 CI/CD 平台的支持正在积极开发中:

  • Bitbucket Pipelines
  • CircleCI
  • AWS CodePipeline
  • Google Cloud Build

贡献

请参见 CONTRIBUTING.md 了解开发指南、插件编写和项目结构。

致谢

基于 Gato、Glato、Adnan Khan 的 Gato-X 以及 GitHub Security Lab 的研究成果构建。

许可证

Apache 2.0。参见 LICENSE。

下载工具
函数描述
lib.Scan(ctx, cfg)完整扫描:平台初始化 → 工作流发现 → 检测执行
lib.GetPlatform(name)按名称获取平台适配器(github、gitlab、azuredevops、bitbucket、jenkins、jfrog)
lib.ListPlatforms()列出所有已注册的平台名称
lib.GetDetections(platform)获取特定平台的检测插件
lib.GetDetectionsForPlatform(platform)获取特定平台及跨平台的检测项
lib.ListDetectionPlatforms()列出已注册检测项的平台
平台检测项攻击项枚举
GitHub Actions119token、repos、secrets
GitLab CI83token、projects、groups、secrets、runners、branch-protections
Azure DevOps69token、projects、repos、pipelines、connections、agent-pools、users、groups 等
Jenkins73access、jobs、nodes、plugins
JFrog仅扫描--