@@ -23,203 +23,3 @@ def azure_sdk_test(credential, output_path):
2323
2424 download_blob_from_url (blob_url = url , output = output_path , credential = credential , overwrite = True ) # $ Alert[py/partial-ssrf]
2525 download_blob_from_url (blob_url = full_url , output = output_path , credential = credential , overwrite = True ) # $ Alert[py/full-ssrf]
26-
27- # if URIValidator.in_domain(url, trusted_domain):
28- # # Testing Azure sink
29- # c = SecretClient(vault_url=url, credential=credential)# OK
30- # c = ShareFileClient.from_file_url(url) # OK
31- # c = KeyClient(url, credential)# OK
32- # c = ContainerClient.from_container_url(container_url=url, credential=credential) # OK
33-
34- # download_blob_from_url(
35- # blob_url=url, # OK
36- # output=output_path,
37- # credential=credential,
38- # overwrite=True
39- # )
40- # else:
41- # # Testing Azure sink
42- # c = SecretClient(vault_url=url, credential=credential)# NOT OK -- user only controlled fragment
43- # c = ShareFileClient.from_file_url(url) # NOT OK -- user only controlled fragment
44- # c = KeyClient(url, credential)# NOT OK -- user only controlled fragment
45- # c = ContainerClient.from_container_url(container_url=url, credential=credential) # NOT OK -- user only controlled fragment
46-
47- # download_blob_from_url(
48- # blob_url=url, # NOT OK -- user only controlled fragment
49- # output=output_path,
50- # credential=credential,
51- # overwrite=True
52- # )
53-
54-
55- # if URIValidator.in_domain(full_url, trusted_domain):
56- # # Testing Azure sink
57- # c = SecretClient(vault_url=full_url, credential=credential) # OK
58- # c = ShareFileClient.from_file_url(full_url) # OK
59- # c = KeyClient(full_url, credential) # OK
60- # c = ContainerClient.from_container_url(container_url=full_url, credential=credential) # OK
61-
62- # download_blob_from_url(
63- # blob_url=full_url, # OK
64- # output=output_path,
65- # credential=credential,
66- # overwrite=True
67- # )
68- # else:
69- # # Testing Azure sink
70- # c = SecretClient(vault_url=full_url, credential=credential) # NOT OK -- user has full control
71- # c = ShareFileClient.from_file_url(full_url) # NOT OK -- user has full control
72- # c = KeyClient(full_url, credential) # NOT OK -- user has full control
73- # c = ContainerClient.from_container_url(container_url=full_url, credential=credential) # NOT OK -- user has full control
74-
75- # download_blob_from_url(
76- # blob_url=full_url, # NOT OK -- user has full control
77- # output=output_path,
78- # credential=credential,
79- # overwrite=True
80- # )
81-
82-
83- # if URIValidator.in_azure_keyvault_domain(url):
84- # # Testing Azure sink
85- # c = SecretClient(vault_url=url, credential=credential)# OK
86- # c = ShareFileClient.from_file_url(url) # OK
87- # c = KeyClient(url, credential)# OK
88- # c = ContainerClient.from_container_url(container_url=url, credential=credential) # OK
89-
90- # download_blob_from_url(
91- # blob_url=url, # OK
92- # output=output_path,
93- # credential=credential,
94- # overwrite=True
95- # )
96- # else:
97- # # Testing Azure sink
98- # c = SecretClient(vault_url=url, credential=credential)# NOT OK -- user only controlled fragment
99- # c = ShareFileClient.from_file_url(url) # NOT OK -- user only controlled fragment
100- # c = KeyClient(url, credential)# NOT OK -- user only controlled fragment
101- # c = ContainerClient.from_container_url(container_url=url, credential=credential) # NOT OK -- user only controlled fragment
102-
103- # download_blob_from_url(
104- # blob_url=url, # NOT OK -- user only controlled fragment
105- # output=output_path,
106- # credential=credential,
107- # overwrite=True
108- # )
109-
110-
111- # if URIValidator.in_azure_keyvault_domain(full_url):
112- # # Testing Azure sink
113- # c = SecretClient(vault_url=full_url, credential=credential) # OK
114- # c = ShareFileClient.from_file_url(full_url) # OK
115- # c = KeyClient(full_url, credential) # OK
116- # c = ContainerClient.from_container_url(container_url=full_url, credential=credential) # OK
117-
118- # download_blob_from_url(
119- # blob_url=full_url, # OK
120- # output=output_path,
121- # credential=credential,
122- # overwrite=True
123- # )
124- # else:
125- # # Testing Azure sink
126- # c = SecretClient(vault_url=full_url, credential=credential) # NOT OK -- user has full control
127- # c = ShareFileClient.from_file_url(full_url) # NOT OK -- user has full control
128- # c = KeyClient(full_url, credential) # NOT OK -- user has full control
129- # c = ContainerClient.from_container_url(container_url=full_url, credential=credential) # NOT OK -- user has full control
130-
131- # download_blob_from_url(
132- # blob_url=full_url, # NOT OK -- user has full control
133- # output=output_path,
134- # credential=credential,
135- # overwrite=True
136- # )
137-
138- # if URIValidator.in_azure_storage_domain(url):
139- # # Testing Azure sink
140- # c = SecretClient(vault_url=url, credential=credential)# OK
141- # c = ShareFileClient.from_file_url(url) # OK
142- # c = KeyClient(url, credential)# OK
143- # c = ContainerClient.from_container_url(container_url=url, credential=credential) # OK
144-
145- # download_blob_from_url(
146- # blob_url=url, # OK
147- # output=output_path,
148- # credential=credential,
149- # overwrite=True
150- # )
151- # else:
152- # # Testing Azure sink
153- # c = SecretClient(vault_url=url, credential=credential)# NOT OK -- user only controlled fragment
154- # c = ShareFileClient.from_file_url(url) # NOT OK -- user only controlled fragment
155- # c = KeyClient(url, credential)# NOT OK -- user only controlled fragment
156- # c = ContainerClient.from_container_url(container_url=url, credential=credential) # NOT OK -- user only controlled fragment
157-
158- # download_blob_from_url(
159- # blob_url=url, # NOT OK -- user only controlled fragment
160- # output=output_path,
161- # credential=credential,
162- # overwrite=True
163- # )
164-
165-
166- # if URIValidator.in_azure_storage_domain(full_url):
167- # # Testing Azure sink
168- # c = SecretClient(vault_url=full_url, credential=credential) # OK
169- # c = ShareFileClient.from_file_url(full_url) # OK
170- # c = KeyClient(full_url, credential) # OK
171- # c = ContainerClient.from_container_url(container_url=full_url, credential=credential) # OK
172-
173- # download_blob_from_url(
174- # blob_url=full_url, # OK
175- # output=output_path,
176- # credential=credential,
177- # overwrite=True
178- # )
179- # else:
180- # # Testing Azure sink
181- # c = SecretClient(vault_url=full_url, credential=credential) # NOT OK -- user has full control
182- # c = ShareFileClient.from_file_url(full_url) # NOT OK -- user has full control
183- # c = KeyClient(full_url, credential) # NOT OK -- user has full control
184- # c = ContainerClient.from_container_url(container_url=full_url, credential=credential) # NOT OK -- user has full control
185-
186- # download_blob_from_url(
187- # blob_url=full_url, # NOT OK -- user has full control
188- # output=output_path,
189- # credential=credential,
190- # overwrite=True
191- # )
192-
193- # def azure_sdk_logic_sanity_test(credential, output_path, trusted_domain):
194- # user_input = request.args['untrusted_input']
195- # full_url = f"https://{user_input}"
196- # if not URIValidator.in_azure_storage_domain(full_url):
197- # # Testing Azure sink
198- # c = SecretClient(vault_url=full_url, credential=credential) # NOT OK -- user has full control
199- # else:
200- # # Testing Azure sink
201- # c = SecretClient(vault_url=full_url, credential=credential) # OK
202-
203-
204-
205- # if not not URIValidator.in_azure_storage_domain(full_url):
206- # # Testing Azure sink
207- # c = SecretClient(vault_url=full_url, credential=credential) # OK
208- # else:
209- # # Testing Azure sink
210- # c = SecretClient(vault_url=full_url, credential=credential) # NOT OK -- user has full control
211-
212-
213- # if URIValidator.URIValidator.in_domain(full_url, trusted_domain) and trusted_domain == "example.com":
214- # # Testing Azure sink
215- # c = SecretClient(vault_url=full_url, credential=credential) # OK
216- # else:
217- # # Testing Azure sink
218- # c = SecretClient(vault_url=full_url, credential=credential) # NOT OK -- user has full control
219-
220- # if not (URIValidator.URIValidator.in_domain(full_url, trusted_domain) and trusted_domain == "example.com"):
221- # # Testing Azure sink
222- # c = SecretClient(vault_url=full_url, credential=credential) # NOT OK -- user has full control
223- # else:
224- # # Testing Azure sink
225- # c = SecretClient(vault_url=full_url, credential=credential) # OK
0 commit comments