Skip to content

fix(security): remediate Docker code scanning alerts - #699

Merged
Soju06 merged 3 commits into
mainfrom
chore/security-code-scanning-hardening-20260518
May 19, 2026
Merged

Soju06 merged 3 commits into
mainfrom
chore/security-code-scanning-hardening-20260518

Conversation

@Soju06

@Soju06 Soju06 commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

Remediates the current Docker/Trivy code-scanning findings by refreshing vulnerable runtime packages, removing build tooling from runtime images, and making CI upload current Trivy SARIF for main instead of relying only on release-tag scans.

Type of change

  • fix: — bug fix (no behavior change beyond the bug)
  • feat: — new user-facing feature or capability
  • refactor: — internal refactor (no behavior change, no API change)
  • docs: — documentation only
  • chore: / ci: / build: — tooling, CI, packaging
  • test: — test-only change
  • Breaking change

Linked issue: N/A — GitHub code-scanning alerts.

OpenSpec

  • This PR includes / updates an OpenSpec change
  • Not applicable — bug fix that matches the existing spec
  • Not applicable — docs / CI / chore only
  • This PR touches a codex-faithful path (image pipeline, request/response shape, SSE framing, OAuth flow) and preserves upstream-equivalent behavior

Change directory: N/A

Changes

  • Refresh vulnerable Python packages in the lockfile/runtime image:
    • aiohttp 3.13.3 → 3.13.5
    • cryptography 46.0.5 → 48.0.0
    • Pygments 2.19.2 → 2.20.0
    • Mako 1.3.10 → 1.3.12
    • python-dotenv 1.2.1 → 1.2.2
    • python-multipart 0.0.22 → 0.0.29
    • urllib3 2.6.3 → 2.7.0
  • Stop shipping uv, uvx, and pip in runtime images by using a no-pip venv and removing Python packaging tools before the final image.
  • Upgrade fixed Debian runtime packages during image build for the OS-level Trivy findings.
  • Upload CI Docker Trivy SARIF to GitHub Security for current branch/main scans and enforce a CRITICAL,HIGH image gate.
  • Expand release SARIF uploads to include LOW/MEDIUM/HIGH/CRITICAL findings so the Security tab has complete visibility.

Test plan

uv lock --check
uv sync --frozen --dev
uv run ruff check .
uv run ruff format --check .
uv run ty check
uv run pytest -q -ra --timeout=180 --timeout-method=thread --durations=20
python3 - <<'PY'
from pathlib import Path
import yaml
for p in ['.github/workflows/ci.yml', '.github/workflows/release.yml']:
    yaml.safe_load(Path(p).read_text())
PY
openspec validate --specs
DOCKER_BUILDKIT=1 docker build -t codex-lb:security-hardening .
DOCKER_BUILDKIT=1 docker build -f Dockerfile.distroless -t codex-lb:security-hardening-distroless .
docker run --rm --entrypoint /bin/sh codex-lb:security-hardening -c 'for bin in pip pip3 pip3.13 uv uvx; do ! command -v "$bin"; done'
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$HOME/.cache/trivy:/root/.cache/" aquasec/trivy:latest image --scanners vuln --ignore-unfixed --severity CRITICAL,HIGH,MEDIUM,LOW --format table codex-lb:security-hardening
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$HOME/.cache/trivy:/root/.cache/" aquasec/trivy:latest image --scanners vuln --ignore-unfixed --severity CRITICAL,HIGH,MEDIUM,LOW --format table codex-lb:security-hardening-distroless

Results:

  • uv run pytest: 2407 passed, 7 skipped, 4 warnings
  • Trivy standard Docker image: debian 0, python-pkg 0
  • Trivy distroless Docker image: debian 0, python-pkg 0
  • Runtime image check confirms no pip, pip3, pip3.13, uv, or uvx on PATH.

Screenshots / output (optional)

N/A

Checklist

  • Title is in Conventional Commits format (<type>(<scope>)?: <subject>).
  • Linked the related issue / discussion above, or marked N/A.
  • Added or updated tests covering the change, or verified through dependency/image scan gates.
  • Ran uv run ruff check . and uv run ruff format --check . locally.
  • Ran uv run pytest and all tests pass.
  • If touching specs: openspec validate --specs passes and /opsx:verify is clean.
  • CHANGELOG is not edited by hand (release-please handles it).

@Soju06

Soju06 commented May 18, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08c5c36544

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Resolved
@Soju06

Soju06 commented May 18, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 397714c047

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Resolved
@Soju06

Soju06 commented May 18, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Komzpa Komzpa added the 🤖 codex: ok [@codex review] says no issues found. label May 18, 2026
Soju06 added 3 commits May 18, 2026 16:07
- Refresh vulnerable Python packages surfaced by Trivy/code scanning
- Keep uv and pip out of runtime images after dependency installation
- Patch fixed Debian runtime packages in Docker images before scanning
- Upload CI Docker Trivy SARIF for current main and gate high severity findings
Use the existing release Docker-image code-scanning category for CI Trivy uploads so pull request comparisons line up with the current main-branch baseline.
- Grant actions: read to the Docker security scan job for upload-sarif compatibility
- Use a CI-specific SARIF category on push while preserving the existing PR baseline category until the workflow lands on main
@Komzpa
Komzpa force-pushed the chore/security-code-scanning-hardening-20260518 branch from de76312 to cff1add Compare May 18, 2026 12:08
@Komzpa Komzpa removed the 🤖 codex: ok [@codex review] says no issues found. label May 18, 2026
@Komzpa

Komzpa commented May 18, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Komzpa Komzpa added the 🤖 codex: ok [@codex review] says no issues found. label May 18, 2026
@Soju06
Soju06 merged commit de24c2e into main May 19, 2026
19 checks passed
@Soju06
Soju06 deleted the chore/security-code-scanning-hardening-20260518 branch May 19, 2026 01:20
Soju06 added a commit that referenced this pull request May 19, 2026
## [1.18.2](v1.18.1...v1.18.2) (2026-05-19)


### Bug Fixes

* **api-keys:** map enforced service_tier auto/default to outbound omission ([#611](#611)) ([9a64e23](9a64e23))
* **api-keys:** size usage reservations from request budget ([#706](#706)) ([ea72eea](ea72eea))
* **dashboard:** derive quota status from usage windows ([#686](#686)) ([c463def](c463def))
* **dashboard:** make weekly credit pace backend-driven ([#692](#692)) ([313783c](313783c))
* **db:** recover stale reservations and serialize sqlite writers ([#667](#667)) ([6635628](6635628))
* **model-refresh:** refresh HTTP client on transport errors ([#547](#547)) ([2087df0](2087df0))
* **models:** report full context in v1 metadata ([#681](#681)) ([c3c977d](c3c977d))
* **proxy:** cap selector "Try again in" hint at 300s ([#690](#690)) ([cf09bd6](cf09bd6)), closes [#676](#676) [#678](#678)
* **proxy:** eliminate /v1 responses cancel/retry stream contamination ([#696](#696)) ([c9da497](c9da497))
* **proxy:** harden long Codex websocket turns ([#674](#674)) ([12bec0f](12bec0f))
* **proxy:** include sticky thread in budget-pressure guard ([#514](#514)) ([1e2c6d6](1e2c6d6))
* **proxy:** keep idle timeout classification after scheduler jitter ([#693](#693)) ([17e8abc](17e8abc))
* **proxy:** mask partial previous-response stream errors ([#689](#689)) ([a4a138c](a4a138c))
* **proxy:** persist request logs outside cancellation ([#688](#688)) ([6e8fa56](6e8fa56))
* **proxy:** repair interrupted Codex response continuity ([#698](#698)) ([682447f](682447f))
* **proxy:** trim durable full-resend continuations ([#687](#687)) ([dfc38c0](dfc38c0))
* **security:** remediate Docker code scanning alerts ([#699](#699)) ([de24c2e](de24c2e))


### Documentation

* add AnobleSCM as a contributor for code, and test ([#695](#695)) ([718931e](718931e))
* add jgorostegui as contributor ([#697](#697)) ([d9d5a6e](d9d5a6e))
* add linusmixson as contributor ([#705](#705)) ([f3ad60a](f3ad60a))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
vitalNohj pushed a commit to vitalNohj/codex-lb that referenced this pull request Jul 17, 2026
Remediate Docker-related code scanning alerts and harden Trivy SARIF upload behavior.
vitalNohj pushed a commit to vitalNohj/codex-lb that referenced this pull request Jul 17, 2026
## [1.18.2](Soju06/codex-lb@v1.18.1...v1.18.2) (2026-05-19)


### Bug Fixes

* **api-keys:** map enforced service_tier auto/default to outbound omission ([Soju06#611](Soju06#611)) ([ce0d1ea](Soju06@ce0d1ea))
* **api-keys:** size usage reservations from request budget ([Soju06#706](Soju06#706)) ([f3b1689](Soju06@f3b1689))
* **dashboard:** derive quota status from usage windows ([Soju06#686](Soju06#686)) ([acb4133](Soju06@acb4133))
* **dashboard:** make weekly credit pace backend-driven ([Soju06#692](Soju06#692)) ([383ccd4](Soju06@383ccd4))
* **db:** recover stale reservations and serialize sqlite writers ([Soju06#667](Soju06#667)) ([79dced5](Soju06@79dced5))
* **model-refresh:** refresh HTTP client on transport errors ([Soju06#547](Soju06#547)) ([f0b38a0](Soju06@f0b38a0))
* **models:** report full context in v1 metadata ([Soju06#681](Soju06#681)) ([82bd538](Soju06@82bd538))
* **proxy:** cap selector "Try again in" hint at 300s ([Soju06#690](Soju06#690)) ([1242bc1](Soju06@1242bc1)), closes [Soju06#676](Soju06#676) [Soju06#678](Soju06#678)
* **proxy:** eliminate /v1 responses cancel/retry stream contamination ([Soju06#696](Soju06#696)) ([d7f3cea](Soju06@d7f3cea))
* **proxy:** harden long Codex websocket turns ([Soju06#674](Soju06#674)) ([0828e63](Soju06@0828e63))
* **proxy:** include sticky thread in budget-pressure guard ([Soju06#514](Soju06#514)) ([e9d5b84](Soju06@e9d5b84))
* **proxy:** keep idle timeout classification after scheduler jitter ([Soju06#693](Soju06#693)) ([0860872](Soju06@0860872))
* **proxy:** mask partial previous-response stream errors ([Soju06#689](Soju06#689)) ([4563488](Soju06@4563488))
* **proxy:** persist request logs outside cancellation ([Soju06#688](Soju06#688)) ([684b1dc](Soju06@684b1dc))
* **proxy:** repair interrupted Codex response continuity ([Soju06#698](Soju06#698)) ([0e8232a](Soju06@0e8232a))
* **proxy:** trim durable full-resend continuations ([Soju06#687](Soju06#687)) ([e017bfc](Soju06@e017bfc))
* **security:** remediate Docker code scanning alerts ([Soju06#699](Soju06#699)) ([1b012f6](Soju06@1b012f6))


### Documentation

* add AnobleSCM as a contributor for code, and test ([Soju06#695](Soju06#695)) ([e95cfca](Soju06@e95cfca))
* add jgorostegui as contributor ([Soju06#697](Soju06#697)) ([4974c52](Soju06@4974c52))
* add linusmixson as contributor ([Soju06#705](Soju06#705)) ([ed41ae0](Soju06@ed41ae0))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 codex: ok [@codex review] says no issues found.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants