Skip to content

Support pre-commit configs for auditing? #1799

@woodruffw

Description

@woodruffw

Raised by @henryiii.

pre-commit and prek are popular git hook managers/runners. They allow users to define a .pre-commit-config.yaml file that configures one or more plugins to run. For example:

repos:
  - repo: https://github.com/henryiii/cibuildwheel
    rev: 58a0b274ea29c1e7899d45ab324b4ccdfc78d17d
    hooks:
      - id: mine

In the above rev is a Git reference, and is also an impostor commit. In principle this makes it a good candidate for flagging by the impostor-commit audit.

Some considerations:

  • Is this the only audit we could currently run on pre-commit, or are there other security audits that make sense to run?
  • prek also supports prek.toml, which would be outside of zizmor's current scope (we're focused on YAML at the moment). This doesn't seem to be widely adopted at the moment, but if it were to be then we'd only be able to audit some portion of prek usage.
  • This would be zizmor's first non-GitHub-specific audit input, which would mean a change in policy in terms of what I'm supporting. It's also a bit of a risk insofar as I know a lot less about pre-commit than I do about GitHub Actions/Dependabot.

Alternatives:

  • This is possibly a better fit for a separate tool, either a pre-existing one or something new. OTOH tool proliferation is bad.

Opening this for discussion for now, since I'm not sure I want to support this (but I do agree it's a good idea). I think a significant motivator for me supporting this will be whether there are other things we can detect to improve the security of the pre-commit ecosystem, rather than just a single audit (impostor-commit).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions