8000 Audit dependencies on every change and on a weekly schedule by irfan-dahir · Pull Request #675 · jikan-me/jikan · GitHub
[go: up one dir, main page]

Skip to content

Audit dependencies on every change and on a weekly schedule - #675

Open
irfan-dahir wants to merge 1 commit into
masterfrom
ci/dependency-audit
Open

irfan-dahir wants to merge 1 commit into
masterfrom
ci/dependency-audit

Conversation

@irfan-dahir
Copy link
Copy Markdown
Collaborator

Adds .github/workflows/security.yaml: composer audit on push to master, on every PR, and weekly on a cron.

Why this shape

The repository deliberately does not commit composer.lock (it is in .gitignore — this is a library). That has a consequence worth stating, because it surprised me:

  • A fresh install already resolves the newest patch release inside jikan's constraints, so CI was never pinned to the vulnerable versions. The six advisories composer audit reported locally (symfony/http-client 8.1.8, symfony/config 8.1.5, symfony/filesystem 8.1.6, symfony/yaml 8.1.8, phpunit 13.4.2) came from a stale local vendor/, not from anything CI would install. There is nothing to patch in the repository — bumping constraints to ^8.1.11 would over-constrain a library for no gain.
  • What a gate can still catch is the case a resolve cannot fix: an advisory with a fix only outside jikan's constraints. That needs a decision — a constraint bump or an accept — and today nothing surfaces it.

Hence the split:

Step Blocking Why
composer audit --no-dev yes A runtime advisory is the only kind that can reach a consumer of the library
composer audit no (continue-on-error) Dev-tool advisories (phpunit, php-cs-fixer, grumphp, infection) are build-machine only; an unavailable patch must not block unrelated PRs

The weekly cron is the part that would have mattered on 2026-11-11: those advisories appeared long after the last dependency change, and Dependabot — although configured, with alerts and security fixes enabled — has never opened a PR here and reports 0 open alerts, so GitHub is not surfacing them.

Notes

  • New check name: composer audit. Add it to the required checks in branch protection if you want it to gate merges; right now it reports alongside Quality/Tests.
  • No CHANGELOG.md entry: CI-only, no consumer-visible change.

The repository deliberately does not commit composer.lock, so a fresh
install already resolves the newest patch release inside jikan's
constraints; a pinned-version gate is not possible and would not have
helped. What this adds is a check for the case that resolve cannot fix:
an advisory with no release inside the constraints, which a weekly run
finds even when nothing in the repository changed.

Production advisories fail the build because require-dev never reaches a
consumer; dev-tool advisories are reported without blocking, so an
unavailable patch for phpunit or grumphp cannot hold up unrelated work.
@irfan-dahir
Copy link
Copy Markdown
Collaborator Author

End-to-end check of the gate itself (ran locally today, 2026-11-12), since a workflow that only ever passes proves nothing:

Clean tree — fresh clone of this branch, composer install --no-scripts (no lock committed, so a fresh resolve):

composer audit --no-dev   → exit 0
composer audit            → exit 0

Vulnerable tree — same clone, symfony/http-client pinned to 8.1.8 (the version that carried two advisories):

composer audit --no-dev   → exit 1, advisory table printed (CVE-2026-121971 / GHSA-gq53-v8w2-gjhj)
composer audit            → exit 1

So the blocking step fails the job for a runtime advisory, the way it is supposed to, and the advisory is not swallowed by the non-blocking dev step. Nothing else changed.

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

0