Repository navigation
Conversation
Answer "should we trust this package at all?" for every dependency a pull request adds. reputation.py diffs each changed lockfile (npm, pnpm, yarn, requirements*.txt, poetry, uv, go.sum, Cargo.lock) against the base commit and asks deps.dev about every package@version only on the head side: OSV advisories (MAL-* means malicious), the source repository and its OpenSSF Scorecard, and the latest release date. Responses are cached one JSON per package@version and carried between runs with actions/cache. Gates: a MAL-* advisory blocks when fail-on-malicious is set, a Scorecard score below min-scorecard blocks (0 disables); a stale latest release, an unknown package and a missing Scorecard only warn. The reusable workflow runs the composite on the PR diff, uploads the findings and keeps one PR comment edited in place. CI runs the differ and gate fixtures offline, the composite on this repo's own diff, and one live deps.dev lookup from a throwaway repo that adds requests, so the client and cache are proven against the real API. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
A lockfile version string is pull-request input. Unencoded it could carry path separators into the cache file name and, through the mkdir on the write side, land a response JSON outside the cache directory. Encode the version like the name and refuse any resolved path outside cache-dir. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
… for Dependency Review The test script tripped shellcheck SC2016 on a backticked grep pattern. MegaLinter on this base still lints recorded fixtures, so exclude them the same way the threat-feeds change does. Dependency Review needs api.deps.dev and api.securityscorecards.dev once a PR adds a dependency GitHub has no repository URL for, as the fixture lockfiles here do. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
Dependency ReviewThe following issues were found:
License Issuestests/dependency-reputation/fixtures/head/package-lock.json
tests/dependency-reputation/fixtures/base/package-lock.json
tests/dependency-reputation/fixtures/base/pnpm-lock.yaml
tests/dependency-reputation/fixtures/base/yarn.lock
tests/dependency-reputation/fixtures/head/pnpm-lock.yaml
tests/dependency-reputation/fixtures/head/poetry.lock
tests/dependency-reputation/fixtures/head/yarn.lock
OpenSSF ScorecardScorecard details
Scanned Files
|
Dependency Review resolved lodash and moment in the recorded lockfiles and blocked on their advisories. The differ only needs names and versions, so use names no registry has, as the syft fixture already does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
Dependency Review resolved left-pad to its WTFPL licence, which the allow-list rejects. The fixture only needs a name and a version. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #111. Stacked on #139 (
issue-83-egress-block) fordocs/egress-allowlist.mdand the block-mode CI pattern; retarget tomainonce that merges.What
.github/actions/dependency-reputation: stdlib-onlyreputation.py. Diffs every changed lockfile betweenbase-shaandHEAD(git showfor the base side) and takes thepackage@versionpairs only on the head side, so version bumps count and removals do not. Parsers forpackage-lock.json,pnpm-lock.yaml,yarn.lock(v1 and berry),requirements*.txt(==pins),poetry.lock,uv.lock,Cargo.lock(viatomllib) andgo.sum. For each added package the deps.dev v3 client fetches the version (OSV advisory ids, related projects), the source project (OpenSSF Scorecard overall score and the Maintained, Dangerous-Workflow, Binary-Artifacts, Signed-Releases checks) and the package (latestpublishedAt). Responses are cached one JSON persystem/package@version;--offlinenever fetches.MAL-*advisory blocks whenfail-on-malicious(default true); Scorecard score belowmin-scorecardblocks (0 disables); latest release older thanmax-age-days(730), unknown package (404) and no Scorecard only warn. Annotations at the lockfile line, step summary and markdown report (<!-- dependency-reputation -->marker, one row per package),findings.json, outputsadded-count,blocking-count,report-path. Exit 1 blocking, 2 unsupported ecosystem. Nobase-sha(push runs) passes with a notice. Lockfiles under**/tests/**,**/test/**,**/fixtures/**are skipped by default (exclude).dependency-reputation.ymlreusable workflow with the inputs from the issue plusexclude,comment,actions-ref;actions/cacheon the deps.dev cache (deps-dev-restore prefix),dependency-reputationartefact, one PR comment edited in place (fork PRs skipped). Caller grantspull-requests: writefor the comment.Dependency Reputationjob (egressgithub.com,api.github.com,api.deps.dev): offline fixtures, the composite on this repo's own PR diff, then a live lookup from a throwaway repo that addsrequests==2.34.2and asserts one added package with a Scorecard and a written cache entry.docs/egress-allowlist.mdrow.Tests
tests/dependency-reputation/run.shbuilds a throwaway git repo fromfixtures/baseandfixtures/head(every lockfile format, each with an added package, plus a version bump, a removal and a scoped pnpm package that must not count) and runs the script offline against a seeded cache: healthy, low-score,MAL-*, stale, 404 and no-Scorecard packages. Asserts the exact added set with file and line, the per-gate outcomes and exit codes, annotation placement, report rows, ecosystem filter, exclude globs, offline cache miss, and the no-base and bad-ecosystem paths.The
VulnerabilitiesScorecard column from the issue is omitted: deps.dev does not carry that check, so the advisories column covers it. Maven and NuGet have no lockfile parser (documented).Deferred
🤖 Generated with Claude Code
https://claude.ai/code/session_01NPH9145e4gFo6bmXvMgBoF