Allow glob patterns in PIP_REQUIREMENTS_FILE

What does this MR do?

It adds support for globbing patterns in the PIP_REQUIREMENTS_FILE environment variable.

Motivation

For us it's pretty common to have multiple *requirements.txt files in our project, separating dependencies based on their purpose, which right now we aren't able to scan using this tool.

The glob patterns are Golang's ones, so no support for ** and other more advanced features, as they aren't built in the standard library. There are other packages providing such features, but not fully sure what's your policy adding such packages in a security tool, maybe it needs some auditing, so I decided to stick to the standard one for now.

Tricky parts

  • The naming on the PIP_REQUIREMENTS_FILE variable is no longer that accurate, as it no longer has to match a single file, maybe add a new one? Not sure

Does this MR meet the acceptance criteria?

Edited by Fabien Catteau

Merge request reports

Loading