-
-
Notifications
You must be signed in to change notification settings - Fork 831
Expand file tree
/
Copy pathnosec.py
More file actions
26 lines (26 loc) · 1.53 KB
/
Copy pathnosec.py
File metadata and controls
26 lines (26 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
subprocess.Popen('/bin/ls *', shell=True) #nosec (on the line)
subprocess.Popen('/bin/ls *', #nosec (at the start of function call)
shell=True)
subprocess.Popen('/bin/ls *',
shell=True) #nosec (on the specific kwarg line)
subprocess.Popen('#nosec', shell=True)
subprocess.Popen('/bin/ls *', shell=True) # type: ... # nosec # noqa: E501 ; pylint: disable=line-too-long
subprocess.Popen('/bin/ls *', shell=True) # type: ... # nosec B607 # noqa: E501 ; pylint: disable=line-too-long
subprocess.Popen('/bin/ls *', shell=True) #nosec subprocess_popen_with_shell_equals_true (on the line)
subprocess.Popen('#nosec', shell=True) # nosec B607, B602
subprocess.Popen('#nosec', shell=True) # nosec B607 B602
subprocess.Popen('/bin/ls *', shell=True) # nosec subprocess_popen_with_shell_equals_true start_process_with_partial_path
subprocess.Popen('/bin/ls *', shell=True) # type: ... # noqa: E501 ; pylint: disable=line-too-long # nosec
subprocess.Popen('#nosec', shell=True) # nosec B607, B101
subprocess.Popen('#nosec', shell=True) # nosec B602, subprocess_popen_with_shell_equals_true
# check that nosec in nested dict does not cause "higher" annotations to be ignored
# reproduction of https://github.com/PyCQA/bandit/issues/1003
example = {
'S3_CONFIG_PARAMS': dict( # nosec B106
aws_access_key_id='key_goes_here',
aws_secret_access_key='secret_goes_here',
endpoint_url='s3.amazonaws.com',
),
'LOCALFS_BASEDIR': '/var/tmp/herp', # nosec B108
'ALPINE_APORTS_DIR': '/tmp/derp', # nosec B108
}