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

CodeQL SAST scanning for pip repository #12584

Open
1 task done
wwuck opened this issue Mar 21, 2024 · 1 comment
Open
1 task done

CodeQL SAST scanning for pip repository #12584

wwuck opened this issue Mar 21, 2024 · 1 comment
Labels
S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature

Comments

@wwuck
Copy link

wwuck commented Mar 21, 2024

What's the problem this feature will solve?

This is following on from #12564 to discuss whether pip maintainers would be interested in enabling CodeQL SAST scanning on the pip repository?

This would enable scanning for code security vulnerabilities during each Pull Request to reduce the risk of any vulnerabilities entering the pip codebase.

Describe the solution you'd like

Enabling CodeQL scanning in the default setup is relatively painless and involves just clicking a few buttons in the pip project settings security analysis page.

Alternatively, I would be happy to provide a PR for a CodeQL workflow file similar to what is used in the pypa/twine and pypa/packaging repositories.

After the first scan is completed, a baseline can be created by dismissing any alerts that don't need to be fixed (eg. alerts for code in tests).

I ran a quick test by enabling CodeQL on my fork of pip repository and it came back with these results (screenshot because it appears that my fork codeql scan results are not publicly accessible outside of the github project's maintainers):

codeql-pip-fork

Alternative Solutions

An alternative could be using SonarCloud but as that is a third-party tool, it would be simpler to stick with CodeQL integrated into GitHub.

Additional context

N/A

Code of Conduct

@wwuck wwuck added S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature labels Mar 21, 2024
@pfmoore
Copy link
Member

pfmoore commented Mar 21, 2024

A number of those alerts seem to be for vendors dependencies. To be useful it would need to be possible to tell the tool to skip the _vendor directory. In general I would prefer it if the approach was configurable so that we could choose what checks to opt into and what files to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants