Scan your whole stack
Are you using @dtapp/ci-templates?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.0.1-nightly.20261128
@dtapp/ci-templates was last scanned on 28 Nov 2026 at version 1.0.1-nightly.20261128. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.0.1-nightly.20261128 LATEST | 28 Nov 2026 | No rules fired |
| 1.0.1-nightly.20261127 | 27 Nov 2026 | No rules fired |
| 1.0.0 | 26 Nov 2026 | No rules fired |
| 0.0.1-nightly.20261126 | 26 Nov 2026 | Not shown |
| 0.0.0-stage | 26 Nov 2026 | Not shown |
Findings for v1.0.1-nightly.20261128. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.0.1-nightly.20261128; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
CNB(云原生构建)流水线模板与配套脚本仓库。业务仓库通过 .cnb.yml 的 include 引用本仓库的 YAML,即可复用代码评审、安全扫描、SCA、Code Wiki 与知识库构建,并把结果统一推送到企业微信 / 飞书 / 钉钉。
| 文件 | 触发事件 | 作用 |
|---|---|---|
code-review.yml |
pull_request |
调用 cnbcool/code-review 做 AI 代码评审,输出 code_review.json,渲染后通知三个 IM 平台 |
cnb-sechook.yml |
pull_request |
读取 cnbcool/cnb-sechook 生成的 sec_overview.md,汇总敏感信息与漏洞统计并通知 |
sca.yml |
push、pull_request.target |
开源组件漏洞 / License 全量与增量扫描、SBOM 生成;PR 侧开启 high 门禁,结果通过 endStages 通知 |
code-security-config.yml |
pull_request |
调用 cnbcool/code-security-config validate 自检代码安全扫描配置 |
codewiki.yml |
tag_push、web_trigger_codewiki |
生成 Code Wiki,文档写入 /${CNB_BUILD_WORKSPACE}/${CNB_REPO_SLUG}/codewiki |
knowledge-base.yml |
push、tag_push、issue.* |
构建知识库,并在 Issue 创建 / 关闭 / 重开 / 更新 / 评论时同步 |
在目标仓库根目录的 .cnb.yml 中按需 include:
include:
- https://cnb.cool/dtapp/ci-templates/-/blob/main/code-review.yml
- https://cnb.cool/dtapp/ci-templates/-/blob/main/cnb-sechook.yml
- https://cnb.cool/dtapp/ci-templates/-/blob/main/sca.yml
说明:
https://cnb.cool/<repo-slug>/-/blob/<ref>/<file>;生产环境建议把 main 换成固定的分支或 tag,避免模板变更影响构建。.cnb.yml 覆盖 include 的内容,include 数组中后引入的文件覆盖先引入的文件。imports 从私有仓库 https://cnb.cool/dtapp/envs/-/blob/main/webhook.yml 注入 webhook 密钥;跨仓库引用时需要在该配置文件中配置 allow_slugs / allow_events 等访问权限。WECOM_BOT_WEBHOOK、FEISHU_BOT_WEBHOOK、DINGTALK_BOT_WEBHOOK、DINGTALK_BOT_SECRET。模板中的通知 stage 均设置了 allowFailure: true,通知失败不会阻塞主流程。scripts/ci/render-ci-notice.sh 不存在时从 https://cnb.cool/dtapp/ci-templates/-/git/raw/main/scripts/ci/render-ci-notice.sh 下载,因此构建环境需要能访问 cnb.cool。也可以提前把脚本复制到目标仓库的同名路径,跳过下载。更多背景见 CNB 文档:文件引用、语法手册 · include、触发规则。
scripts/ci/render-ci-notice.sh 是三个通知模板共用的 POSIX sh 脚本,把插件输出统一渲染成三种平台的正文:
sh scripts/ci/render-ci-notice.sh sechook [输出.md]
sh scripts/ci/render-ci-notice.sh review [输出.md]
sh scripts/ci/render-ci-notice.sh sca full|diff [输出.md]
sh scripts/ci/render-ci-notice.sh --self-test
每次渲染会生成:
<name>_notice.md:Markdown 版,链接为 [查看详情](URL),供企业微信 fromFile 和钉钉 content 使用;<name>_notice.txt:纯文本版,URL 裸写,供脚本内部继续转换;<name>_notice_feishu.json:飞书 post 富文本,链接是可点击的 a 标签。正文通过 ##[set-output ...] 以 base64 导出,对应 key 分别为 scan / scan_text、review / review_text、sca / sca_text。脚本依赖 jq、curl、base64、date,流水线中使用镜像 docker.cnb.cool/dtapp/alpine:latest;本地自检需先安装 jq。
scripts/ci/fetch-scripts.sh)scripts/ci/fetch-scripts.sh 是给业务仓库用的自举脚本:文件顶部固定各源地址和一份脚本清单,运行时按清单把脚本下载到与模板仓库完全一致的相对路径。业务仓库只要保留这一个文件,就不必手工复制或逐个跟版本。
首次接入时在业务仓库根目录执行(落盘路径与模板仓库一致,仍是 scripts/ci/fetch-scripts.sh;推荐走 CNB):
mkdir -p scripts/ci
curl -fsSL https://cnb.cool/dtapp/ci-templates/-/git/raw/main/scripts/ci/fetch-scripts.sh -o scripts/ci/fetch-scripts.sh
chmod +x scripts/ci/fetch-scripts.sh
sh scripts/ci/fetch-scripts.sh # 再按清单拉齐其余脚本
之后日常同步只需:
sh scripts/ci/fetch-scripts.sh # 同步:缺失的下载,已存在的比 sha256,不同则更新
sh scripts/ci/fetch-scripts.sh --force # 不做比对,已存在也直接覆盖
sh scripts/ci/fetch-scripts.sh --check # 只查存在性(不下载、不比对),缺失时退出码 1
sh scripts/ci/fetch-scripts.sh --list # 查看清单与候选源顺序
sh scripts/ci/fetch-scripts.sh --npm-version 0.0.1-nightly.20261126 # 指定 npm 包版本或 dist-tag
源分三类:四个仓库源、npm CDN、npm registry 与镜像,固定顺序为 CNB → GitHub → Gitee → GitLab → jsdelivr → unpkg → npm → npmmirror → tencent(包已发布到 npm:@dtapp/ci-templates)。脚本探测当前 CI 平台并用同平台仓库作为起点源,起点源排第一;其余源一律按上述固定顺序尝试,所以四个仓库源始终在 npm 源之前(GitHub 环境下 cnb / gitee / gitlab 也会排在 npmmirror 前面,不会被挪到末尾);一个都匹配不上(本地开发等)时默认 CNB。某个源取不到文件(超时、404)会自动换下一个源,回退是每个文件独立的,全部失败才报错;加 --no-fallback 可关掉回退。也可用 --source 指定起点源,CI_TEMPLATES_REF 固定仓库分支或 tag(默认 main),CI_TEMPLATES_NPM_VERSION 固定 npm 版本或 dist-tag(默认 latest)。
各平台下载地址格式不同:GitLab 是 /-/raw/<ref>/<path>,Gitee 是 /raw/<ref>/<path>(302 到内容域,靠 curl -L 跟随)。
npm 源分两种取法:jsDelivr(cdn.jsdelivr.net/npm/<包>@<版本>/<path>)和 unpkg(unpkg.com/<包>@<版本>/<path>,app.unpkg.com 只是文件浏览界面)能按路径直接取单文件;官方 registry 和镜像(registry.npmjs.org / registry.npmmirror.com / mirrors.cloud.tencent.com/npm)只有整包接口,脚本会先把 <包>-<版本>.tgz 下载到临时目录(每次运行每个镜像最多一次)再用 tar -xzOf 取单个文件,因此这类源额外依赖 tar。latest / dist-tag 会先向对应 registry 解析成具体版本号,整包路径里用具体版本。
本地已有同名文件时不会直接信任:先下载远端内容算 sha256,与本地一致就跳过、不一致就覆盖,所以仓库里不会停着旧版本脚本。下载先写临时文件、比对通过才 mv,失败不会破坏已有文件;.sh 必须以 #! 开头才落盘,避免把错误页面写成脚本。当前清单:scripts/ci/delete-release.sh、scripts/ci/describe-artifact.sh、scripts/ci/render-ci-notice.sh。
时间 / 日期的取值与时区约定见 scripts/ci/time-and-date.md(CNB 用北京时间,其余用 UTC)。
Makefile 提供配置 / 文档类文件的格式化入口,底层是 scripts/format.sh:
make format # YAML + JSON + SQL + Markdown + Dockerfile + Shell
make format-yaml # 仅 YAML,其余同理:format-json / format-sql / format-markdown / format-docker / format-shell
scripts/format.sh yaml # 直接调用脚本,支持 yaml|json|sql|shell|markdown|docker|all
FORMAT_STRICT=1 make format # 工具缺失时直接失败(默认只打印安装提示并跳过)
涉及工具:yamlfmt、gojq、sql-formatter、markdownfmt、shfmt、dockerfmt。脚本不会自动安装工具,缺失时会打印对应的 go install 命令。格式化目标路径和参数集中在 scripts/format.sh 顶部的「可自定义配置区」,移植到其他项目时只需修改这一段。
make minify-shell 把 scripts/ 下的 shell 脚本生成紧凑副本,产物在 dist/minify/(已加入 .gitignore),原文件不动:
make minify-shell # 压缩全部 .sh
make minify # 全部压缩产物(目前只有 Shell)
scripts/minify.sh shell a.sh b.sh # 只压指定文件
MINIFY_OUT=build/min make minify # 换产物目录
压缩会删掉整行注释和空行,但有三处必须原样保留,否则脚本会被改坏:shebang;第 2 行到第一个空行的头部注释块(delete-release.sh / fetch-scripts.sh 的 usage() 靠 sed -n '2,/^$/p' "$0" 从这里取正文,删了 --help 就废);以及 heredoc 内部(脚本清单、自检用例都在里面)。行首缩进同样不动。
每个产物写入前都会过两道校验:按 shebang 选 sh -n / bash -n 做语法检查,并比对头部用法段与原文件一致;任一不通过就报错且不写盘。
Makefile 中的 sync / push / push-force 用于同时操作多个远程,远程列表来自 GIT_REMOTE(逗号分隔),优先级为:环境变量 > .env > 默认值 origin。
GIT_REMOTE=origin,github make sync
sync 会依次 fetch 并 merge --ff-only,然后向所有远程 push;push-force 会执行 git push --force,使用前请确认影响。
见 LICENSE 文件。
CNB
GitHub
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.