Repository navigation
ci(sim): check browser image and dependency security - #4
Conversation
|
Noah Williams · reviewer The browser step starts the bridge without 浏览器那一步启动 bridge 时没有设置 |
|
Ingrid Larsen · author Yes. It runs from the repository root after 能。这一步在 |
|
Mateo Rossi · reviewer Trivy fails on HIGH as well as CRITICAL. A base-image CVE will block unrelated pull requests. Trivy 在 HIGH 级别也会失败。基础镜像出一个 CVE 就会挡住无关的拉取请求。 |
|
Ingrid Larsen · author That is intended. The base image is pinned by digest, and Renovate opens the update for it, so the fix lands in one pull request instead of being ignored everywhere. 这是有意的。基础镜像按摘要固定,由 Renovate 发起更新,修复会集中在一个拉取请求里完成,而不是在各处被忽略。 |
Why
Pull requests should run the same checks contributors run locally, exercise the page in a real browser, and stop if the container image ships known high or critical vulnerabilities.
What changed
.github/workflows/ci.yml, triggered onpull_requestonly, with read-onlycontentspermission, a 25-minute timeout and a concurrency group that cancels superseded runs.checkjob installs pnpm 10.20.0, sets up Node from.nvmrcwith the pnpm cache, then runspnpm install --frozen-lockfile,pnpm lint,pnpm typecheck,pnpm testandpnpm build.scripts/fake-gates.mjs, and runse2e/entrance.spec.ts.gatepost-sim:ci, uploads an SPDX SBOM asgatepost-sim.spdx.jsonwithanchore/sbom-action, and scans the image withaquasecurity/trivy-action, failing onCRITICAL,HIGH. Every action is pinned by commit SHA.renovate.json(config:recommended, labeldependencies).How to verify
Open a pull request and check that the
checkjob runs every step. Locally, the image steps can be reproduced with:docker build -t gatepost-sim:ci .背景
拉取请求应该跑贡献者在本地跑的同一套检查,在真实浏览器里验证页面,并且在容器镜像带有已知高危或严重漏洞时拦下来。
改动
.github/workflows/ci.yml:只在pull_request时触发,contents权限只读,超时 25 分钟,并用并发组取消被新提交取代的运行。check任务安装 pnpm 10.20.0,按.nvmrc配置 Node 并启用 pnpm 缓存,然后依次运行pnpm install --frozen-lockfile、pnpm lint、pnpm typecheck、pnpm test、pnpm build。scripts/fake-gates.mjs,运行e2e/entrance.spec.ts。gatepost-sim:ci镜像,用anchore/sbom-action生成 SPDX 格式的 SBOM 并上传为gatepost-sim.spdx.json,再用aquasecurity/trivy-action扫描镜像,发现CRITICAL,HIGH级别漏洞即失败。所有 action 都按提交 SHA 固定。renovate.json(config:recommended,标签dependencies)。怎么验证
发起一个拉取请求,确认
check任务的每一步都执行了。镜像相关步骤可在本地这样重现:docker build -t gatepost-sim:ci .