Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement HSTS (preload-only) #6490
Conversation
highfive
commented
Jun 26, 2015
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @jdm (or someone else) soon. |
hoppipolla-critic-bot
commented
Jun 26, 2015
|
Critic review: https://critic.hoppipolla.co.uk/r/5393 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
|
Great work @samfoo! I appreciate the way you've split up the commits. Sorry for the delay in looking at this PR; I've skimmed all of the commits so far, and I'll do a thorough review soon. |
|
One significant change I'll request is to switch from including the fetching of the preload list as part of bootstrapping and make it an explicit choice to update the copy that's part of the tree. We should add a mach command to fetch it, and remove the new entry from the gitignore list. |
|
@jdm Sure. Moving the preload from a bootstrap step to an explicit command shouldn't be too big of a change. I'll take a look at making it sometime this week. |
|
Also note that since hyperium/hyper#590 (implementing the Strict-Transport-Security header) is now merged, whenever the next version bump of hyper happens, the non-preload STS implementation can be finished. |
|
|
|
I've started reviewing this. Apologies for the continued delays! |
|
I've rebased to resolve the conflicts. Let me know if there's something else I can do to help with this. |
|
-S-needs-rebase -S-needs-rebase +S-needs-code-changes Reviewed 5 of 5 files at r1, 2 of 2 files at r2, 2 of 2 files at r3, 1 of 1 files at r4, 2 of 2 files at r5, 2 of 2 files at r6, 5 of 5 files at r7, 2 of 2 files at r8, 2 of 2 files at r9, 2 of 2 files at r10, 2 of 2 files at r11, 1 of 1 files at r12, 1 of 1 files at r13, 1 of 1 files at r14, 4 of 4 files at r15, 5 of 5 files at r16. components/net/resource_task.rs, line 159 [r1] (raw file):
components/net/resource_task.rs, line 186 [r1] (raw file): components/net/resource_task.rs, line 198 [r1] (raw file): components/net/resource_task.rs, line 201 [r5] (raw file): components/net/resource_task.rs, line 221 [r1] (raw file): components/net/resource_task.rs, line 223 [r1] (raw file): components/net/resource_task.rs, line 261 [r2] (raw file): components/net/resource_task.rs, line 311 [r12] (raw file): components/net/resource_task.rs, line 341 [r1] (raw file): components/net/resource_task.rs, line 370 [r11] (raw file): components/net/resource_task.rs, line 424 [r10] (raw file): components/net/resource_task.rs, line 425 [r8] (raw file): python/servo/bootstrap_commands.py, line 226 [r1] (raw file): python/servo/bootstrap_commands.py, line 230 [r1] (raw file): tests/unit/net/resource_task.rs, line 6 [r1] (raw file): tests/unit/net/resource_task.rs, line 24 [r1] (raw file): tests/unit/net/resource_task.rs, line 26 [r1] (raw file): tests/unit/net/resource_task.rs, line 29 [r6] (raw file): tests/unit/net/resource_task.rs, line 35 [r1] (raw file): tests/unit/net/resource_task.rs, line 41 [r6] (raw file): tests/unit/net/resource_task.rs, line 52 [r1] (raw file): tests/unit/net/resource_task.rs, line 68 [r2] (raw file): tests/unit/net/resource_task.rs, line 118 [r1] (raw file): tests/unit/net/resource_task.rs, line 129 [r1] (raw file): Comments from the review on Reviewable.io |
|
Please leave extracting the HSTS code into new files until the very end in a separate commit; it will be easier for me to notice the changes related to my other comment that way :) |
|
Review status: all files reviewed at latest revision, 9 unresolved discussions, all commit checks successful. components/net/resource_task.rs, line 215 [r2] (raw file): components/net/resource_task.rs, line 223 [r1] (raw file): components/net/resource_task.rs, line 341 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: all files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. components/net/resource_task.rs, line 449 [r1] (raw file): Comments from the review on Reviewable.io |
|
Still need to move the hsts list to the http_loader, but it's a slightly larger task than the rest. |
|
Reviewed 3 of 3 files at r17, 2 of 2 files at r18, 6 of 6 files at r19, 4 of 4 files at r20. components/net/hsts.rs, line 18 [r19] (raw file): components/net/http_loader.rs, line 89 [r20] (raw file): components/net/resource_task.rs, line 26 [r19] (raw file): components/net/resource_task.rs, line 263 [r20] (raw file): components/net/resource_task.rs, line 363 [r18] (raw file): tests/unit/net/hsts.rs, line 137 [r19] (raw file): Comments from the review on Reviewable.io |
|
This is very close! I'm excited! |
|
|
De-coupling makes testing a bit easier.
* No longer download the HSTS list as a bootstrap step * Check the current revision of the HSTS list into source
* Lots of rust-isms * Mutable iterator for modifying entries (much better)
* Don't pass a boolean to the HSTSEntry constructor, use an enum instead * Don't clone when securing load data * Comment about the Url bug * Change remaining assert!(... == ...) to assert_eq!(..., ...)
This respects STS for redirects as well.
* Use regex from resource task * Don't have an option of an HSTS list, default to empty
Cuts down on logger spam, and unnecessary Url::clone's
|
@bors-servo: r+ |
|
|
Implement HSTS (preload-only) Implement HSTS (preload-only) #6105 * Downloads the HSTS preload list from the chromium repo (same as gecko), then convert it to a list appropriate for servo. * Reads the preload list when creating a resource task, and implements STS for those domains. Still todo: * Read Strict-Transport-Security headers from servers and add details to the in-memory HSTS list. (note: this requires hyper or servo to implement an STS header struct. Hyper seems like the appropriate location, so I will create an issue/PR there soon). The work for this is nearly done with the exception of adding a new ControlMsg and the new header. * Persist HSTS list to disk with known hosts (perhaps a different issue should be raised for this?) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6490) <!-- Reviewable:end -->
samfoo commentedJun 26, 2015
Implement HSTS (preload-only) #6105
Still todo: