Skip to content

Commit 0cb9112

Browse files
committed
Add default analysis configs from codefator
https://github.com/codefactor-io/default-configs
1 parent 11fb918 commit 0cb9112

File tree

3 files changed

+235
-0
lines changed

3 files changed

+235
-0
lines changed

.bandit

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
### This config may optionally select a subset of tests to run or skip by
2+
### filling out the 'tests' and 'skips' lists given below. If no tests are
3+
### specified for inclusion then it is assumed all tests are desired. The skips
4+
### set will remove specific tests from the include set. This can be controlled
5+
### using the -t/-s CLI options. Note that the same test ID should not appear
6+
### in both 'tests' and 'skips', this would be nonsensical and is detected by
7+
### Bandit at runtime.
8+
9+
# (optional) list included test IDs here, eg '[B101, B406]':
10+
tests:
11+
12+
# (optional) list skipped test IDs here, eg '[B101, B406]':
13+
skips: [B101, B102, B401, B402, B403, B404, B405, B406, B407, B408, B409, B410, B413, B414, B307, B311, B507, B603, B610, B611, B703]
14+
15+
### (optional) plugin settings - some test plugins require configuration data
16+
### that may be given here, per-plugin. All bandit test plugins have a built in
17+
### set of sensible defaults and these will be used if no configuration is
18+
### provided. It is not necessary to provide settings for every (or any) plugin
19+
### if the defaults are acceptable.
20+
21+
any_other_function_with_shell_equals_true:
22+
no_shell: [os.execl, os.execle, os.execlp, os.execlpe, os.execv, os.execve, os.execvp,
23+
os.execvpe, os.spawnl, os.spawnle, os.spawnlp, os.spawnlpe, os.spawnv, os.spawnve,
24+
os.spawnvp, os.spawnvpe, os.startfile]
25+
shell: [os.system, os.popen, os.popen2, os.popen3, os.popen4, popen2.popen2, popen2.popen3,
26+
popen2.popen4, popen2.Popen3, popen2.Popen4, commands.getoutput, commands.getstatusoutput]
27+
subprocess: [subprocess.Popen, subprocess.call, subprocess.check_call, subprocess.check_output,
28+
utils.execute, utils.execute_with_timeout]
29+
execute_with_run_as_root_equals_true:
30+
function_names: [ceilometer.utils.execute, cinder.utils.execute, neutron.agent.linux.utils.execute,
31+
nova.utils.execute, nova.utils.trycmd]
32+
hardcoded_tmp_directory:
33+
tmp_dirs: [/tmp, /var/tmp, /dev/shm]
34+
linux_commands_wildcard_injection:
35+
no_shell: [os.execl, os.execle, os.execlp, os.execlpe, os.execv, os.execve, os.execvp,
36+
os.execvpe, os.spawnl, os.spawnle, os.spawnlp, os.spawnlpe, os.spawnv, os.spawnve,
37+
os.spawnvp, os.spawnvpe, os.startfile]
38+
shell: [os.system, os.popen, os.popen2, os.popen3, os.popen4, popen2.popen2, popen2.popen3,
39+
popen2.popen4, popen2.Popen3, popen2.Popen4, commands.getoutput, commands.getstatusoutput]
40+
subprocess: [subprocess.Popen, subprocess.call, subprocess.check_call, subprocess.check_output,
41+
utils.execute, utils.execute_with_timeout]
42+
password_config_option_not_marked_secret:
43+
function_names: [oslo.config.cfg.StrOpt, oslo_config.cfg.StrOpt]
44+
ssl_with_bad_defaults:
45+
bad_protocol_versions: [PROTOCOL_SSLv2, SSLv2_METHOD, SSLv23_METHOD, PROTOCOL_SSLv3,
46+
PROTOCOL_TLSv1, SSLv3_METHOD, TLSv1_METHOD]
47+
ssl_with_bad_version:
48+
bad_protocol_versions: [PROTOCOL_SSLv2, SSLv2_METHOD, SSLv23_METHOD, PROTOCOL_SSLv3,
49+
PROTOCOL_TLSv1, SSLv3_METHOD, TLSv1_METHOD]
50+
start_process_with_a_shell:
51+
no_shell: [os.execl, os.execle, os.execlp, os.execlpe, os.execv, os.execve, os.execvp,
52+
os.execvpe, os.spawnl, os.spawnle, os.spawnlp, os.spawnlpe, os.spawnv, os.spawnve,
53+
os.spawnvp, os.spawnvpe, os.startfile]
54+
shell: [os.system, os.popen, os.popen2, os.popen3, os.popen4, popen2.popen2, popen2.popen3,
55+
popen2.popen4, popen2.Popen3, popen2.Popen4, commands.getoutput, commands.getstatusoutput]
56+
subprocess: [subprocess.Popen, subprocess.call, subprocess.check_call, subprocess.check_output,
57+
utils.execute, utils.execute_with_timeout]
58+
start_process_with_no_shell:
59+
no_shell: [os.execl, os.execle, os.execlp, os.execlpe, os.execv, os.execve, os.execvp,
60+
os.execvpe, os.spawnl, os.spawnle, os.spawnlp, os.spawnlpe, os.spawnv, os.spawnve,
61+
os.spawnvp, os.spawnvpe, os.startfile]
62+
shell: [os.system, os.popen, os.popen2, os.popen3, os.popen4, popen2.popen2, popen2.popen3,
63+
popen2.popen4, popen2.Popen3, popen2.Popen4, commands.getoutput, commands.getstatusoutput]
64+
subprocess: [subprocess.Popen, subprocess.call, subprocess.check_call, subprocess.check_output,
65+
utils.execute, utils.execute_with_timeout]
66+
start_process_with_partial_path:
67+
no_shell: [os.execl, os.execle, os.execlp, os.execlpe, os.execv, os.execve, os.execvp,
68+
os.execvpe, os.spawnl, os.spawnle, os.spawnlp, os.spawnlpe, os.spawnv, os.spawnve,
69+
os.spawnvp, os.spawnvpe, os.startfile]
70+
shell: [os.system, os.popen, os.popen2, os.popen3, os.popen4, popen2.popen2, popen2.popen3,
71+
popen2.popen4, popen2.Popen3, popen2.Popen4, commands.getoutput, commands.getstatusoutput]
72+
subprocess: [subprocess.Popen, subprocess.call, subprocess.check_call, subprocess.check_output,
73+
utils.execute, utils.execute_with_timeout]
74+
subprocess_popen_with_shell_equals_true:
75+
no_shell: [os.execl, os.execle, os.execlp, os.execlpe, os.execv, os.execve, os.execvp,
76+
os.execvpe, os.spawnl, os.spawnle, os.spawnlp, os.spawnlpe, os.spawnv, os.spawnve,
77+
os.spawnvp, os.spawnvpe, os.startfile]
78+
shell: [os.system, os.popen, os.popen2, os.popen3, os.popen4, popen2.popen2, popen2.popen3,
79+
popen2.popen4, popen2.Popen3, popen2.Popen4, commands.getoutput, commands.getstatusoutput]
80+
subprocess: [subprocess.Popen, subprocess.call, subprocess.check_call, subprocess.check_output,
81+
utils.execute, utils.execute_with_timeout]
82+
subprocess_without_shell_equals_true:
83+
no_shell: [os.execl, os.execle, os.execlp, os.execlpe, os.execv, os.execve, os.execvp,
84+
os.execvpe, os.spawnl, os.spawnle, os.spawnlp, os.spawnlpe, os.spawnv, os.spawnve,
85+
os.spawnvp, os.spawnvpe, os.startfile]
86+
shell: [os.system, os.popen, os.popen2, os.popen3, os.popen4, popen2.popen2, popen2.popen3,
87+
popen2.popen4, popen2.Popen3, popen2.Popen4, commands.getoutput, commands.getstatusoutput]
88+
subprocess: [subprocess.Popen, subprocess.call, subprocess.check_call, subprocess.check_output,
89+
utils.execute, utils.execute_with_timeout]
90+
try_except_continue: {check_typed_exception: false}
91+
try_except_pass: {check_typed_exception: false}

