Giter Site home page Giter Site logo

brew-pip-audit's Introduction

brew-pip-audit: Bulk auditing Python dependencies in Homebrew with osv-scanner

Homebrew is a popular package manager for macOS. Many of the projects it packages are written in Python. In order to ensure reproducible builds, Homebrew precisely pins the version of each Python package a Homebrew formula depends on.

osv-scanner is a tool for checking a project's dependencies against vulnerability databases in order to determine if there are any known vulnerabilities.

This project takes all of the Python packages depended on by Homebrew formulas and runs them through osv-scanner. It then takes those audit results and uses them to submit patches to Homebrew.

This project previously used pip-audit, instead of osv-scanner, hence the name.

The repo

The following things can be found in this repository:

  • formula2requirements.rb: Extracts the Python dependencies from Homebrew and writes them out in the requirements.txt format.
  • pip-audit-bulk: Runs osv-scanner over a directory of requirements.txt files.
  • generate-prs.rb: Automatically generates PRs against Homebrew/homebrew-core for formulae with vulnerable dependencies.
  • requirements/: The extracted requirements.txt file for each Homebrew formula.
  • audits/: The result of osv-scanner for each Homebrew formula. There will only be a file present if vulnerabilities were found.

requirements/ and audits/ are automatically refreshed on a daily basis by Github Actions.

Contributing

This repository is automated, but the automation isn't perfect. You can help out by:

  • Looking at the skipped file, and trying to figure out why a particular dependency's audit was skipped.
  • Looking at the incoming PRs against Homebrew/homebrew-core, and helping debug ones that fail.
  • Improving the performance of our automation (it's currently very slow).
  • Looking at the action logs for the PR automation, and helping debug/fix formulae and dependencies that can't be auto-updated.

brew-pip-audit's People

Contributors

alex avatar branchvincent avatar dependabot[bot] avatar issyl0 avatar nandahkrishna avatar p-linnane avatar woodruffw avatar zhongruoyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

brew-pip-audit's Issues

Consider switching back to `pip-audit`

We switched to osv-scanner because of a significant performance regression in pip-audit. That regression has now been fixed with the 2.6.0 release, so we should consider switching back.

Low priority since the performance of osv-scanner is probably good enough, and the data quality should be similar.

PR automation: follow-ups

Some things we should do:

  • Bump the revision as well, so that auto-bumped formulae are automatically pushed to users who brew upgrade (#44);
  • Issue PRs in alphabetical order, so that we have a rough idea of how much progress the automation has made;
  • Look into throttling the PR automation when triggered periodically to avoid spamming the homebrew-core maintainers.
  • Look into replacing pipgrip within Homebrew for dep upgrades, since it uses Poetry's resolver and is slow/does different resolutions than pip
  • Don't send a PR if it doesn't actually fix a vulnerability. This happens when version constraints don't allow upgrading the vulnerable dep, but there are other packages to be updated (example: Homebrew/homebrew-core#122902).
  • Include the list of fixed vulnerabilities in the PR message.

Attempt to auto-send PRs to brew

Ideally for any formula that we identify vulnerabilities in we'd:

  • Bump dependencies (brew update-python-resources)
  • Verify that this fixes vulnerabilities
  • Bump revision
  • Send a PR to homebrew

This would significantly reduce the burdens of keeping the ecosystem secure

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.