Skip to content

Scaffolding for uv audit#18119

Merged
woodruffw merged 2 commits intomainfrom
ww/uv-audit
Mar 3, 2026
Merged

Scaffolding for uv audit#18119
woodruffw merged 2 commits intomainfrom
ww/uv-audit

Conversation

@woodruffw
Copy link
Copy Markdown
Member

@woodruffw woodruffw commented Feb 20, 2026

Summary

This provides the scaffolding (CLI and initial uv-audit crate) for a uv audit subcommand.

Closes #9189.

Tracking:

Things that also need to be done with the MVP:

  • We should not audit workspace members by default (by definition, they don't exist on indices and therefore don't have meaningful results from vulnerability services). Filter down to auditable packages #18322
  • I need to ensure groups/etc. are being filtered by correctly, right now we audit every single package in the lockfile unconditionally.

Test Plan

Unit and integration tests commensurate with the new functionality.

@woodruffw woodruffw self-assigned this Feb 20, 2026
@woodruffw woodruffw added the enhancement New feature or improvement to existing functionality label Feb 20, 2026
@woodruffw woodruffw force-pushed the ww/uv-audit branch 4 times, most recently from d3ee866 to b069412 Compare February 20, 2026 19:58
@woodruffw woodruffw mentioned this pull request Feb 20, 2026
@woodruffw woodruffw force-pushed the ww/uv-audit branch 2 times, most recently from 96aaeb3 to 36af6d9 Compare February 23, 2026 22:35
woodruffw added a commit that referenced this pull request Feb 24, 2026
## Summary

Atop #18119. This should be merged into #18119's branch.

This adds a `uv-audit` crate, which provides some common types ~~and a
trait (`VulnerabilityService`)~~ for interacting with vulnerability
"services" (i.e. online APIs that provide vulnerability DB access).

Our MVP service is OSV; supporting PyPI's PYSEC responses through the
same trait would be straightforward.

(This should also not increase our dependency footprint; I've only used
crates that were already present in our top-level dependencies.)

## Test Plan

I've added initial unit tests; I'm going to add more that use a mocked
server to ensure we have good coverage of the pagination branches.

---------

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Feb 24, 2026
Atop #18119. This should be merged into #18119's branch.

This adds a `uv-audit` crate, which provides some common types ~~and a
trait (`VulnerabilityService`)~~ for interacting with vulnerability
"services" (i.e. online APIs that provide vulnerability DB access).

Our MVP service is OSV; supporting PyPI's PYSEC responses through the
same trait would be straightforward.

(This should also not increase our dependency footprint; I've only used
crates that were already present in our top-level dependencies.)

I've added initial unit tests; I'm going to add more that use a mocked
server to ensure we have good coverage of the pagination branches.

---------

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Feb 24, 2026
## Summary

Atop #18119. Will be merged there.

## Test Plan

None yet.

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Feb 24, 2026
Signed-off-by: William Woodruff <william@astral.sh>

Bump snapshots

Signed-off-by: William Woodruff <william@astral.sh>

