Skip to content

Commit 8e3fe57

Browse files
author
Sakshis
committed
python-neo4j-hardcoded-secret-python
1 parent 781af4d commit 8e3fe57

4 files changed

+279
-3
lines changed

rules/python/security/python-neo4j-hardcoded-secret-auth-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
id: python-neo4j-hardcoded-secret-auth-python
1+
id: python-neo4j-hardcoded-secret-python
22
severity: warning
33
language: python
44
message: >-

tests/__snapshots__/python-neo4j-hardcoded-secret-auth-python-snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
id: python-neo4j-hardcoded-secret-auth-python
1+
id: python-neo4j-hardcoded-secret-python
22
snapshots:
33
? |
44
from neo4j import (
Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
id: python-neo4j-hardcoded-secret-python
2+
snapshots:
3+
? |
4+
from neo4j import (
5+
basic_auth,
6+
kerberos_auth,
7+
bearer_auth,
8+
AsyncGraphDatabase,
9+
)
10+
password = "NEO4J_PASSWORD"
11+
driver = AsyncGraphDatabase.driver(url, auth=basic_auth(username, password))
12+
: labels:
13+
- source: basic_auth(username, password)
14+
style: primary
15+
start: 157
16+
end: 187
17+
- source: password
18+
style: secondary
19+
start: 83
20+
end: 91
21+
- source: '"'
22+
style: secondary
23+
start: 94
24+
end: 95
25+
- source: NEO4J_PASSWORD
26+
style: secondary
27+
start: 95
28+
end: 109
29+
- source: '"'
30+
style: secondary
31+
start: 109
32+
end: 110
33+
- source: '"NEO4J_PASSWORD"'
34+
style: secondary
35+
start: 94
36+
end: 110
37+
- source: password = "NEO4J_PASSWORD"
38+
style: secondary
39+
start: 83
40+
end: 110
41+
- source: password = "NEO4J_PASSWORD"
42+
style: secondary
43+
start: 83
44+
end: 110
45+
- source: password = "NEO4J_PASSWORD"
46+
style: secondary
47+
start: 83
48+
end: 110
49+
- source: password
50+
style: secondary
51+
start: 178
52+
end: 186
53+
- source: (username, password)
54+
style: secondary
55+
start: 167
56+
end: 187
57+
- source: basic_auth
58+
style: secondary
59+
start: 157
60+
end: 167
61+
- source: basic_auth
62+
style: secondary
63+
start: 20
64+
end: 30
65+
- source: neo4j
66+
style: secondary
67+
start: 5
68+
end: 10
69+
- source: |-
70+
from neo4j import (
71+
basic_auth,
72+
kerberos_auth,
73+
bearer_auth,
74+
AsyncGraphDatabase,
75+
)
76+
style: secondary
77+
start: 0
78+
end: 81
79+
- source: |-
80+
from neo4j import (
81+
basic_auth,
82+
kerberos_auth,
83+
bearer_auth,
84+
AsyncGraphDatabase,
85+
)
86+
style: secondary
87+
start: 0
88+
end: 81
89+
? |
90+
from neo4j import (
91+
basic_auth,
92+
kerberos_auth,
93+
bearer_auth,
94+
AsyncGraphDatabase,
95+
)
96+
driver = AsyncGraphDatabase.driver(url, auth=basic_auth(username, "NEO4J_PASSWORD"))
97+
: labels:
98+
- source: basic_auth(username, "NEO4J_PASSWORD")
99+
style: primary
100+
start: 127
101+
end: 165
102+
- source: '"'
103+
style: secondary
104+
start: 148
105+
end: 149
106+
- source: NEO4J_PASSWORD
107+
style: secondary
108+
start: 149
109+
end: 163
110+
- source: '"'
111+
style: secondary
112+
start: 163
113+
end: 164
114+
- source: '"NEO4J_PASSWORD"'
115+
style: secondary
116+
start: 148
117+
end: 164
118+
- source: (username, "NEO4J_PASSWORD")
119+
style: secondary
120+
start: 137
121+
end: 165
122+
- source: basic_auth
123+
style: secondary
124+
start: 127
125+
end: 137
126+
- source: basic_auth
127+
style: secondary
128+
start: 20
129+
end: 30
130+
- source: neo4j
131+
style: secondary
132+
start: 5
133+
end: 10
134+
- source: |-
135+
from neo4j import (
136+
basic_auth,
137+
kerberos_auth,
138+
bearer_auth,
139+
AsyncGraphDatabase,
140+
)
141+
style: secondary
142+
start: 0
143+
end: 81
144+
- source: |-
145+
from neo4j import (
146+
basic_auth,
147+
kerberos_auth,
148+
bearer_auth,
149+
AsyncGraphDatabase,
150+
)
151+
style: secondary
152+
start: 0
153+
end: 81
154+
? |-
155+
from neo4j import (
156+
basic_auth,
157+
kerberos_auth,
158+
bearer_auth,
159+
AsyncGraphDatabase,
160+
)
161+
driver = GraphDatabase.driver(uri, auth=bearer_auth("token"))
162+
: labels:
163+
- source: bearer_auth("token")
164+
style: primary
165+
start: 122
166+
end: 142
167+
- source: '"'
168+
style: secondary
169+
start: 134
170+
end: 135
171+
- source: token
172+
style: secondary
173+
start: 135
174+
end: 140
175+
- source: '"'
176+
style: secondary
177+
start: 140
178+
end: 141
179+
- source: '"token"'
180+
style: secondary
181+
start: 134
182+
end: 141
183+
- source: ("token")
184+
style: secondary
185+
start: 133
186+
end: 142
187+
- source: bearer_auth
188+
style: secondary
189+
start: 122
190+
end: 133
191+
- source: bearer_auth
192+
style: secondary
193+
start: 47
194+
end: 58
195+
- source: neo4j
196+
style: secondary
197+
start: 5
198+
end: 10
199+
- source: |-
200+
from neo4j import (
201+
basic_auth,
202+
kerberos_auth,
203+
bearer_auth,
204+
AsyncGraphDatabase,
205+
)
206+
style: secondary
207+
start: 0
208+
end: 81
209+
- source: |-
210+
from neo4j import (
211+
basic_auth,
212+
kerberos_auth,
213+
bearer_auth,
214+
AsyncGraphDatabase,
215+
)
216+
style: secondary
217+
start: 0
218+
end: 81
219+
? "from neo4j import (\nbasic_auth,\nkerberos_auth,\nbearer_auth,\nAsyncGraphDatabase,\n)\nuri = \"neo4j://example.com:7687\" \ndriver = GraphDatabase.driver(uri, auth=kerberos_auth(\"token\"))\n"
220+
: labels:
221+
- source: kerberos_auth("token")
222+
style: primary
223+
start: 156
224+
end: 178
225+
- source: '"'
226+
style: secondary
227+
start: 170
228+
end: 171
229+
- source: token
230+
style: secondary
231+
start: 171
232+
end: 176
233+
- source: '"'
234+
style: secondary
235+
start: 176
236+
end: 177
237+
- source: '"token"'
238+
style: secondary
239+
start: 170
240+
end: 177
241+
- source: ("token")
242+
style: secondary
243+
start: 169
244+
end: 178
245+
- source: kerberos_auth
246+
style: secondary
247+
start: 156
248+
end: 169
249+
- source: kerberos_auth
250+
style: secondary
251+
start: 32
252+
end: 45
253+
- source: neo4j
254+
style: secondary
255+
start: 5
256+
end: 10
257+
- source: |-
258+
from neo4j import (
259+
basic_auth,
260+
kerberos_auth,
261+
bearer_auth,
262+
AsyncGraphDatabase,
263+
)
264+
style: secondary
265+
start: 0
266+
end: 81
267+
- source: |-
268+
from neo4j import (
269+
basic_auth,
270+
kerberos_auth,
271+
bearer_auth,
272+
AsyncGraphDatabase,
273+
)
274+
style: secondary
275+
start: 0
276+
end: 81

tests/python/python-neo4j-hardcoded-secret-auth-python-test.yml renamed to tests/python/python-neo4j-hardcoded-secret-python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
id: python-neo4j-hardcoded-secret-auth-python
1+
id: python-neo4j-hardcoded-secret-python
22
valid:
33
- |
44
driver = AsyncGraphDatabase.driver(url, auth=basic_auth(username, password))

0 commit comments

Comments
 (0)