nccgroup / sobelow

Security-focused static analysis for the Phoenix Framework
Apache License 2.0
1.69k stars 95 forks source link

Timeout in version check #26

Closed kyleaa closed 7 years ago

kyleaa commented 7 years ago

It looks like there's currently an outage on for griffinbyatt.com - it takes a full minute for Cloudflare to return a 504 Gateway Timeout on this request. The terminal appears to just hang completely, as this check is performed before anything is written to out to the user. Could Sobelow print some sort of message before the network call to fetch the version so it's clear where it is hanging?

Also it appears that the .sobelow file is updated even if the check fails, I'm not sure if this is intended behavior or not.

GriffinMB commented 7 years ago

Thanks for opening this issue! I've updated Sobelow to print a message when it is attempting a version check, and added a 10 second timeout. If you want to test it out, you can remove the .sobelow file, turn off wifi, and run the sobelow command. It should timeout after 10 seconds.

I wanted the .sobelow file to be updated even on check failure to prevent a situation where a prolonged outage results in repeated, overlong request times. This may change in the future, but I think it works for now.