ci/security-scan-apt-timeouts #70

Merged
james merged 2 commits from ci/security-scan-apt-timeouts into main 2026-11-20 03:15:11 +00:00
Owner
No description provided.
The main-branch run after #69 hung for over two hours in a silent
apt-get update. Add per-request apt timeouts and retries, install only
missing packages, and cap the step at 15 minutes and the job at 30.
ci: share a bounded apt install across all workflows
All checks were successful
test / coverage-badge (pull_request) Has been skipped
codecov/patch 100.00% >= target 80%
test / web (pull_request) Successful in 1m16s
codecov/project 54.97% (No base report)
test / go (pull_request) Successful in 4m46s
claude-review / review (pull_request) Successful in 6m37s
security-scan / security-scan (pull_request) Successful in 26s
46fe5502e0
build, claude-review and test ran the same unbounded apt-get as
security-scan. Move the install into scripts/ci-apt-install.sh, which
skips packages already present and times out stalled requests, and give
each install step a 15-minute cap.
james merged commit 29492d9c0e into main 2026-11-20 03:15:11 +00:00
james deleted branch ci/security-scan-apt-timeouts 2026-11-20 03:15:12 +00:00

🔎 ojo scan results

No findings.

<!-- ojo-scan-summary --> ### 🔎 ojo scan results No findings.

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 5549 uncovered lines.


Generated by Codecov Action

<!-- codecov-action-results --> ## Codecov Results 📊 :white_check_mark: Patch coverage is **100.00%**. Project has **5549** uncovered lines. --- *Generated by [Codecov Action](https://github.com/getsentry/codecov-action)*

Summary

CI jobs could hang indefinitely: the main run after #69 sat in a silent apt-get update for over two hours. This PR moves every workflow's inline apt-get update && apt-get install into a shared scripts/ci-apt-install.sh. The script skips packages that are already installed and sets apt network timeouts and retries (Acquire::http(s)::Timeout=30, Acquire::Retries=3). Each install step now has a 15-minute cap. The PR also adds job caps: security-scan 30 min, build 60 min. claude-review already had a 40-minute cap.

The changes match the commit messages. The PR metadata does not describe them: the title is the branch name (ci/security-scan-apt-timeouts) and the description is empty. The second commit also changes build.yml, claude-review.yml and test.yml, which the title doesn't suggest.

Findings

  1. Nit — scripts/ci-apt-install.sh:92: dpkg -s "$pkg" exits 0 for a package that was removed but not purged (Status: deinstall ok config-files). That package would be reported as installed and skipped, so a later step fails on a missing binary. This is unlikely on fresh runner images. Fix: dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q 'install ok installed' || missing+=("$pkg").
  2. Nit — scripts/ci-apt-install.sh:100-101: DEBIAN_FRONTEND is not set. The old inline commands didn't set it either, so this is not a regression. But the script exists to stop apt hanging, and a debconf prompt is another way it can stall. Fix: add export DEBIAN_FRONTEND=noninteractive near the top.
  3. Nit — scripts/ci-apt-install.sh:94-96: with no arguments the script prints already installed: and exits 0. Consider exiting with a usage error when $# -eq 0.

No correctness or security problems found:

  • Every changed workflow runs actions/checkout before calling the script (build.yml:22, claude-review.yml:22, security-scan.yml:19, test.yml:44).
  • Steps run from the repo root: the lcov step at test.yml:58-61 has no working-directory, so scripts/... resolves correctly.
  • In claude-review.yml, running a script from the checkout is not a new trust boundary. The job already runs scripts/claude-pr-review.sh from the checkout, and it is limited to same-repo PRs (claude-review.yml:14).

The tenant-isolation, secrets, crypto and RBAC conventions in AGENTS.md don't apply because no application code changed.

Completeness

  • Not run by this PR's CI:

    • The build.yml path, which triggers only on workflow_dispatch or schedule.
    • The lcov step in test.yml, which runs only on push.

    Only security-scan and claude-review used the new script on this PR. Trigger build-and-push manually once after merge to confirm it.

  • I could not check whether 30 minutes is enough for security-scan on main, or 60 minutes for build. The PR's security-scan took 26s, but main runs also upload findings and the SBOM, and the Docker build runtime is unknown. The commit messages give no evidence for these caps.

  • There is no test for ci-apt-install.sh. Other scripts have scripts/test_*.sh tests, but a skip-logic test is optional for a script this small.

  • No API, migration, frontend or AGENTS.md changes are needed. STATUS.md has no CI section, so leaving it unchanged is reasonable.

  • No leftover TODOs or debug code.

  • The PR title and description need updating (see Summary).

CI and comments

  • codecov/patch: success (100.00% >= target 80%)
  • codecov/project: success (54.97%, no base report)
  • security-scan / security-scan (pull_request): success (26s)
  • test / go (pull_request): success (4m46s)
  • test / web (pull_request): success (1m16s)
  • test / coverage-badge (pull_request): skipped (runs only on push)

Comments:

  • ojo security scan: no findings, so nothing introduced or pre-existing to report.
  • Codecov: patch coverage 100%; the project has 5549 uncovered lines. No Go or TS code changed, so these numbers say nothing about this PR.
  • Reviewer comments: none, so nothing unaddressed.

Recommendations

Before merging:

  1. Give the PR a real title and description covering all four workflows and the new script.
  2. Optionally, add DEBIAN_FRONTEND=noninteractive and the dpkg-query status check to scripts/ci-apt-install.sh.

Follow-ups:

  1. Run build-and-push manually once after merge to exercise the new install path and the 60-minute cap.
  2. Watch the first main security-scan run against the 30-minute job cap.

Verdict

Ready to merge: a small, correct CI hardening change, and the only open items are nits and missing PR metadata.


Claude code review of 46fe5502e0 · claude-opus-5-5

<!-- claude-pr-review --> ### Summary CI jobs could hang indefinitely: the `main` run after #69 sat in a silent `apt-get update` for over two hours. This PR moves every workflow's inline `apt-get update && apt-get install` into a shared `scripts/ci-apt-install.sh`. The script skips packages that are already installed and sets apt network timeouts and retries (`Acquire::http(s)::Timeout=30`, `Acquire::Retries=3`). Each install step now has a 15-minute cap. The PR also adds job caps: security-scan 30 min, build 60 min. claude-review already had a 40-minute cap. The changes match the commit messages. The PR metadata does not describe them: the title is the branch name (`ci/security-scan-apt-timeouts`) and the description is empty. The second commit also changes `build.yml`, `claude-review.yml` and `test.yml`, which the title doesn't suggest. ### Findings 1. **Nit** — `scripts/ci-apt-install.sh:92`: `dpkg -s "$pkg"` exits 0 for a package that was removed but not purged (`Status: deinstall ok config-files`). That package would be reported as installed and skipped, so a later step fails on a missing binary. This is unlikely on fresh runner images. Fix: `dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q 'install ok installed' || missing+=("$pkg")`. 2. **Nit** — `scripts/ci-apt-install.sh:100-101`: `DEBIAN_FRONTEND` is not set. The old inline commands didn't set it either, so this is not a regression. But the script exists to stop apt hanging, and a debconf prompt is another way it can stall. Fix: add `export DEBIAN_FRONTEND=noninteractive` near the top. 3. **Nit** — `scripts/ci-apt-install.sh:94-96`: with no arguments the script prints `already installed: ` and exits 0. Consider exiting with a usage error when `$# -eq 0`. No correctness or security problems found: - Every changed workflow runs `actions/checkout` before calling the script (`build.yml:22`, `claude-review.yml:22`, `security-scan.yml:19`, `test.yml:44`). - Steps run from the repo root: the `lcov` step at `test.yml:58-61` has no `working-directory`, so `scripts/...` resolves correctly. - In `claude-review.yml`, running a script from the checkout is not a new trust boundary. The job already runs `scripts/claude-pr-review.sh` from the checkout, and it is limited to same-repo PRs (`claude-review.yml:14`). The tenant-isolation, secrets, crypto and RBAC conventions in `AGENTS.md` don't apply because no application code changed. ### Completeness - **Not run by this PR's CI:** - The `build.yml` path, which triggers only on `workflow_dispatch` or `schedule`. - The `lcov` step in `test.yml`, which runs only on `push`. Only security-scan and claude-review used the new script on this PR. Trigger `build-and-push` manually once after merge to confirm it. - I could not check whether 30 minutes is enough for security-scan on `main`, or 60 minutes for build. The PR's security-scan took 26s, but `main` runs also upload findings and the SBOM, and the Docker build runtime is unknown. The commit messages give no evidence for these caps. - There is no test for `ci-apt-install.sh`. Other scripts have `scripts/test_*.sh` tests, but a skip-logic test is optional for a script this small. - No API, migration, frontend or `AGENTS.md` changes are needed. `STATUS.md` has no CI section, so leaving it unchanged is reasonable. - No leftover TODOs or debug code. - The PR title and description need updating (see Summary). ### CI and comments - `codecov/patch`: **success** (100.00% >= target 80%) - `codecov/project`: **success** (54.97%, no base report) - `security-scan / security-scan (pull_request)`: **success** (26s) - `test / go (pull_request)`: **success** (4m46s) - `test / web (pull_request)`: **success** (1m16s) - `test / coverage-badge (pull_request)`: **skipped** (runs only on `push`) Comments: - **ojo security scan:** no findings, so nothing introduced or pre-existing to report. - **Codecov:** patch coverage 100%; the project has 5549 uncovered lines. No Go or TS code changed, so these numbers say nothing about this PR. - **Reviewer comments:** none, so nothing unaddressed. ### Recommendations Before merging: 1. Give the PR a real title and description covering all four workflows and the new script. 2. Optionally, add `DEBIAN_FRONTEND=noninteractive` and the `dpkg-query` status check to `scripts/ci-apt-install.sh`. Follow-ups: 1. Run `build-and-push` manually once after merge to exercise the new install path and the 60-minute cap. 2. Watch the first `main` security-scan run against the 30-minute job cap. ### Verdict **Ready to merge**: a small, correct CI hardening change, and the only open items are nits and missing PR metadata. --- _Claude code review of 46fe5502e0 · claude-opus-5-5_
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ColibriSec/balam!70
No description provided.