Skip to content

Commit 6487f96

Browse files
committed
Add integration test for trivy a and pylint CF-1742
Trivy should check and report on requirements.txt (done) Pylint should ignore the requirements.txt (not done yet) When the CLI is fixed to generate the correct files for pylint (not having the requirements.txt file), the langauges-config.yaml should be regenerated in order to fix the test
1 parent c606392 commit 6487f96

File tree

5 files changed

+133
-8
lines changed

5 files changed

+133
-8
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
tools:
2+
- name: pylint
3+
languages: [Python]
4+
extensions: [.py]
5+
files: [Pipfile.lock, poetry.lock, requirements.txt, uv.lock]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[MASTER]
2+
ignore=CVS
3+
persistent=yes
4+
load-plugins=
5+
6+
[MESSAGES CONTROL]
7+
disable=all
8+
enable=C0123,C0200,C0303,E0100,E0101,E0102,E0103,E0104,E0105,E0106,E0107,E0108,E0110,E0112,E0113,E0114,E0115,E0116,E0117,E0202,E0203,E0211,E0236,E0238,E0239,E0240,E0241,E0301,E0302,E0601,E0603,E0604,E0701,E0702,E0704,E0710,E0711,E0712,E1003,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1132,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,R0202,R0203,W0101,W0102,W0104,W0105,W0106,W0107,W0108,W0109,W0120,W0122,W0124,W0150,W0199,W0221,W0222,W0233,W0404,W0410,W0601,W0602,W0604,W0611,W0612,W0622,W0702,W0705,W0711,W1300,W1301,W1302,W1303,W1305,W1306,W1307
9+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file should be successfully ignored by Codacy CLI as pylint does not support it.
2+
django==1.11.29

plugins/tools/trivy/test/expected.sarif

Lines changed: 116 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,33 @@
99
}
1010
},
1111
"results": [
12+
{
13+
"level": "note",
14+
"locations": [
15+
{
16+
"message": {
17+
"text": "package-lock.json: [email protected]"
18+
},
19+
"physicalLocation": {
20+
"artifactLocation": {
21+
"uri": "package-lock.json",
22+
"uriBaseId": "ROOTPATH"
23+
},
24+
"region": {
25+
"endColumn": 1,
26+
"endLine": 357,
27+
"startColumn": 1,
28+
"startLine": 349
29+
}
30+
}
31+
}
32+
],
33+
"message": {
34+
"text": "Package: brace-expansion\nInstalled Version: 1.1.11\nVulnerability CVE-2025-5889\nSeverity: LOW\nFixed Version: 2.0.2, 1.1.12, 3.0.1, 4.0.1\nLink: [CVE-2025-5889](https://avd.aquasec.com/nvd/cve-2025-5889)"
35+
},
36+
"ruleId": "CVE-2025-5889",
37+
"ruleIndex": 0
38+
},
1239
{
1340
"level": "error",
1441
"locations": [
@@ -37,31 +64,112 @@
3764
"ruleIndex": 1
3865
},
3966
{
40-
"level": "note",
67+
"level": "error",
4168
"locations": [
4269
{
4370
"message": {
44-
"text": "package-lock.json: brace-expansion@1.1.11"
71+
"text": "requirements.txt: django@1.11.29"
4572
},
4673
"physicalLocation": {
4774
"artifactLocation": {
48-
"uri": "package-lock.json",
75+
"uri": "requirements.txt",
4976
"uriBaseId": "ROOTPATH"
5077
},
5178
"region": {
5279
"endColumn": 1,
53-
"endLine": 357,
80+
"endLine": 1,
5481
"startColumn": 1,
55-
"startLine": 349
82+
"startLine": 1
5683
}
5784
}
5885
}
5986
],
6087
"message": {
61-
"text": "Package: brace-expansion\nInstalled Version: 1.1.11\nVulnerability CVE-2025-5889\nSeverity: LOW\nFixed Version: 2.0.2, 1.1.12, 3.0.1, 4.0.1\nLink: [CVE-2025-5889](https://avd.aquasec.com/nvd/cve-2025-5889)"
88+
"text": "Package: django\nInstalled Version: 1.11.29\nVulnerability CVE-2022-36359\nSeverity: HIGH\nFixed Version: 3.2.15, 4.0.7\nLink: [CVE-2022-36359](https://avd.aquasec.com/nvd/cve-2022-36359)"
6289
},
63-
"ruleId": "CVE-2025-5889",
64-
"ruleIndex": 0
90+
"ruleId": "CVE-2022-36359",
91+
"ruleIndex": 2
92+
},
93+
{
94+
"level": "warning",
95+
"locations": [
96+
{
97+
"message": {
98+
"text": "requirements.txt: [email protected]"
99+
},
100+
"physicalLocation": {
101+
"artifactLocation": {
102+
"uri": "requirements.txt",
103+
"uriBaseId": "ROOTPATH"
104+
},
105+
"region": {
106+
"endColumn": 1,
107+
"endLine": 1,
108+
"startColumn": 1,
109+
"startLine": 1
110+
}
111+
}
112+
}
113+
],
114+
"message": {
115+
"text": "Package: django\nInstalled Version: 1.11.29\nVulnerability CVE-2021-33203\nSeverity: MEDIUM\nFixed Version: 2.2.24, 3.1.12, 3.2.4\nLink: [CVE-2021-33203](https://avd.aquasec.com/nvd/cve-2021-33203)"
116+
},
117+
"ruleId": "CVE-2021-33203",
118+
"ruleIndex": 3
119+
},
120+
{
121+
"level": "warning",
122+
"locations": [
123+
{
124+
"message": {
125+
"text": "requirements.txt: [email protected]"
126+
},
127+
"physicalLocation": {
128+
"artifactLocation": {
129+
"uri": "requirements.txt",
130+
"uriBaseId": "ROOTPATH"
131+
},
132+
"region": {
133+
"endColumn": 1,
134+
"endLine": 1,
135+
"startColumn": 1,
136+
"startLine": 1
137+
}
138+
}
139+
}
140+
],
141+
"message": {
142+
"text": "Package: django\nInstalled Version: 1.11.29\nVulnerability CVE-2024-45231\nSeverity: MEDIUM\nFixed Version: 5.1.1, 5.0.9, 4.2.16\nLink: [CVE-2024-45231](https://avd.aquasec.com/nvd/cve-2024-45231)"
143+
},
144+
"ruleId": "CVE-2024-45231",
145+
"ruleIndex": 4
146+
},
147+
{
148+
"level": "warning",
149+
"locations": [
150+
{
151+
"message": {
152+
"text": "requirements.txt: [email protected]"
153+
},
154+
"physicalLocation": {
155+
"artifactLocation": {
156+
"uri": "requirements.txt",
157+
"uriBaseId": "ROOTPATH"
158+
},
159+
"region": {
160+
"endColumn": 1,
161+
"endLine": 1,
162+
"startColumn": 1,
163+
"startLine": 1
164+
}
165+
}
166+
}
167+
],
168+
"message": {
169+
"text": "Package: django\nInstalled Version: 1.11.29\nVulnerability CVE-2025-48432\nSeverity: MEDIUM\nFixed Version: 5.2.2, 5.1.10, 4.2.22\nLink: [CVE-2025-48432](https://avd.aquasec.com/nvd/cve-2025-48432)"
170+
},
171+
"ruleId": "CVE-2025-48432",
172+
"ruleIndex": 5
65173
}
66174
],
67175
"tool": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
django==1.11.29

0 commit comments

Comments
 (0)