Skip to content

fix(security): enforce package review on Debian/Ubuntu and Homebrew installs + fix CodeQL workflow anchor - #1201

Merged
PyRo1121 merged 1 commit into
mainfrom
fix/install-security-debian-homebrew-codeql
Dec 1, 2026
Merged

PyRo1121 merged 1 commit into
mainfrom
fix/install-security-debian-homebrew-codeql

Conversation

@PyRo1121

@PyRo1121 PyRo1121 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes the two OS package manager install security gaps and resolves CodeQL alert #169:

  1. Debian / Ubuntu (src/cli/packages/install/debian.rs):
    • Previously called enforce_install_policy per top-level package, which skipped scanner.assess_packages under the default AdvisoryRequirement::Optional policy and did not inspect transitive APT dependencies.
    • Added parse_apt_simulation_inventory to parse Inst <name> [<old>] (<version> ... [<arch>]) lines from apt-get -s install -- (offloaded via spawn_blocking) and routes the full resolved transaction inventory through package_review::review_async (batched via VulnerabilityScanner::new(), surfacing explicit coverage gaps if simulation is unavailable).
  2. macOS / Homebrew (src/cli/packages/install/generic.rs):
    • Previously passed SecurityOrigin::Unknown for Homebrew packages (causing assess_packages to skip advisory lookup even under strict policy) and skipped under default Optional policy.
    • Maps Backend::MacOS (Homebrew) to SecurityOrigin::DistributionPackage and routes live installs through package_review::review_async.
  3. CodeQL Alert test(ci): align sync fixtures and fuzz lock #169 (.github/workflows/ci.yml):
    • Expanded the &native-linux-env / *native-linux-env YAML anchor in ci.yml so CodeQL's GitHub Actions parser (actions/syntax-error) parses ci.yml cleanly with zero syntax warnings.

Verification

  • Verified cli::packages::install:: unit tests in Ubuntu 24.04 WSL (Rust 1.95.0, --no-default-features): 14 passed, 0 failed, 0 warnings (including homebrew_uses_distribution_origin_for_advisory_screening).
  • Verified parse_apt_simulation_inventory against real apt-get -s install -- jq output on Ubuntu 24.04 WSL (Inst libonig5, Inst libjq1, Inst jq, plus upgrade [old] (new) and :arch unit test coverage).

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@snyk-io

snyk-io Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@PyRo1121
PyRo1121 force-pushed the fix/install-security-debian-homebrew-codeql branch 9 times, most recently from c2aafb5 to 8ef84eb Compare December 1, 2026 21:30
@PyRo1121
PyRo1121 force-pushed the fix/install-security-debian-homebrew-codeql branch from 8ef84eb to 1557b80 Compare December 1, 2026 21:59
@PyRo1121
PyRo1121 merged commit 96ff8ce into main Dec 1, 2026
66 of 68 checks passed
@PyRo1121
PyRo1121 deleted the fix/install-security-debian-homebrew-codeql branch December 1, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants