@@ -12,7 +12,36 @@ commands = ostestr {posargs}
1212whitelist_externals = ostestr
1313
1414[testenv:pep8]
15- commands = flake8
15+ commands =
16+ flake8
17+ bandit -r openstackclient -x tests -s B105,B106,B107,B401,B404,B603,B606,B607,B110,B605,B101
18+
19+ [testenv:bandit]
20+ # This command runs the bandit security linter against the openstackclient
21+ # codebase minus the tests directory. Some tests are being excluded to
22+ # reduce the number of positives before a team inspection, and to ensure a
23+ # passing gate job for initial addition. The excluded tests are:
24+ # B105-B107: hardcoded password checks - likely to generate false positives
25+ # in a gate environment
26+ # B401: import subprocess - not necessarily a security issue; this plugin is
27+ # mainly used for penetration testing workflow
28+ # B603,B606: process without shell - not necessarily a security issue; this
29+ # plugin is mainly used for penetration testing workflow
30+ # B607: start process with a partial path - this should be a project level
31+ # decision
32+ # NOTE(elmiko): The following tests are being excluded specifically for
33+ # python-openstackclient, they are being excluded to ensure that voting jobs
34+ # in the project and in bandit integration tests continue to pass. These
35+ # tests have generated issue within the project and should be investigated
36+ # by the project.
37+ # B110: try, except, pass detected - possible security issue; this should be
38+ # investigated by the project for possible exploitation
39+ # B605: process with a shell - possible security issue; this should be
40+ # investigated by the project for possible exploitation
41+ # B101: use of assert - this code will be removed when compiling to optimized
42+ # byte code
43+ commands =
44+ bandit -r openstackclient -x tests -s B105,B106,B107,B401,B404,B603,B606,B607,B110,B605,B101
1645
1746[testenv:functional]
1847setenv = OS_TEST_PATH =./functional/tests
@@ -40,4 +69,4 @@ show-source = True
4069exclude = .git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools
4170# If 'ignore' is not set there are default errors and warnings that are set
4271# Doc: http://flake8.readthedocs.org/en/latest/config.html#default
43- ignore = __
72+ ignore = __
0 commit comments