Skip to content

Commit 82da38a

Browse files
committed
Update travis
1 parent 516709e commit 82da38a

File tree

8 files changed

+387
-39
lines changed

8 files changed

+387
-39
lines changed

.bandit_baseline.json

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
{
2+
"errors": [],
3+
"generated_at": "2019-10-07T08:19:22Z",
4+
"metrics": {
5+
"./bot.py": {
6+
"CONFIDENCE.HIGH": 0.0,
7+
"CONFIDENCE.LOW": 0.0,
8+
"CONFIDENCE.MEDIUM": 0.0,
9+
"CONFIDENCE.UNDEFINED": 0.0,
10+
"SEVERITY.HIGH": 0.0,
11+
"SEVERITY.LOW": 0.0,
12+
"SEVERITY.MEDIUM": 0.0,
13+
"SEVERITY.UNDEFINED": 0.0,
14+
"loc": 933,
15+
"nosec": 0
16+
},
17+
"_totals": {
18+
"CONFIDENCE.HIGH": 2.0,
19+
"CONFIDENCE.LOW": 0.0,
20+
"CONFIDENCE.MEDIUM": 1.0,
21+
"CONFIDENCE.UNDEFINED": 0.0,
22+
"SEVERITY.HIGH": 0.0,
23+
"SEVERITY.LOW": 2.0,
24+
"SEVERITY.MEDIUM": 1.0,
25+
"SEVERITY.UNDEFINED": 0.0,
26+
"loc": 7299,
27+
"nosec": 0
28+
},
29+
"cogs/modmail.py": {
30+
"CONFIDENCE.HIGH": 0.0,
31+
"CONFIDENCE.LOW": 0.0,
32+
"CONFIDENCE.MEDIUM": 0.0,
33+
"CONFIDENCE.UNDEFINED": 0.0,
34+
"SEVERITY.HIGH": 0.0,
35+
"SEVERITY.LOW": 0.0,
36+
"SEVERITY.MEDIUM": 0.0,
37+
"SEVERITY.UNDEFINED": 0.0,
38+
"loc": 973,
39+
"nosec": 0
40+
},
41+
"cogs/plugins.py": {
42+
"CONFIDENCE.HIGH": 1.0,
43+
"CONFIDENCE.LOW": 0.0,
44+
"CONFIDENCE.MEDIUM": 0.0,
45+
"CONFIDENCE.UNDEFINED": 0.0,
46+
"SEVERITY.HIGH": 0.0,
47+
"SEVERITY.LOW": 1.0,
48+
"SEVERITY.MEDIUM": 0.0,
49+
"SEVERITY.UNDEFINED": 0.0,
50+
"loc": 537,
51+
"nosec": 0
52+
},
53+
"cogs/utility.py": {
54+
"CONFIDENCE.HIGH": 1.0,
55+
"CONFIDENCE.LOW": 0.0,
56+
"CONFIDENCE.MEDIUM": 0.0,
57+
"CONFIDENCE.UNDEFINED": 0.0,
58+
"SEVERITY.HIGH": 0.0,
59+
"SEVERITY.LOW": 0.0,
60+
"SEVERITY.MEDIUM": 1.0,
61+
"SEVERITY.UNDEFINED": 0.0,
62+
"loc": 1587,
63+
"nosec": 0
64+
},
65+
"core/_color_data.py": {
66+
"CONFIDENCE.HIGH": 0.0,
67+
"CONFIDENCE.LOW": 0.0,
68+
"CONFIDENCE.MEDIUM": 0.0,
69+
"CONFIDENCE.UNDEFINED": 0.0,
70+
"SEVERITY.HIGH": 0.0,
71+
"SEVERITY.LOW": 0.0,
72+
"SEVERITY.MEDIUM": 0.0,
73+
"SEVERITY.UNDEFINED": 0.0,
74+
"loc": 1168,
75+
"nosec": 0
76+
},
77+
"core/changelog.py": {
78+
"CONFIDENCE.HIGH": 0.0,
79+
"CONFIDENCE.LOW": 0.0,
80+
"CONFIDENCE.MEDIUM": 0.0,
81+
"CONFIDENCE.UNDEFINED": 0.0,
82+
"SEVERITY.HIGH": 0.0,
83+
"SEVERITY.LOW": 0.0,
84+
"SEVERITY.MEDIUM": 0.0,
85+
"SEVERITY.UNDEFINED": 0.0,
86+
"loc": 154,
87+
"nosec": 0
88+
},
89+
"core/checks.py": {
90+
"CONFIDENCE.HIGH": 0.0,
91+
"CONFIDENCE.LOW": 0.0,
92+
"CONFIDENCE.MEDIUM": 0.0,
93+
"CONFIDENCE.UNDEFINED": 0.0,
94+
"SEVERITY.HIGH": 0.0,
95+
"SEVERITY.LOW": 0.0,
96+
"SEVERITY.MEDIUM": 0.0,
97+
"SEVERITY.UNDEFINED": 0.0,
98+
"loc": 75,
99+
"nosec": 0
100+
},
101+
"core/clients.py": {
102+
"CONFIDENCE.HIGH": 0.0,
103+
"CONFIDENCE.LOW": 0.0,
104+
"CONFIDENCE.MEDIUM": 0.0,
105+
"CONFIDENCE.UNDEFINED": 0.0,
106+
"SEVERITY.HIGH": 0.0,
107+
"SEVERITY.LOW": 0.0,
108+
"SEVERITY.MEDIUM": 0.0,
109+
"SEVERITY.UNDEFINED": 0.0,
110+
"loc": 200,
111+
"nosec": 0
112+
},
113+
"core/config.py": {
114+
"CONFIDENCE.HIGH": 0.0,
115+
"CONFIDENCE.LOW": 0.0,
116+
"CONFIDENCE.MEDIUM": 0.0,
117+
"CONFIDENCE.UNDEFINED": 0.0,
118+
"SEVERITY.HIGH": 0.0,
119+
"SEVERITY.LOW": 0.0,
120+
"SEVERITY.MEDIUM": 0.0,
121+
"SEVERITY.UNDEFINED": 0.0,
122+
"loc": 276,
123+
"nosec": 0
124+
},
125+
"core/decorators.py": {
126+
"CONFIDENCE.HIGH": 0.0,
127+
"CONFIDENCE.LOW": 0.0,
128+
"CONFIDENCE.MEDIUM": 0.0,
129+
"CONFIDENCE.UNDEFINED": 0.0,
130+
"SEVERITY.HIGH": 0.0,
131+
"SEVERITY.LOW": 0.0,
132+
"SEVERITY.MEDIUM": 0.0,
133+
"SEVERITY.UNDEFINED": 0.0,
134+
"loc": 7,
135+
"nosec": 0
136+
},
137+
"core/models.py": {
138+
"CONFIDENCE.HIGH": 0.0,
139+
"CONFIDENCE.LOW": 0.0,
140+
"CONFIDENCE.MEDIUM": 0.0,
141+
"CONFIDENCE.UNDEFINED": 0.0,
142+
"SEVERITY.HIGH": 0.0,
143+
"SEVERITY.LOW": 0.0,
144+
"SEVERITY.MEDIUM": 0.0,
145+
"SEVERITY.UNDEFINED": 0.0,
146+
"loc": 91,
147+
"nosec": 0
148+
},
149+
"core/paginator.py": {
150+
"CONFIDENCE.HIGH": 0.0,
151+
"CONFIDENCE.LOW": 0.0,
152+
"CONFIDENCE.MEDIUM": 0.0,
153+
"CONFIDENCE.UNDEFINED": 0.0,
154+
"SEVERITY.HIGH": 0.0,
155+
"SEVERITY.LOW": 0.0,
156+
"SEVERITY.MEDIUM": 0.0,
157+
"SEVERITY.UNDEFINED": 0.0,
158+
"loc": 214,
159+
"nosec": 0
160+
},
161+
"core/thread.py": {
162+
"CONFIDENCE.HIGH": 0.0,
163+
"CONFIDENCE.LOW": 0.0,
164+
"CONFIDENCE.MEDIUM": 0.0,
165+
"CONFIDENCE.UNDEFINED": 0.0,
166+
"SEVERITY.HIGH": 0.0,
167+
"SEVERITY.LOW": 0.0,
168+
"SEVERITY.MEDIUM": 0.0,
169+
"SEVERITY.UNDEFINED": 0.0,
170+
"loc": 716,
171+
"nosec": 0
172+
},
173+
"core/time.py": {
174+
"CONFIDENCE.HIGH": 0.0,
175+
"CONFIDENCE.LOW": 0.0,
176+
"CONFIDENCE.MEDIUM": 0.0,
177+
"CONFIDENCE.UNDEFINED": 0.0,
178+
"SEVERITY.HIGH": 0.0,
179+
"SEVERITY.LOW": 0.0,
180+
"SEVERITY.MEDIUM": 0.0,
181+
"SEVERITY.UNDEFINED": 0.0,
182+
"loc": 169,
183+
"nosec": 0
184+
},
185+
"core/utils.py": {
186+
"CONFIDENCE.HIGH": 0.0,
187+
"CONFIDENCE.LOW": 0.0,
188+
"CONFIDENCE.MEDIUM": 1.0,
189+
"CONFIDENCE.UNDEFINED": 0.0,
190+
"SEVERITY.HIGH": 0.0,
191+
"SEVERITY.LOW": 1.0,
192+
"SEVERITY.MEDIUM": 0.0,
193+
"SEVERITY.UNDEFINED": 0.0,
194+
"loc": 199,
195+
"nosec": 0
196+
}
197+
},
198+
"results": [
199+
{
200+
"code": "14 from site import USER_SITE\n15 from subprocess import PIPE\n16 \n17 import discord\n",
201+
"filename": "cogs/plugins.py",
202+
"issue_confidence": "HIGH",
203+
"issue_severity": "LOW",
204+
"issue_text": "Consider possible security implications associated with PIPE module.",
205+
"line_number": 15,
206+
"line_range": [
207+
15,
208+
16
209+
],
210+
"more_info": "https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess",
211+
"test_id": "B404",
212+
"test_name": "blacklist"
213+
},
214+
{
215+
"code": "1824 try:\n1825 exec(to_compile, env) # pylint: disable=exec-used\n1826 except Exception as exc:\n",
216+
"filename": "cogs/utility.py",
217+
"issue_confidence": "HIGH",
218+
"issue_severity": "MEDIUM",
219+
"issue_text": "Use of exec detected.",
220+
"line_number": 1825,
221+
"line_range": [
222+
1825
223+
],
224+
"more_info": "https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html",
225+
"test_id": "B102",
226+
"test_name": "exec_used"
227+
},
228+
{
229+
"code": "219 for token in shlex.shlex(alias, punctuation_chars=\"&\"):\n220 if token != \"&&\":\n221 buffer += \" \" + token\n",
230+
"filename": "core/utils.py",
231+
"issue_confidence": "MEDIUM",
232+
"issue_severity": "LOW",
233+
"issue_text": "Possible hardcoded password: '&&'",
234+
"line_number": 220,
235+
"line_range": [
236+
220
237+
],
238+
"more_info": "https://bandit.readthedocs.io/en/latest/plugins/b105_hardcoded_password_string.html",
239+
"test_id": "B105",
240+
"test_name": "hardcoded_password_string"
241+
}
242+
]
243+
}

