I would like to incorporate Bandit security tests into my current Python project and add the command to my MakeFile.
In my Makefile, I added the following code:
.PHONY: bandit
bandit:
pip install bandit && bandit -c pyproject.toml -r . --confidence-level high -f json -q
When I run the commands pip install bandit
and bandit -c pyproject.toml -r . --confidence-level high -f json -q
in my project directory, there are no errors and the output is as expected. However, when I place it into the Makefile and run make bandit
, I receive the error of make: *** [bandit] Error 1
.
Why am I receiving this error? As I am adding the make
command to my Github Actions file, this also causes an error in the Actions pipeline.
Besides the error message, the output is what I am expecting and is correct. I receive a bandit report on my command line.
Thank you in advance!