Skip to content

Audit dependencies with Laravel Vet - #3

Merged
JustSteveKing merged 1 commit into
refresh/laravel-13-api-toolboxfrom
vet-dependency-audit
Oct 20, 2026
Merged

JustSteveKing merged 1 commit into
refresh/laravel-13-api-toolboxfrom
vet-dependency-audit

Conversation

@JustSteveKing

Copy link
Copy Markdown
Owner

Stacked on #2; GitHub retargets it to main when #2 merges.

composer audit only knows published advisories, so a freshly compromised release passes it, and the daily bot would open a PR for it. Laravel Vet (beta, v0.2.1) closes that gap.

What it does

  • vet.json trust file. It records the version and file hash of each of the 150 packages. composer install fails on anything not recorded, including a version re-published with different files.
  • Release-age hold. minimum-release-age: 7 keeps every release younger than a week out of composer update. Two exclusions:
    • juststeveking/*, because those packages are first-party.
    • roave/security-advisories, because it is dev-latest and re-publishes with every advisory. A hold makes it uninstallable and delays exactly what it exists to block.
  • Baseline. The baseline is today's lock moved back to releases at least a week old. Fourteen packages step down a patch or minor as a result, for example laravel/framework 13.37.0 to 13.35.0 and guzzle 8.3.0 to 8.2.0. Tests and PHPStan pass on them.

The bot

  • Cadence. It now runs weekly, on Mondays at 03:00 UTC.
  • Expected failure. A non-interactive composer update writes the lock and then exits 1, because nothing new is trusted yet. The workflow tolerates that, but still fails on a real resolution error.
  • Report. The workflow installs the new lock with --no-plugins and puts vet's list of what needs review in the PR body.
  • No CI on the bot's own commit. PRs opened with GITHUB_TOKEN don't trigger other workflows, so CI doesn't run on the bot's commit. The gate takes effect when you push vet.json to the bot branch after reviewing (composer install --no-plugins, then ./vendor/bin/vet), and that push runs CI. If you want CI on the bot commit itself, the workflow needs a PAT or GitHub App token as a secret.

Checked locally

  • A tampered hash in vet.json fails composer install, and a fresh install from an empty vendor/ passes with all 150 trusted.
  • Dry run of the workflow steps with the hold set to 0: the update writes the lock, the steps carry on, and the report lists the 14 newer releases in about 1.5 KB.

85 tests pass; composer lint and composer stan are clean.

composer audit only knows published advisories, so a freshly
compromised release passes it and the dependency bot would open a PR
for it. Laravel Vet closes that gap as a Composer plugin:

- vet.json records what has been read; composer install fails on
  anything else, including a version re-published with other files.
- minimum-release-age holds back every release younger than 7 days.
  juststeveking/* and roave/security-advisories are excluded: the first
  are first-party, the second has to be current to protect anything.

The baseline is today's lock moved back to releases at least a week
old, which is why fourteen packages step down a patch or minor
(laravel/framework 13.37.0 to 13.35.0, guzzle 8.3.0 to 8.2.0).

The dependency bot moves to weekly. Vet refuses the update it writes,
so the workflow tolerates that, installs the new lock without the
plugin, and puts Vet's report in the PR body. The PR passes CI once
vet.json is updated on its branch.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8ac140a0-79d4-488d-bf39-8ded77177104

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JustSteveKing
JustSteveKing merged commit eb6f6f3 into refresh/laravel-13-api-toolbox Oct 20, 2026
7 checks passed
@JustSteveKing
JustSteveKing deleted the vet-dependency-audit branch October 20, 2026 09:52
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.

1 participant