.travis.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,27 @@ language: python
33
matrix:
44
include:
55
- python: '3.7'
6-
dist: xenial
6+
name: "Python 3.7.1 on Xenial Linux"
7+
- python: '3.6'
8+
name: "Python 3.6.7 on Xenial Linux"
9+
- name: "Python 3.7.4 on macOS"
10+
os: osx
11+
osx_image: xcode11
12+
language: shell
13+
- name: "Python 3.7.4 on Windows"
14+
os: windows
15+
language: shell
16+
before_install:
17+
- choco install python
18+
- python -m pip install --upgrade pip
19+
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
720

821
install:
22+
- pip3 install --upgrade pip
23+
- pip3 install pipenv
924
- pipenv install -d
1025

1126
script:
27+
- pipenv run bandit ./bot.py cogs/*.py core/*.py -b .bandit_baseline.json
1228
- pipenv run python .lint.py
29+
- pipenv run flake8 ./bot.py cogs/*.py core/*.py --ignore=E501,E203,W503 --exit-zero

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ however, insignificant breaking changes does not guarantee a major version bump,
2727
- Help command is in alphabetical order grouped by permissions.
2828
- Notes are no longer always blurple, its set to `MAIN_COLOR` now.
2929
- Added `?plugins update` for updating all installed plugins.
30+
- Reintroduce flake8 and use bandit for security issues detection.
31+
- Add travis checks for 3.6 in Linux and 3.7 for MacOS and Windows.
3032

3133
### Internal
3234

Pipfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ verify_ssl = true
66
[dev-packages]
77
black = "==19.3b0"
88
pylint = "*"
9+
bandit = "==1.6.2"
10+
flake8 = "==3.7.8"
911

1012
[packages]
1113
colorama = ">=0.4.0"

0 commit comments

Comments
 (0)