Make universal the default for `uv audit` (#18185)

Atop #18119. Will be merged there.

None yet.

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Feb 24, 2026
Atop #18119. This should be merged into #18119's branch.

This adds a `uv-audit` crate, which provides some common types ~~and a
trait (`VulnerabilityService`)~~ for interacting with vulnerability
"services" (i.e. online APIs that provide vulnerability DB access).

Our MVP service is OSV; supporting PyPI's PYSEC responses through the
same trait would be straightforward.

(This should also not increase our dependency footprint; I've only used
crates that were already present in our top-level dependencies.)

I've added initial unit tests; I'm going to add more that use a mocked
server to ensure we have good coverage of the pagination branches.

---------

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Mar 2, 2026
Signed-off-by: William Woodruff <william@astral.sh>

Bump snapshots

Signed-off-by: William Woodruff <william@astral.sh>

Make universal the default for `uv audit` (#18185)

Atop #18119. Will be merged there.

None yet.

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Mar 2, 2026
Atop #18119. This should be merged into #18119's branch.

This adds a `uv-audit` crate, which provides some common types ~~and a
trait (`VulnerabilityService`)~~ for interacting with vulnerability
"services" (i.e. online APIs that provide vulnerability DB access).

Our MVP service is OSV; supporting PyPI's PYSEC responses through the
same trait would be straightforward.

(This should also not increase our dependency footprint; I've only used
crates that were already present in our top-level dependencies.)

I've added initial unit tests; I'm going to add more that use a mocked
server to ensure we have good coverage of the pagination branches.

---------

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Mar 2, 2026
Signed-off-by: William Woodruff <william@astral.sh>

Bump snapshots

Signed-off-by: William Woodruff <william@astral.sh>

Make universal the default for `uv audit` (#18185)

Atop #18119. Will be merged there.

None yet.

Signed-off-by: William Woodruff <william@astral.sh>

Make `uv audit` hidden

Signed-off-by: William Woodruff <william@astral.sh>

Bump snapshots

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Mar 2, 2026
Atop #18119. This should be merged into #18119's branch.

This adds a `uv-audit` crate, which provides some common types ~~and a
trait (`VulnerabilityService`)~~ for interacting with vulnerability
"services" (i.e. online APIs that provide vulnerability DB access).

Our MVP service is OSV; supporting PyPI's PYSEC responses through the
same trait would be straightforward.

(This should also not increase our dependency footprint; I've only used
crates that were already present in our top-level dependencies.)

I've added initial unit tests; I'm going to add more that use a mocked
server to ensure we have good coverage of the pagination branches.

---------

Signed-off-by: William Woodruff <william@astral.sh>

Fixup API usage

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw marked this pull request as ready for review March 2, 2026 17:22
@woodruffw woodruffw requested a review from konstin March 2, 2026 17:25
@woodruffw woodruffw changed the title Implement uv audit Scaffolding for uv audit Mar 2, 2026
Signed-off-by: William Woodruff <william@astral.sh>

Bump snapshots

Signed-off-by: William Woodruff <william@astral.sh>

Make universal the default for `uv audit` (#18185)

Atop #18119. Will be merged there.

None yet.

Signed-off-by: William Woodruff <william@astral.sh>

Make `uv audit` hidden

Signed-off-by: William Woodruff <william@astral.sh>

Bump snapshots

Signed-off-by: William Woodruff <william@astral.sh>

Bump snapshot

Signed-off-by: William Woodruff <william@astral.sh>
Atop #18119. This should be merged into #18119's branch.

This adds a `uv-audit` crate, which provides some common types ~~and a
trait (`VulnerabilityService`)~~ for interacting with vulnerability
"services" (i.e. online APIs that provide vulnerability DB access).

Our MVP service is OSV; supporting PyPI's PYSEC responses through the
same trait would be straightforward.

(This should also not increase our dependency footprint; I've only used
crates that were already present in our top-level dependencies.)

I've added initial unit tests; I'm going to add more that use a mocked
server to ensure we have good coverage of the pagination branches.

---------

Signed-off-by: William Woodruff <william@astral.sh>

Fixup API usage

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw merged commit 02e804e into main Mar 3, 2026
101 checks passed
@woodruffw woodruffw deleted the ww/uv-audit branch March 3, 2026 16:11
woodruffw added a commit that referenced this pull request Mar 3, 2026
Signed-off-by: William Woodruff <william@astral.sh>

Bump snapshots

Signed-off-by: William Woodruff <william@astral.sh>

Make universal the default for `uv audit` (#18185)

Atop #18119. Will be merged there.

None yet.

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Mar 3, 2026
Atop #18119. This should be merged into #18119's branch.

This adds a `uv-audit` crate, which provides some common types ~~and a
trait (`VulnerabilityService`)~~ for interacting with vulnerability
"services" (i.e. online APIs that provide vulnerability DB access).

Our MVP service is OSV; supporting PyPI's PYSEC responses through the
same trait would be straightforward.

(This should also not increase our dependency footprint; I've only used
crates that were already present in our top-level dependencies.)

I've added initial unit tests; I'm going to add more that use a mocked
server to ensure we have good coverage of the pagination branches.

---------

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Mar 10, 2026
## Summary

This adds some initial output/report formatting for `uv audit`.

This is an initial blush, any feedback to align this with
rendering/formatting idioms elsewhere would be greatly appreciated!

Atop #18119. 

## Test Plan

None yet.

---------

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Mar 11, 2026
## Summary

This switches us to OSV's batch query API for vulnerability ID lookups,
which can then be used to concurrently fetch the actual full finding
responses.

In my local testing, this yields significant speedups: from 23s on main
(before this PR) with a small project (~70 deps) to 950ms with this PR.

~~WIP, I want to think through this approach a little more.~~

See #18119

## Test Plan

Added new unit tests.

---------

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw mentioned this pull request Mar 16, 2026
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uv audit Command for Security Vulnerability Scanning

3 participants