Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - pre-build / pre-read hook for security scanning #9346

Open
f3flight opened this issue Nov 22, 2024 · 3 comments
Open

Feature request - pre-build / pre-read hook for security scanning #9346

f3flight opened this issue Nov 22, 2024 · 3 comments
Labels
question Asking for clarification or support rustlib Related to our Rust library API security

Comments

@f3flight
Copy link

Hi UV devs! Is it possible to make uv call some external tool before it attempts to build a package from source? Essentially, I'm looking for a way to pass all artifacts that UV fetches from certain external indexes through a security scanner before they are passed to unzip and more importantly, to python for execution (in case of sdists). Is that possible? If not, would it be possible to add such a feature? I was not able to find much on hooks available in uv right now.

@samypr100
Copy link
Collaborator

Curious, does this currently exists in pip? If so, how does it work?

@samypr100 samypr100 added security question Asking for clarification or support labels Nov 23, 2024
@f3flight
Copy link
Author

@samypr100 no, pip doesn't have such a feature. Nearest would be "pip download --only-binary :all:" + scanning the downloaded files. In our org we have made some patches to pip so I know where it handles download and file saving, also since pip is python it was easy for me to patch; But we seek to improve performance, and I'm looking at uv now. I would, however, like to avoid maintaining a custom uv fork, if possible, right now my rust skills are zero.

@samypr100 samypr100 added the rustlib Related to our Rust library API label Nov 23, 2024
@samypr100
Copy link
Collaborator

samypr100 commented Nov 23, 2024

Interesting. Closest might be something like discussed in #3400, althought albeit trickier due to the streaming nature since in your case you'd want to fully download first, "scan", and then extract, etc. which is afaik not how uv works under the hood even without the scan step.

From uv's perspective it might be better to rely on #3163 in the mean time once there's a suitable design / implementation (e.g. like #3163 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support rustlib Related to our Rust library API security
Projects
None yet
Development

No branches or pull requests

2 participants