.shellcheck.yaml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
ignored:
2+
- SC2140
3+
- SC2086
4+
- SC2046
5+
- SC2015
6+
- SC1097
7+
- SC1035
8+
- SC1036
9+
- SC1007
10+
- SC2154
11+
- SC2155
12+
- SC2000
13+
- SC2034
14+
- SC2016
15+
- SC1091
16+
- SC1090
17+
- SC2212
18+
- SC2143
19+
- SC2129
20+
- SC2102
21+
- SC2069
22+
- SC1041
23+
- SC1042
24+
- SC1044
25+
- SC1046
26+
- SC1119
27+
- SC1110
28+
- SC1111
29+
- SC1112
30+
- SC1102
31+
- SC1105
32+
- SC1101
33+
- SC1004
34+
- SC1003
35+
- SC1012
36+
- SC2068
37+
- SC2065
38+
- SC2064
39+
- SC2063
40+
- SC2059
41+
- SC2053
42+
- SC2048
43+
- SC2044
44+
- SC2032
45+
- SC2031
46+
- SC2030
47+
- SC2029
48+
- SC2025
49+
- SC2024
50+
- SC2022
51+
- SC2018
52+
- SC2019
53+
- SC2017
54+
- SC2014
55+
- SC2013
56+
- SC2012
57+
- SC2009
58+
- SC2001
59+
- SC2098
60+
- SC2096
61+
- SC2094
62+
- SC2091
63+
- SC2092
64+
- SC2088
65+
- SC2087
66+
- SC2076
67+
- SC2072
68+
- SC2071
69+
- SC2223
70+
- SC2221
71+
- SC2222
72+
- SC2217
73+
- SC2207
74+
- SC2206
75+
- SC2205
76+
- SC2190
77+
- SC2188
78+
- SC2187
79+
- SC2185
80+
- SC2179
81+
- SC2178
82+
- SC2174
83+
- SC2168
84+
- SC2167
85+
- SC2163
86+
- SC2161
87+
- SC2160
88+
- SC2153
89+
- SC2150
90+
- SC2148
91+
- SC2147
92+
- SC2146
93+
- SC2142
94+
- SC2139
95+
- SC2126
96+
- SC2123
97+
- SC2120
98+
- SC2119
99+
- SC2117
100+
- SC2114
101+
- SC1117
102+
- SC2164
103+
- SC1083
104+
- SC2004
105+
- SC2125
106+
- SC2128
107+
- SC2011
108+
- SC1008
109+
- SC1019
110+
- SC2093
111+
- SC1132
112+
- SC1129
113+
- SC2236
114+
- SC2237
115+
- SC2231
116+
- SC2230
117+
- SC2229
118+
- SC2106
119+
- SC2102

.yamllint

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
rules:
3+
braces: disable
4+
brackets: disable
5+
colons: disable
6+
commas: disable
7+
comments: disable
8+
comments-indentation: disable
9+
document-end: disable
10+
document-start: disable
11+
empty-lines: disable
12+
empty-values: disable
13+
hyphens: disable
14+
indentation: disable
15+
key-duplicates:
16+
level: warning
17+
key-ordering: disable
18+
line-length: disable
19+
new-line-at-end-of-file: disable
20+
new-lines: disable
21+
octal-values: disable
22+
trailing-spaces:
23+
level: warning
24+
truthy: disable
25+
quoted-strings: disable

0 commit comments

Comments
 (0)