CI/CD 流水线反模式分析器 —— 检测硬编码密钥、缺失缓存配置、跳过测试、不安全的部署、缺少审批关卡,以及环境……
管道Lint - CI/CD 管道反相式分析器.是一项面向实际任务的技能,主要用于PipelineLint扫描 CI/CD 管道反相式的密码库,硬码密钥,缓存配置缺失,测试跳过,不安全解析。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
PipelineLint 扫描代码库中的 CI/CD 流水线反模式,包括:硬编码密钥、缺失的缓存配置、跳过的测试、不安全的部署操作、缺少审批门禁、未固定版本的依赖项,以及环境配置问题。它基于正则表达式匹配 6 大类共 90 个流水线专属检测模式,通过 lefthook 集成 Git 钩子,并生成含可操作修复建议的 Markdown 报告。100% 本地运行,零遥测数据。
pipelinelint scan [file|directory]对指定文件或目录执行一次性流水线质量扫描。
执行方式:
bash "/scripts/dispatcher.sh" --path [target]
功能说明:
典型使用场景示例:
pipelinelint scan .pipelinelint scan .github/workflows/ci.ymlpipelinelint scan .pipelinelint scan .pipelinelint scan .pipelinelint scan --tier pro [file|directory]增强型扫描,覆盖 60 个模式,涵盖密钥管理、缓存策略、测试实践与依赖安全性。
执行方式:
bash "/scripts/dispatcher.sh" --path [target] --tier pro
功能说明:
pipelinelint scan --format json [directory]生成 JSON 格式输出,便于集成至 CI/CD 系统。
bash "/scripts/dispatcher.sh" --path [directory] --format json
pipelinelint scan --format html [directory]生成 HTML 格式报告,适用于浏览器查看。
bash "/scripts/dispatcher.sh" --path [directory] --format html
pipelinelint scan --category SE [directory]限定扫描范围至特定检查类别(SE、CF、TS、AR、DP、EN)。
bash "/scripts/dispatcher.sh" --path [directory] --category SE
pipelinelint scan --tier team [directory]全量扫描,覆盖全部 90 个模式,涵盖六大类别,包括部署安全性与环境配置检查。
执行方式:
bash "/scripts/dispatcher.sh" --path [directory] --tier team
功能说明:
pipelinelint scan --verbose [directory]启用详细输出模式,显示每一处匹配的代码行及其对应模式详情。
bash "/scripts/dispatcher.sh" --path [directory] --verbose
pipelinelint status显示许可证状态与当前配置信息。
bash "/scripts/dispatcher.sh" status
PipelineLint 在 6 大类别中共检测 90 种 CI/CD 流水线反模式:
| 类别 | 代号 | 模式数量 | 说明 | 严重性范围 |
|---|---|---|---|---|
| 密钥与安全(Secrets & Security) | SE | 15 | 硬编码密码、YAML 中的 API 密钥、日志中泄露的令牌、curl 命令中嵌入的凭据、内联 SSH 密钥 | high – critical |
| 缓存与性能(Caching & Performance) | CF | 15 | npm/pip/maven 未启用缓存、重复安装、缺失依赖缓存、Docker 构建缓慢 | low – medium |
| 测试与质量(Testing & Quality) | TS | 15 | 跳过测试、禁用代码检查(linting)、未强制要求覆盖率、滥用 --no-verify 标志、滥用 continue-on-error | medium – high |
| 制品与依赖(Artifacts & Dependencies) | AR | 15 | Docker Tag 未固定版本、curl-to-shell 调用、未经验证的下载行为、禁用 SSL 校验、GitHub Actions 直接引用分支而非标签 | medium – high |
| 部署安全性(Deployment Safety) | DP | 15 | 无审批门禁、强制推送、Terraform 自动批准、破坏性 SQL 操作、无回滚策略 | high – critical |
| 环境与配置(Environment & Configuration) | EN | 15 | 硬编码 localhost、无超时设置、无重试机制、明文 HTTP URL、硬编码数据库连接字符串 | low – high |
| 版本 | 支持模式数 | 支持类别 |
|---|---|---|
| 免费版 | 30 | SE、CF |
| 专业版 | 60 | SE、CF、TS、AR |
| 团队版 | 90 | SE、CF、TS、AR、DP、EN |
| 企业版 | 90 | SE、CF、TS、AR、DP、EN + 优先技术支持 |
PipelineLint 采用减分制评分模型,起始分为 100(满分):
| 严重性等级 | 每次扣分 | 说明 |
|---|---|---|
| Critical | -25 分/项 | 存在安全漏洞或部署安全风险 |
| High | -15 分/项 | 重大流水线问题(如跳过测试、不安全依赖) |
| Medium | -8 分/项 | 中等风险问题(如缺失缓存、环境配置错误) |
| Low | -3 分/项 | 信息提示类 / 最佳实践建议 |
| 评级 | 分数区间 | 含义 |
|---|---|---|
| A | 90–100 | 优秀的流水线配置 |
| B | 80–89 | 配置良好,仅存在少量问题 |
| C | 70–79 | 基本可用,但需改进 |
| D | 60–69 | 流水线质量较差 |
| F | 低于 60 | 存在关键性流水线问题 |
用户可在 ~/.openclaw/openclaw.json 中配置 PipelineLint:
{
"skills": {
"entries": {
"pipelinelint": {
"enabled": true,
"apiKey": "YOUR_LICENSE_KEY_HERE",
"config": {
"severityThreshold": "medium",
"ignorePatterns": ["**/test/**", "**/fixtures/**", "**/*.test.*"],
"ignoreChecks": [],
"reportFormat": "text"
}
}
}
}
}
用户可能提出如下请求: