Hi there,
We recently came across the URLScan.io app on the app exchange that we were excited to use. In order for it to work in our environment we had to make a few modifications that I wanted to share in case anyone else runs into these same issues.
Our environment utilizes a proxy. The first thing we noticed after installation and running the workflow was a proxy error. We downloaded the code from Github to make the following modifications.
In our app.config we added two keys for the proxy. We also had to change the config section name to urlscanio for some reason.
#[fn_urlscanio] -> original name when installed
[urlscanio]
urlscanio_api_key=OUR-API-KEY
https_proxy = https://proxy:8080
http_proxy = http://proxy:8080
In the code in the __init__ function we added the following:
self.proxies = {
"https": self.options.get("https_proxy"),
"http": self.options.get("http_proxy")
}
And then anywhere in the code we saw requests.post or a requests.get we added:
proxies=self.proxies
So it ended up looking like this (had to do it 4 times):
urlscanio_post = requests.post('https://urlscan.io/api/v1/scan/', headers=urlscanio_headers, data=json.dumps(urlscanio_data), proxies=self.proxies)
urlscanio_get = requests.get('https://urlscan.io/api/v1/result/{}/'.format(uuid), proxies=self.proxies)
urlscanio_report_get = requests.get(urlscanio_report_url, proxies=self.proxies)
urlscanio_png_get = requests.get(urlscanio_png_url, proxies=self.proxies)
In order to get the screenshot to be attached as an attachment using the base64_to_attachment function, the documentation said to add the following to the pre-process script.
inputs.base64content = workflow.properties.urlscanio.png_file
However we received an error after trying that so we modified it to this in order for it to work:
inputs.base64content = workflow.properties.urlscanio.png_base64content
I hope that explanation was clear and helps someone else if they need it.
Thanks,
Adina
------------------------------
Adina Bodkins
------------------------------