Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions .github/workflows/dependency-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: dependency-updates

on:
schedule:
- cron: '0 3 * * *'
- cron: '0 3 * * 1'
workflow_dispatch:

permissions:
Expand All @@ -24,18 +24,46 @@ jobs:
tools: composer:v2
coverage: none

- name: Install current dependencies
run: composer install --no-interaction --no-progress --prefer-dist --no-scripts

# Vet's plugin keeps every release younger than vet.json's minimum-release-age out of the
# update. It then refuses to install what nobody has trusted yet and exits 1, after the lock
# file is written. That refusal is expected here: the pull request carries the review.
- name: Update Composer dependencies
run: composer update --no-interaction --no-progress --prefer-dist --no-scripts
run: |
composer update --no-interaction --no-progress --prefer-dist --no-scripts --no-ansi 2>&1 | tee update.log || true
if grep -q 'could not be resolved' update.log; then
exit 1
fi

- name: Install the updated lock without Vet
run: composer install --no-plugins --no-interaction --no-progress --prefer-dist --no-scripts

- name: Audit with Vet
run: |
./vendor/bin/vet --no-interaction --no-ansi > vet-report.txt 2>&1 || true
{
echo 'Automated weekly dependency refresh: `composer update`, holding back every release younger than `minimum-release-age` in `vet.json`.'
echo
echo '## Vet'
echo
echo '```'
cat vet-report.txt
echo '```'
echo
echo 'Untrusted packages fail `composer install` in CI. To review, check out this branch, run `composer install --no-plugins`, then `./vendor/bin/vet` in a terminal: read each change, or hand them to your coding agent, and pick the packages you trust. Commit `vet.json` to this branch; that push runs CI.'
} > pr-body.md
rm update.log vet-report.txt

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: 'bot: dependency updates'
title: 'bot: dependency updates'
body: |
Automated daily dependency refresh.

- Ran `composer update`
- Updated lockfile and related dependency constraints
body-path: pr-body.md
add-paths: |
composer.json
composer.lock
branch: bot/dependency-updates
delete-branch: true
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,29 @@ Relevant config/env:
and joins or starts a W3C trace (`traceparent`); both land in the log context
- Security-sensitive auth/token actions emit structured `security.audit` log events
- Configurable transport hardening for HTTPS enforcement, HSTS, trusted proxies/hosts, and strict CORS origins
- Dependencies are audited with [Laravel Vet](https://github.com/laravel/vet): nothing is installed
until someone has read it, and no release younger than 7 days is installed at all

## Dependency Audit (Vet)

`composer audit` only knows about published advisories, so a freshly compromised release passes
it. [Laravel Vet](https://github.com/laravel/vet) (beta) covers that gap as a Composer plugin:

- `vet.json` records the version and file hash of every package someone has read. `composer
install` fails on anything else, including the same version re-published with different files.
- `minimum-release-age: 7` keeps every release younger than a week out of `composer update`, so a
bad release has time to be found and pulled. `juststeveking/*` and `roave/security-advisories`
are excluded: the first are first-party, the second has to be current to be any use.

After `composer update`, review what changed and record what you trust:

```bash
./vendor/bin/vet # in a terminal: read each change, or hand them to your coding agent
```

Commit `vet.json` with `composer.lock`. If you build your own project from Kit, `vet.json` is the
trust Kit recorded; run `./vendor/bin/vet --fresh` to take it over as your own, or remove
`laravel/vet` if you do not want the gate.

## Idempotency

Expand Down Expand Up @@ -331,9 +354,11 @@ GitHub Actions workflows:
- `.github/workflows/ci-tests.yml`
- Runs Pint, PHPStan and the test suite on every push and pull request
- `.github/workflows/dependency-updates.yml`
- Runs daily at `03:00 UTC`
- Executes `composer update`
- Opens/updates PR titled `bot: dependency updates`
- Runs weekly, Mondays at `03:00 UTC`
- Executes `composer update`, holding back releases younger than 7 days
- Opens/updates PR titled `bot: dependency updates` with Vet's report of what needs review
- The PR cannot pass CI until `vet.json` is updated on its branch: check it out, run
`composer install --no-plugins`, then `./vendor/bin/vet`, and commit `vet.json`
- `.github/workflows/security-gate.yml`
- Runs Composer security audit
- Fails on high/critical advisories
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"laravel/boost": "^2.4",
"laravel/pail": "^1.2.5",
"laravel/pint": "^1.27",
"laravel/vet": "^0.2",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"parsedown/parsedown": "1.7.4",
Expand Down Expand Up @@ -103,7 +104,8 @@
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
"php-http/discovery": true,
"laravel/vet": true
}
},
"minimum-stability": "stable",
Expand Down
Loading
Loading