Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forces_https sometimes null #532

Closed
eloquence opened this issue Sep 5, 2018 · 3 comments
Closed

forces_https sometimes null #532

eloquence opened this issue Sep 5, 2018 · 3 comments

Comments

@eloquence
Copy link
Member

If you look at http://securedrop.org/media/documents/scanresults.csv , you will note that the forces_https column is sometimes neither True nor False. What scan result does this third state represent? If there are legitimately three states, we have to change the field to non-Boolean, otherwise we should resolve to either True or False.

@chigby
Copy link
Contributor

chigby commented Sep 17, 2018

After looking at our code and at the code for pshtt, it's my opinion that there are not three legitimate states. The non-boolean state occurs when the insecure version of the domain (http:// or http://www.) is live but is not a redirect, meaning it does not return a 3xx status or have a Location header. I do not believe it is the intended behavior of pshtt to return None in these cases, but here we are.

I recommend we treat None as False in our scan results for forces_https.

@eloquence
Copy link
Member Author

That makes sense to me, thanks. Indeed looking at the scan results with None from the current directory there are two cases that don't have the redirect (Houston Chronicle and Huffington Post) and one that returns a 404 on the non-HTTPS URL.

Would you mind filing an upstream issue with pshtt as well if there isn't one already?

chigby added a commit that referenced this issue Sep 17, 2018
Here, `pshtt` sometimes returns `None` in the case where the landing
page domain's non-HTTPS responses are not redirects.  We consider this
a failure of our forces-http test, so we want to ensure those cases
are converted to `False` before being saved.

Test added with a VCR recording of a domain that exhibited the quirk
of having `None` in `pshtt_results['Strictly Forces HTTPS']`.

Refs #532
chigby added a commit that referenced this issue Sep 17, 2018
Here, `pshtt` sometimes returns `None` in the case where the landing
page domain's non-HTTPS responses are not redirects.  We consider this
a failure of our forces-http test, so we want to ensure those cases
are converted to `False` before being saved.

Test added with a VCR recording of a domain that exhibited the quirk
of having `None` in `pshtt_results['Strictly Forces HTTPS']`.

Refs #532
@chigby chigby self-assigned this Sep 17, 2018
@chigby
Copy link
Contributor

chigby commented Sep 17, 2018

I've created cisagov/pshtt#176 to track this on their end.

chigby added a commit that referenced this issue Sep 24, 2018
Here, `pshtt` sometimes returns `None` in the case where the landing
page domain's non-HTTPS responses are not redirects.  We consider this
a failure of our forces-http test, so we want to ensure those cases
are converted to `False` before being saved.

Test added with a VCR recording of a domain that exhibited the quirk
of having `None` in `pshtt_results['Strictly Forces HTTPS']`.

Refs #532
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants