Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

track adoption of onion services among news organizations via the Onion-Location header #262

Merged
merged 3 commits into from
Sep 2, 2020

Conversation

redshiftzero
Copy link
Contributor

@redshiftzero redshiftzero commented Aug 20, 2020

Towards #128, please let me know what you think of adding onion service tracking.

screenshots

Screen Shot 2020-08-19 at 7 47 59 PM

per site page

Screen Shot 2020-08-19 at 6 14 01 PM

leaderboards

Grades are adjusted such that you cannot get an A+ without having an onion service (down to discuss this in more detail)

Screen Shot 2020-08-19 at 7 48 07 PM

TODO

  • edit text (done via wagtail) to broaden the scope of this site to include onion services in addition to HTTPS - will do once on staging
  • add some tests (added in 4b4d697)
  • discuss grading. This PR makes it such that if you have all the suggested HSTS options, you can only get an A (so currently A+ will go down to A). To get an A+, you need to have the onion service.

@harrislapiroff
Copy link
Contributor

Ready for an initial look over

@redshiftzero redshiftzero changed the title [wip] track adoption of onion services among news organizations via the Onion-Location header track adoption of onion services among news organizations via the Onion-Location header Aug 24, 2020
@redshiftzero redshiftzero marked this pull request as ready for review August 24, 2020 18:54
@redshiftzero
Copy link
Contributor Author

@thisisparker and I were chatting just now and:

  1. the changes in this PR shouldn't interfere with the current STN bot behavior, and
  2. once we merge this we'll update the STN twitter bot to tweet out happy messages when news organizations add Onion-Location

redshiftzero added a commit to redshiftzero/stn-tweets that referenced this pull request Aug 26, 2020
Using dict.get(key, default) here to avoid a KeyError in case:
1. this change is deployed prior to the corresponding STN change [0] or,
2. the bot compares with a prior scan that lacks the onion_available key

[0] freedomofpress/securethenews#262
@chigby chigby self-assigned this Aug 26, 2020
Copy link
Contributor

@chigby chigby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything in here looks very good to me. I played around with some scans locally and the Onion Location header detection and reporting worked as expected. So on that basis I think this is worth deploying as-is.

For future enhancements, I do think it would be nice to get some form of verification that the onion location URL is actually up and working. Yet that can come later.

@chigby chigby removed their assignment Aug 31, 2020
@maeve-fpf
Copy link
Contributor

This is very cool! Looks like a rebase will fix the npm_audit check.

Onion-Location is a header for advertising you have an onion service [0].
Onion services protect reader privacy, and enable folks in censored regions
to reach censored news organizations. Tor Browser uses the Onion-Location header
in order to display a "onion available" icon for users to click on.

The Onion-Location (like other HTTP headers) is not case sensitive, hence the
.lower() before checking for the presence of the onion-location key in the headers
dict.

Also note that "onion available" is only shown in Tor Browser [1] and the redirect
to onion only occurs  [2] if the site is over HTTPS.

[0] https://gitweb.torproject.org/tor-browser-spec.git/tree/proposals/100-onion-location-header.txt
[1] acatarineu/tor-browser@0721f13#diff-84dbdcf5e7c0177889f69f8e36ec8ea1R47
[2] acatarineu/tor-browser@3a9929a#diff-70a990c1d10c050c5fcc69b226c33c5eR2647-R2648
@redshiftzero
Copy link
Contributor Author

thanks @chigby and @maeve-fpf - rebased and CI is indeed passing now 😇

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants