diff --git a/deploying-https.html b/deploying-https.html deleted file mode 100644 index 7f7425c..0000000 --- a/deploying-https.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - -

How to Deploy HTTPS Correctly

-
-

By Chris Palmer and Yan Zhu

-

Originally published on 15 Nov 2010. Revised on 11 Dec 2013.

-

Internet technologists have always known that HTTP is insecure, causing many risks to users. Because HTTP traffic is unencrypted, any data sent over HTTP can be read and modified by anyone who has access to the network. As revealed by the Snowden NSA surveillance documents, HTTP traffic can also be collected and searched by government agencies without notice to users or webmasters. Given these risks, EFF believes that every website should support HTTPS on all pages as soon as possible.

-

While HTTPS has long existed as the bare minimum for web security, some websites have been slow to adopt it. In part, this is because correctly and completely serving an application over HTTPS takes some care.

-

This article is designed to encourage and assist website operators in implementing and improving HTTPS support. Although no precaution will defend against all threats, supporting HTTPS will protect users from a wide range of common attacks.

-

Background

-

HTTPS provides three security guarantees:

-
  1. Server authentication allows users to have some confidence that they are talking to the true application server. Without this guarantee, there can be no guarantee of confidentiality or integrity.
  2. -
  3. Data confidentiality means that eavesdroppers cannot understand the content of the communications between the user's browser and the web server, because the data is encrypted.
  4. -
  5. Data integrity means that a network attacker cannot damage or alter the content of the communications between the user's browser and the web server, because they are validated with a cryptographic message authentication code.
  6. -

HTTP provides no security guarantees, and applications that use it cannot possibly provide users any security. When using a web application hosted via HTTP, people have no way of knowing whether they are talking to the true application server, nor can they be sure attackers have not read or modified communications between the user's computer and the server.

-

Modes of Attack and Defense

-

However users connect to the Internet, there are a variety of people who can attack them--whether spying on them, impersonating them, tampering with their communications, or all three of these. The wifi network operator can do this; any ISP in the path between client and server can do it; anyone who can reconfigure the wifi router or another router can do it; and often, anyone else using the same network can do it, too.

-

Firesheep is an example of a passive network attack: it eavesdrops on the contents of network communications between browser and server, but does not re-route or modify them. Government surveillance programs such as XKeyscore also use passive attacks on HTTP traffic to collect massive amounts of online communication data.

-

By contrast, other freely-available tools perform active network attacks, in which the attacker does modify the contents of and/or re-route communications. These tools range from serious, such as sslstrip, to silly, like the Upside-Down-Ternet. Although Upside-Down-Ternet is a funny prank, it is technically identical to potentially more damaging attacks such as an attack that injects malicious code or incorrect information into web pages; at the same time, it shows that such attacks are easy enough to be jokes. Free wifi hotspots have been known to inject advertisements dynamically into web pages that users read--indicating that active network attacks are a viable business model. Tools like Cain and Abel enable a range of attacks, including re-routing local network traffic through the attacker's system. (Also see Arpspoof and dsniff.)

-

Only a mechanism that provides (at least) authentication, confidentiality, and integrity can defend against a range of attacks. HTTPS is currently our best option for web applications.

-

However, there are some potential pitfalls that site operators must avoid in order to deploy HTTPS securely.

-

Mixed Content

-

When hosting an application over HTTPS, there can be no mixed content; that is, all content in the page must be fetched via HTTPS. It is common to see partial HTTPS support on sites, in which the main pages are fetched via HTTPS but some or all of the media elements, stylesheets, and JavaScript in the page are fetched via HTTP.

-

This is unsafe because although the main page load is protected against active and passive network attack, none of the other resources are. If a page loads some JavaScript or CSS code via HTTP, an attacker can provide a false, malicious code file and take over the page's DOM once it loads. Then, the user would be back to a situation of having no security. This is why all mainstream browsers warn users about pages that load mixed content. Nor is it safe to reference images via HTTP: What if the attacker swapped the Save Message and Delete Message icons in a webmail app?

-

You must serve the entire application domain over HTTPS. Redirect HTTP requests with HTTP 301 or 302 responses to the equivalent HTTPS resource.

-

Some site operators provide only the login page over HTTPS, on the theory that only the user's password is sensitive. These sites' users are vulnerable to passive and active attacks. -

Unfortunately, many sites today load content from external sites and CDN's that do not support HTTPS. If it's not possible to serve these resources from your own host or another one that supports HTTPS, you should urge these other sites to start supporting HTTPS immediately.

-

Security and Cookies

-

As Chris Palmer described in a paper on secure session management for web applications, site operators must scope sensitive cookies (such as cookies used for user authentication) to the secure origin. If a cookie is broadly scoped (with the Domain attribute in the Set-Cookie: header), it may "leak" to other hosts or applications in the same domain--potentially less-secure hosts or applications.

-

Similarly, the application must set the Secure attribute on the cookie when setting it. This attribute instructs the browser to send the cookie only over secure (HTTPS) transport, never insecure (HTTP).

-

Use HTTP Strict Transport Security

-

HTTP Strict Transport Security (HSTS) is an HTTP protocol extension that enables site operators to instruct browsers to expect the site to use HTTPS.

-

Although not all browsers yet support HSTS, EFF urges those that don't--we're looking especially at you, Apple and Microsoft--to follow the lead Google, Opera, and Mozilla have set by adopting this useful security mechanism. Indeed, ultimately we expect HTTPS (and possibly newer protocols such as SPDY and QUIC) to replace HTTP entirely, the way SSH replaced Telnet and rsh.

-

As an extra precaution, your site should support HSTS preloading, which prevents interception of an HTTP request if the browser hasn't yet received a valid HSTS header from the server. HSTS preloading is implemented via an opt-in list of domains that is included in Chromium, Google Chrome, and Firefox. See Chromium's page for instructions on getting your site added to this list. Note that you must also send an HSTS header with a max-age greater value than 18 weeks for Firefox to include your site in their HSTS preload list.

-

We recently enabled HSTS and HSTS preloading for eff.org. It took less than an hour to set up, and we found a way to do it without forcibly redirecting users to HTTPS, so we can state an unequivocal preference for HTTPS access while still making the site available in HTTP. It worked like a charm and a significant fraction of our users are now automatically accessing our site in HTTPS, perhaps without even knowing it.

-

Choose Strong Protocols and Cipher Suites

-Here is a brief list of recommendations for choosing secure protocols and cipher suites in an SSL deployment: -
    -
  • Disable support for SSLv2, SSLv3, and TLS 1.0.
  • -
  • Support TLS 1.1 and 1.2.
  • -
  • Disable NULL, aNULL, and eNULL ciphersuites, which do not offer both encryption and authentication.
  • -
  • Use private keys that are at least as secure as a 2048-bit RSA key.
  • -
  • Prefer ciphersuites that include ephemeral Diffie-Hellman key exchange. These offer the important property of Perfect Forward Secrecy, which prevents decryption of past web traffic if your SSL private key is compromised in the future.
  • -
  • Disable ciphersuites with keys sizes smaller than 128 bits for encryption.
  • -
  • Disable ciphersuites that use MD5 for hashing. SHA-1 is also discouraged but may be required for compatibility with TLS 1.0 and SSLv3.
  • -
  • Disable ciphersuites that use RC4 for encryption. AES-CBC is preferable to RC4 but vulnerable to the BEAST attack. Thus, AES-GCM is often recommended.
  • -
  • Disable TLS compression in order to prevent the CRIME attack.
  • -
  • Only support secure TLS renegotiations compliant with RFC 5746, or disable TLS renegotiations entirely.
  • -
-

A useful tool for testing for well-known weaknesses in an existing HTTPS deployment is Qualys's SSL Server Test.

-

Performance Concerns

-

Many site operators report that they can't move to HTTPS for performance reasons. However, most people who say this have not actually measured any performance loss, may not have measured performance at all, and have not profiled and optimized their site's behavior. Usually, sites have latency far higher and/or throughput far lower than necessary even when hosting over HTTP--indicating HTTPS is not the problem.

-

The crux of the performance problem is usually at the content layer, and also often at the database layer. Web applications are fundamentally I/O-bound, after all. Consider this wisdom from the Gmail developers:

-

First, we listed every transaction between the web browser and Google's servers, starting with the moment the "Sign in" button is pressed. To do this, we used a lot of different web development tools, like Httpwatch, WireShark, and Fiddler, plus our own performance measuring systems. [...]

-

We spent hours poring over these traces to see exactly what was happening between the browser and Gmail during the sign-in sequence, and we found that there were between fourteen and twenty-four HTTP requests required to load an inbox and display it. To put these numbers in perspective, a popular network news site's home page required about a 180 requests to fully load when I checked it yesterday. But when we examined our requests, we realized that we could do better. We decided to attack the problem from several directions at once: reduce the number of overall requests, make more of the requests cacheable by the browser, and reduce the overhead of each request.

-

We made good progress on every front. We reduced the weight of each request itself by eliminating or narrowing the scope of some of our cookies. We made sure that all our images were cacheable by the browser, and we consolidated small icon images into single meta-images, a technique known as spriting. We combined several requests into a single combined request and response. The result is that it now takes as few as four requests from the click of the "Sign in" button to the display of your inbox.

-
-

Google's Adam Langley provides additional detail:

-

In order to do this we had to deploy no additional machines and no special hardware. On our production frontend machines, SSL/TLS accounts for less than 1% of the CPU load, less than 10KB of memory per connection and less than 2% of network overhead. Many people believe that SSL takes a lot of CPU time and we hope the above numbers (public for the first time) will help to dispel that. [emphasis in original]

-
-

Is it any wonder Gmail performs well, even when using HTTPS exclusively? Site operators can realize incremental improvement by gradually tuning their web applications. Chris gave a presentation to this effect at Web 2.0 Expo 2009.

-

Conclusion

-

HTTPS provides the baseline of safety for web application users, and there is no performance- or cost-based reason to stick with HTTP. Web application providers undermine their business models when, by continuing to use HTTP, they enable a wide range of attackers anywhere on the internet to compromise users' information.

- -
- - diff --git a/deploying-https.md b/deploying-https.md new file mode 100644 index 0000000..5faa643 --- /dev/null +++ b/deploying-https.md @@ -0,0 +1,274 @@ +# How to Deploy HTTPS Correctly + +By [Chris Palmer](http://noncombatant.org) and [Yan +Zhu](/about/staff/yan-zhu) + +Originally published on 15 Nov 2010. Revised on 11 Dec 2013. + +Internet technologists have always known that HTTP is insecure, causing +many risks to users. Because HTTP traffic is unencrypted, any data sent +over HTTP can be read and modified by anyone who has access to the +network. As revealed by the Snowden NSA surveillance documents, HTTP +traffic can also be collected and searched by government agencies +without notice to users or webmasters. Given these risks, EFF believes +that every website should support HTTPS on all pages as soon as +possible. + +While HTTPS has long existed as the bare minimum for web security, some +websites have been slow to adopt it. In part, this is because correctly +and completely serving an application over HTTPS takes some care. + +This article is designed to encourage and assist website operators in +implementing and improving HTTPS support. Although no precaution will +defend against all threats, supporting HTTPS will protect users from a +wide range of common attacks. + +## Background + +HTTPS provides three security guarantees: + +1. **Server authentication** allows users to have some confidence that + they are talking to the true application server. Without this + guarantee, there can be no guarantee of confidentiality or + integrity. +2. **Data confidentiality** means that eavesdroppers cannot understand + the content of the communications between the user's browser and the + web server, because the data is encrypted. +3. **Data integrity** means that a network attacker cannot damage or + alter the content of the communications between the user's browser + and the web server, because they are validated with a cryptographic + *[message authentication + code](https://secure.wikimedia.org/wikipedia/en/wiki/Message_authentication_code)*. + +**HTTP provides no security guarantees**, and applications that use it +**cannot possibly provide users any security**. When using a web +application hosted via HTTP, people have no way of knowing whether they +are talking to the true application server, nor can they be sure +attackers have not read or modified communications between the user's +computer and the server. + +## Modes of Attack and Defense + +However users connect to the Internet, there are a variety of people who +can attack them--whether spying on them, impersonating them, tampering +with their communications, or all three of these. The wifi network +operator can do this; any ISP in the path between client and server can +do it; anyone who can reconfigure the wifi router or another router can +do it; and often, anyone else using the same network can do it, too. + +[Firesheep](http://codebutler.com/firesheep-a-day-later/) is an example +of a *passive network attack*: it eavesdrops on the contents of network +communications between browser and server, but does not re-route or +modify them. Government surveillance programs such as +[XKeyscore](http://www.theguardian.com/world/2013/jul/31/nsa-top-secret-program-online-data) +also use passive attacks on HTTP traffic to collect massive amounts of +online communication data. + +By contrast, other freely-available tools perform *active network +attacks*, in which the attacker does modify the contents of and/or +re-route communications. These tools range from serious, such as +[sslstrip](http://www.thoughtcrime.org/software/sslstrip/), to silly, +like [the +Upside-Down-Ternet](http://www.ex-parrot.com/pete/upside-down-ternet.html). +Although Upside-Down-Ternet is a funny prank, it is technically +identical to potentially more damaging attacks such as an attack that +injects malicious code or incorrect information into web pages; at the +same time, it shows that such attacks are easy enough to be jokes. Free +wifi hotspots have been known to inject advertisements dynamically into +web pages that users read--indicating that active network attacks are a +viable business model. Tools like [Cain and +Abel](http://www.oxid.it/cain.html) enable a range of attacks, including +re-routing local network traffic through the attacker's system. (Also +see [Arpspoof](http://arpspoof.sourceforge.net/) and +[dsniff](http://www.monkey.org/~dugsong/dsniff/).) + +Only a mechanism that provides (at least) authentication, +confidentiality, and integrity can defend against a range of attacks. +HTTPS is currently our best option for web applications. + +However, there are some potential pitfalls that site operators must +avoid in order to deploy HTTPS securely. + +## Mixed Content + +When hosting an application over HTTPS, there can be no *mixed content*; +that is, all content in the page must be fetched via HTTPS. It is common +to see partial HTTPS support on sites, in which the main pages are +fetched via HTTPS but some or all of the media elements, stylesheets, +and JavaScript in the page are fetched via HTTP. + +This is unsafe because although the main page load is protected against +active and passive network attack, none of the other resources are. If a +page loads some JavaScript or CSS code via HTTP, an attacker can provide +a false, malicious code file and take over the page's DOM once it loads. +Then, the user would be back to a situation of having no security. This +is why all mainstream browsers warn users about pages that load mixed +content. Nor is it safe to reference images via HTTP: What if the +attacker swapped the Save Message and Delete Message icons in a webmail +app? + +**You must serve the entire application domain over HTTPS.** Redirect +HTTP requests with HTTP 301 or 302 responses to the equivalent HTTPS +resource. + +Some site operators provide only the login page over HTTPS, on the +theory that only the user's password is sensitive. These sites' users +are [vulnerable to passive and active +attacks](/deeplinks/2010/10/message-firesheep-baaaad-websites-implement). + +Unfortunately, many sites today load content from external sites and +CDN's that do not support HTTPS. If it's not possible to serve these +resources from your own host or another one that supports HTTPS, you +should urge these other sites to start supporting HTTPS immediately. + +## Security and Cookies + +As Chris Palmer described in a [paper on secure session management for +web +applications](https://www.isecpartners.com/files/web-session-management.pdf), +site operators must scope sensitive cookies (such as cookies used for +user authentication) to the secure origin. If a cookie is broadly scoped +(with the Domain attribute in the Set-Cookie: header), it may "leak" to +other hosts or applications in the same domain--potentially less-secure +hosts or applications. + +Similarly, the application must set the Secure attribute on the cookie +when setting it. This attribute instructs the browser to send the cookie +only over secure (HTTPS) transport, never insecure (HTTP). + +## Use HTTP Strict Transport Security + +[HTTP Strict Transport +Security](https://en.wikipedia.org/wiki/Strict_Transport_Security) +(HSTS) is an HTTP protocol extension that enables site operators to +instruct browsers to expect the site to use HTTPS. + +Although not all browsers yet support HSTS, EFF urges those that +don't--we're looking especially at you, Apple and Microsoft--to follow +the lead Google, Opera, and Mozilla have set by adopting this useful +security mechanism. Indeed, ultimately we expect HTTPS (and possibly +newer protocols such as [SPDY](https://en.wikipedia.org/wiki/SPDY) and +[QUIC](https://en.wikipedia.org/wiki/QUIC)) to replace HTTP entirely, +the way SSH replaced Telnet and rsh. + +As an extra precaution, your site should support HSTS preloading, which +prevents interception of an HTTP request if the browser hasn't yet +received a valid HSTS header from the server. HSTS preloading is +implemented via an opt-in list of domains that is included in Chromium, +Google Chrome, and Firefox. See [Chromium's +page](http://www.chromium.org/sts) for instructions on getting your site +added to this list. Note that you must also send an HSTS header with a +max-age greater value than 18 weeks for Firefox to include your site in +their HSTS preload list. + +We recently enabled HSTS and HSTS preloading for eff.org. It took less +than an hour to set up, and we found a way to do it without forcibly +redirecting users to HTTPS, so we can state an unequivocal preference +for HTTPS access while still making the site available in HTTP. It +worked like a charm and a significant fraction of our users are now +automatically accessing our site in HTTPS, perhaps without even knowing +it. + +## Choose Strong Protocols and Cipher Suites + +Here is a brief list of recommendations for choosing secure protocols +and cipher suites in an SSL deployment: + + - Disable support for SSLv2, SSLv3, and TLS 1.0. + - Support TLS 1.1 and 1.2. + - Disable NULL, aNULL, and eNULL ciphersuites, which do not offer both + encryption and authentication. + - Use private keys that are at least as secure as a 2048-bit RSA key. + - Prefer ciphersuites that include **ephemeral Diffie-Hellman key + exchange**. These offer the important property of [Perfect Forward + Secrecy](https://www.eff.org/deeplinks/2013/08/pushing-perfect-forward-secrecy-important-web-privacy-protection), + which prevents decryption of past web traffic if your SSL private + key is compromised in the future. + - Disable ciphersuites with keys sizes smaller than 128 bits for + encryption. + - Disable ciphersuites that use MD5 for hashing. SHA-1 is also + discouraged but may be required for compatibility with TLS 1.0 and + SSLv3. + - Disable ciphersuites that use RC4 for encryption. AES-CBC is + preferable to RC4 but vulnerable to the + [BEAST](https://www.imperialviolet.org/2011/09/23/chromeandbeast.html) + attack. Thus, AES-GCM is often recommended. + - Disable TLS compression in order to prevent the [CRIME + attack](https://en.wikipedia.org/wiki/CRIME_%28security_exploit%29). + - Only support secure TLS renegotiations compliant with + [RFC 5746](http://www.ietf.org/rfc/rfc5746.txt), or disable TLS + renegotiations entirely. + +A useful tool for testing for well-known weaknesses in an existing HTTPS +deployment is Qualys's [SSL Server +Test](https://www.ssllabs.com/ssltest/). + +## Performance Concerns + +Many site operators report that they can't move to HTTPS for performance +reasons. However, most people who say this have not actually measured +any performance loss, may not have measured performance at all, and have +not profiled and optimized their site's behavior. Usually, sites have +latency far higher and/or throughput far lower than necessary even when +hosting over HTTP--indicating HTTPS is not the problem. + +The crux of the performance problem is usually at the content layer, and +also often at the database layer. Web applications are fundamentally +I/O-bound, after all. Consider [this wisdom from the Gmail +developers](http://gmailblog.blogspot.com/2008/05/need-for-speed-path-to-faster-loading.html): + +> First, we listed every transaction between the web browser and +> Google's servers, starting with the moment the "Sign in" button is +> pressed. To do this, we used a lot of different web development tools, +> like [Httpwatch](http://httpwatch.com/), +> [WireShark](http://www.wireshark.org/), and +> [Fiddler](http://www.fiddlertool.com/fiddler/), plus our own +> performance measuring systems. \[...\] +> +> We spent hours poring over these traces to see exactly what was +> happening between the browser and Gmail during the sign-in sequence, +> and we found that there were between fourteen and twenty-four HTTP +> requests required to load an inbox and display it. To put these +> numbers in perspective, a popular network news site's home page +> required about a 180 requests to fully load when I checked it +> yesterday. But when we examined our requests, we realized that we +> could do better. We decided to attack the problem from several +> directions at once: reduce the number of overall requests, make more +> of the requests cacheable by the browser, and reduce the overhead of +> each request. +> +> We made good progress on every front. We reduced the weight of each +> request itself by eliminating or narrowing the scope of some of our +> cookies. We made sure that all our images were cacheable by the +> browser, and we consolidated small icon images into single +> meta-images, a technique known as spriting. We combined several +> requests into a single combined request and response. The result is +> that it now takes as few as four requests from the click of the "Sign +> in" button to the display of your inbox. + +Google's [Adam Langley provides additional +detail](http://www.imperialviolet.org/2010/06/25/overclocking-ssl.html): + +> In order to do this we had to deploy *no additional machines* and *no +> special hardware*. On our production frontend machines, SSL/TLS +> accounts for less than 1% of the CPU load, less than 10KB of memory +> per connection and less than 2% of network overhead. Many people +> believe that SSL takes a lot of CPU time and we hope the above numbers +> (public for the first time) will help to dispel that. \[emphasis in +> original\] + +Is it any wonder Gmail performs well, even when using HTTPS exclusively? +Site operators can realize incremental improvement by gradually tuning +their web applications. Chris gave a presentation to this effect at +[Web 2.0 +Expo 2009](http://assets.en.oreilly.com/1/event/22/High%20Performance,%20Low%20Cost,%20and%20Strong%20Security_%20Pick%20Any%20Three%20Presentation.pdf). + +## Conclusion + +HTTPS provides the baseline of safety for web application users, and +there is no performance- or cost-based reason to stick with HTTP. Web +application providers [undermine their business +models](http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1421553) +when, by continuing to use HTTP, they enable a wide range of attackers +anywhere on the internet to compromise users' information. + diff --git a/development.html b/development.html deleted file mode 100644 index 38e5708..0000000 --- a/development.html +++ /dev/null @@ -1,54 +0,0 @@ - -HTTPS Everywhere Development - -

Pointers for developers

-

-

Testing and contributing changes to the source code

-

Please work off of the "3.0" branch if you're submitting changes to the latest stable release and use "master" if you're submitting changes to the latest development release.

-

HTTPS Everywhere consists of a large number of rules for switching sites from HTTP to HTTPS. You can read more about how to write these rules here.

-

If you want to create new rules to submit to us, we expect them to be in the src/chrome/content/rules directory. That directory also contains a useful script, make-trivial-rule, to create a simple rule for a specified domain. There is also a script called trivial-validate.py, to check all the pending rules for several common errors and oversights. For example, if you wanted to make a rule for the example.com domain, you could run

-
sh ./make-trivial-rule example.com

-inside the rules directory. This would create Example.com.xml, which you could then take a look at and edit based on your knowledge of any specific URLs at example.com that do or don't work in HTTPS. You could then run

-
python ../../../../utils/trivial-validate.py

-to make sure that your rule is free of common mistakes.

-

To create a test package for installing with Firefox, you'll need a Cygwin environment under Windows, or a Linux or Unix install. Simply run this from the https-everywhere.git toplevel directory:

-
sh ./makexpi.sh

-This should create an xpi file in ./pkg that you can install using a file:// url in Firefox.

-

Similarly, to create a test package for Chrome, run:

-
sh ./makecrx.sh

-Once you've tested your changes, you can submit them for review via any of the following:

-

-

A quick HOWTO on working with Git

-

You may want to also look at the Git Reference, GitHub Help Site and the Tor Project's Git documentation to fill in the gaps here, but the below should be enough to get the basics of the workflow down.

-

First, tell git your name:

-
git config --global user.name "Your Name"
-git config --global user.email "you@example.com"

-Then, get a copy of the 'origin' repository:

-
git clone git://git.torproject.org/https-everywhere.git
-cd https-everywhere

-Alternatively, if you already have a Github account, you can create a "fork" of the repository on Github at https://github.com/EFForg/https-everywhere. See this page for a tutorial.

-

Once you have a local copy of the repository, create a new branch for your changes and check it out:

-
git checkout -b my-new-rules <starting branch>

-where <starting branch> is "3.0" if you want to modify the latest stable release and "master" if you want to modify the latest development release.

-

When you want to send us your work, you'll need to add any new files to the index with git add:

-
git add ./src/chrome/content/rules/MyRule1.xml
-git add ./src/chrome/content/rules/MyRule2.xml

-You can now commit your changes to the local branch. To make things easier, you should commit each xml file individually:

-
git commit ./src/chrome/content/rules/MyRule1.xml
-git commit ./src/chrome/content/rules/MyRule2.xml

-Now, you need a place to publish your changes. You can create a free github account here: https://github.com/signup/free. http://help.github.com/ describes the account creation process and some other github-specific things.

-

Once you have created your account and added your remote in your local checkout, you want to push your branch to your github remote:

-
git push github my-new-rules:my-new-rules

-Periodically, you should re-fetch the master repository:

-
git pull master
- - diff --git a/development.md b/development.md new file mode 100644 index 0000000..9a3d2af --- /dev/null +++ b/development.md @@ -0,0 +1,153 @@ +HTTPS Everywhere Development + +### Pointers for developers + + - **License:** GPL version 3+ (although most of the code is GPL-2 + compatible) + - **Source code:** Available via Git with + *git clone https://git.torproject.org/https-everywhere.git* or + browse the source via + [gitweb](https://gitweb.torproject.org/https-everywhere.git). You + can fork and open pull requests using Github at + . + - **Translations:** If you would like to help translate HTTPS + Everywhere into another language, you can do that [through + Transifex](https://www.transifex.com/projects/p/torproject/resources/). + - **Bug tracker:** + (to submit + bugs, make an account or use the anonymous one — + "cypherpunks"/"writecode", though you won't see replies unless you + put an email address in the CC field). Bugs that are caused by + rulesets should be tagged "httpse-ruleset-bug", and can be viewed + [in this + report](https://trac.torproject.org/projects/tor/report/48). + Alternatively, you can open issues at the Github link above. + - **Mailing lists:** The + [https-everywhere](https://lists.eff.org/mailman/listinfo/https-everywhere) + list ([archives](https://lists.eff.org/pipermail/https-everywhere/)) + is for discussing the project as a whole; the + [https-everywhere-rules](https://lists.eff.org/mailman/listinfo/https-everywhere-rules) + mailing list + ([archives](https://lists.eff.org/pipermail/https-everywhere-rules)) + is for discussing the [rulesets](/https-everywhere/rulesets) and + their contents, including patches and git pull requests. + - **IRC:** \#https-everywhere on irc.oftc.net. If you ask a question, + be sure to stay in the channel — someone may reply a few hours or a + few days later. + - **Adding support for new sites:** the rulesets are documented + [here](/https-everywhere/rulesets). + +## Testing and contributing changes to the source code + +Please work off of the "3.0" branch if you're submitting changes to the +latest stable release and use "master" if you're submitting changes to +the latest development release. + +HTTPS Everywhere consists of a large number of rules for switching sites +from HTTP to HTTPS. You can read more about how to write these rules +[here](/https-everywhere/rulesets). + +If you want to create new rules to submit to us, we expect them to be in +the src/chrome/content/rules directory. That directory also contains a +useful script, make-trivial-rule, to create a simple rule for a +specified domain. There is also a script called trivial-validate.py, to +check all the pending rules for several common errors and oversights. +For example, if you wanted to make a rule for the example.com domain, +you could run + + sh ./make-trivial-rule example.com + +inside the rules directory. This would create Example.com.xml, which you +could then take a look at and edit based on your knowledge of any +specific URLs at example.com that do or don't work in HTTPS. You could +then run + + python ../../../../utils/trivial-validate.py + +to make sure that your rule is free of common mistakes. + +To create a test package for installing with Firefox, you'll need a +[Cygwin](http://www.cygwin.com/) environment under Windows, or a Linux +or Unix install. Simply run this from the https-everywhere.git toplevel +directory: + + sh ./makexpi.sh + +This should create an xpi file in ./pkg that you can install using a +file:// url in Firefox. + +Similarly, to create a test package for Chrome, run: + + sh ./makecrx.sh + +Once you've tested your changes, you can submit them for review via any +of the following: + + - Email https-everywhere-rules@eff.org to tell us about your changes. + You can either specify a remote repository or use the following + command to create a patch file: + + git format-patch + + - Open a pull request at . + +## A quick HOWTO on working with Git + +You may want to also look at the [Git Reference](http://gitref.org/), +[GitHub Help Site](http://help.github.com/) and the [Tor Project's Git +documentation](https://gitweb.torproject.org/githax.git/blob_plain/HEAD:/doc/Howto.txt) +to fill in the gaps here, but the below should be enough to get the +basics of the workflow down. + +First, tell git your name: + + git config --global user.name "Your Name" + git config --global user.email "you@example.com" + +Then, get a copy of the 'origin' repository: + + git clone git://git.torproject.org/https-everywhere.git + cd https-everywhere + +Alternatively, if you already have a Github account, you can create a +"fork" of the repository on Github at +. See [this +page](https://help.github.com/articles/fork-a-repo) for a tutorial. + +Once you have a local copy of the repository, create a new branch for +your changes and check it out: + + git checkout -b my-new-rules + +where \ is "3.0" if you want to modify the latest +stable release and "master" if you want to modify the latest development +release. + +When you want to send us your work, you'll need to add any new files to +the index with git add: + + git add ./src/chrome/content/rules/MyRule1.xml + git add ./src/chrome/content/rules/MyRule2.xml + +You can now commit your changes to the local branch. To make things +easier, you should commit each xml file individually: + + git commit ./src/chrome/content/rules/MyRule1.xml + git commit ./src/chrome/content/rules/MyRule2.xml + +Now, you need a place to publish your changes. You can create a free +github account here: +[https://github.com/signup/free](https://github.com/signup/free "https://github.com/signup/free"). +[http://help.github.com/](http://help.github.com/ "http://help.github.com/") +describes the account creation process and some other github-specific +things. + +Once you have created your account and added your remote in your local +checkout, you want to push your branch to your github remote: + + git push github my-new-rules:my-new-rules + +Periodically, you should re-fetch the master repository: + + git pull master + diff --git a/faq.html b/faq.html deleted file mode 100644 index 089b182..0000000 --- a/faq.html +++ /dev/null @@ -1,67 +0,0 @@ - - -HTTPS Everywhere FAQ | Electronic Frontier Foundation - -

This page answers frequently-asked questions about EFF's HTTPS Everywhere project. If your question isn't answered below, you can try the resources listed here.

-

-

Q. What if HTTPS Everywhere breaks some site that I use?

-

A. This is occasionally possible because of inconsistent support for HTTPS on sites (e.g., when a site seems to support HTTPS access but makes a few, unpredictable, parts of the site unavailable in HTTPS). If you report the problem to us, we can try to fix it. In the meantime, you can disable the rule affecting that particular site in your own copy of HTTPS Everywhere by clicking on the HTTPS Everywhere toolbar button () and unchecking the rule for that site.

-

You can also report the problem to the site, since they have the power to fix it!

-

-

Q. Why is HTTPS Everywhere preventing me from joining this hotel/school/other wireless network?

-

A. Some wireless networks hijack your HTTP connections when you first join them, in order to demand authentication or simply to try to make you agree to terms of use. HTTPS pages are protected against this type of hijacking, which is as it should be. If you go to a website that isn't protected by HTTPS Everywhere (currently, yahoo.com is one such site) that will allow your browser to be hijacked.

-

-

Q. Will there be a version of HTTPS Everywhere for IE, Safari, Opera, or some other browser?

-

A. Some members of our developer community are working on an IE port of HTTPS Everywhere. As of early 2012, the Safari extension API does not offer a way to perform secure rewriting of http requests to https. But if you happen to know a way to perform secure request rewriting in these browsers, feel free to let us know at https-everywhere at EFF.org (but note that modifying document.location or window.location in JavaScript is not secure).

-

-

Q. Why use a whitelist of sites that support HTTPS? Why can't you try to use HTTPS for every last site, and only fall back to HTTP if it isn't available?

-

A. There are several problems with the idea of trying to automatically detect HTTPS on every site. Firstly, there is no guarantee that sites are going to give the same response via HTTPS that they give via HTTP. As of 2010, LiveJournal is a good example of this problem: compare these HTTP and HTTPS responses. Secondly, we don't think it's possible to test for HTTPS in real time without introducing security vulnerabilities (What should the extension do if the HTTPS connection attempt fails? Falling back to insecure HTTP isn't safe). Lastly, in some cases, HTTPS Everywhere has to perform quite complicated transformations on URIs — for example until recently the Wikipedia rule had to turn an address like http://en.wikipedia.org/wiki/World_Wide_Web into one like https://secure.wikimedia.org/wikipedia/en/wiki/World_Wide_Web because HTTPS was not available on Wikipedia's usual domains.

-

-

Q. How do I get rid of/move the HTTPS Everywhere button in the toolbar?

-

The HTTPS Everywhere button is useful because it allows you to see, and disable, a ruleset if it happens to be causing problems with a site. But if you'd rather disable it, go to View->Toolbars->Customize, and drag the button out of the toolbar into the Addons bar at the bottom of the page. Then you can hide the Addons bar. (In theory you should be able to drag it into the tray of available icons too, but that may trigger this bug.

-

-

Q. Why does HTTPS Everywhere use encrypted.google.com? It looks different...

-

A. The HTTPS version of Google at encrypted.google.com looks different, and sometimes omits links and buttons, that are on the www.google.com domain. In the past, HTTPS Everywhere had to use encrypted.google.com because that was the only way to perform searches over https. It is now possible to use https://www.google.com, but we continue to use the encrypted.google.com subdomain by default, because it provides slightly better security properties. However, you can use www.google.com instead by enabling the "Search www.google.com" ruleset in the HTTPS Everywhere preferences.

-

-

Q. When does HTTPS Everywhere protect me? When does it not protect me?

-

A. HTTPS Everywhere protects you only when you are using encrypted portions of supported web sites. On a supported site, it will automatically activate HTTPS encryption for all known supported parts of the site (for some sites, this might be only a portion of the entire site). For example, if your web mail provider does not support HTTPS at all, HTTPS Everywhere can't make your access to your web mail secure. Similarly, if a site (like the New York Times website) allows HTTPS for text but not images, someone might be able to see which images your browser loads and guess what you're accessing.

-

HTTPS Everywhere depends entirely on the security features of the individual web sites that you use; it activates those security features, but it can't create them if they don't already exist. If you use a site not supported by HTTPS Everywhere or a site that provides some information in an insecure way, HTTPS Everywhere can't provide additional protection for your use of that site. Please remember to check that a particular site's security is working to the level you expect before sending or receiving confidential information, including passwords.

-

One way to determine what level of protection you're getting when using a particular site is to use a packet-sniffing tool like Wireshark to record your own communications with the site. The resulting view of your communications is about the same as what an eavesdropper on your wifi network or at your ISP would see. This way, you can determine whether some or all of your communications would be protected; however, it may be quite time-consuming to make sense of the Wireshark output with enough care to get a definitive answer.

-

-

Q. What does HTTPS Everywhere protect me against?

-

A. On supported parts of supported sites, HTTPS Everywhere enables the sites' HTTPS protection which can protect you against eavesdropping and tampering with the contents of the site or with the information you send to the site. Ideally, this provides some protection against an attacker learning the content of the information flowing in each direction — for instance, the text of e-mail messages you send or receive through a webmail site, the products you browse or purchase on an e-commerce site, or the particular articles you read on a reference site.

-

However, HTTPS Everywhere does not conceal the identities of the sites you access, the amount of time you spend using them, or the amount of information you upload or download from a particular site. For example, if you access http://www.eff.org/issues/nsa-spying and HTTPS Everywhere rewrites it to https://www.eff.org/issues/nsa-spying, an eavesdropper can still trivially recognize that you are accessing www.eff.org (but might not know which issue you are reading about). In general, the entire hostname part of the URL remains exposed to the eavesdropper because this must be sent repeatedly in unencrypted form while setting up the connection. Another way of saying this is that HTTPS was never designed to conceal the identity of the sites that you visit.

-

Researchers have also shown that it may be possible for someone to figure out more about what you're doing on a site merely through careful observation of the amount of data you upload and download, or the timing patterns of your use of the site. A simple example is that if the site only has one page of a certain total size, anyone downloading exactly that much data from the site is probably accessing that page.

-

If you want to protect yourself against monitoring of the sites you visit, consider using HTTPS Everywhere together with software like Tor.

-

-

Q. How do I get support for an additional site in HTTPS Everywhere?

-

A. You can learn how to write rules that teach HTTPS Everywhere to support new sites. You can install these rules in your own browser or send them to us for possible inclusion in the official version.

-

-

Q. What if the site doesn't support HTTPS, or only supports it for some activities, like entering credit card information?

-

A. You could try to contact the site and point out that using HTTPS for all site features is an increasingly common practice nowadays and protects users (and sites) against a variety of Internet attacks. For instance, it defends against the ability of other people on a wifi network to spy on your use of the site or even take over your account. You can also point out that credit card numbers aren't the only information you consider private or sensitive.

-

Sites like Google, Twitter, and Facebook now support HTTPS for non-financial information — for general privacy and security reasons.

-

-

Q. Why isn't HTTPS Everywhere available for download from addons.mozilla.org like most other Firefox add-ons?

-

A. We felt that the Mozilla privacy policy that applies to downloads from addons.mozilla.org is somewhat less protective than the privacy policies of the organizations that develop HTTPS Everywhere, and we prefer for HTTPS Everywhere users to be protected by our privacy policy. This decision could change in the future as Mozilla's privacy practices evolve or as we re-examine the details of the current Mozilla policy.

-

-

Q. Isn't it more expensive or slower for a site to support HTTPS compared to regular HTTP?

-

A. It can be, but some sites have been pleasantly surprised to see how practical it can be. Also, experts at Google are currently implementing several enhancements to the TLS protocol that make HTTPS dramatically faster; if these enhancements are added to the standard soon, the speed gap between the two should almost disappear. See Adam Langley's description of the HTTPS deployment situation for more details on these issues. Notably, Langley states: "In order to [enable HTTPS by default for Gmail] we had to deploy no additional machines and no special hardware. On our production frontend machines, SSL/TLS accounts for less than 1% of the CPU load, less than 10KB of memory per connection and less than 2% of network overhead."

-

Although we're quite concerned about the certificate authority system, certificates in the current system are now quite cheap — paid certificates can cost just ten to twenty dollars a year.

-

-

Q. Why should I use HTTPS Everywhere instead of just typing https:// at the beginning of site names?

-

A. Even if you normally type https://, HTTPS Everywhere might protect you if you occasionally forget. Also, it can rewrite other people's links that you follow. For instance, if you click on a link to http://en.wikipedia.org/wiki/EFF_Pioneer_Award, HTTPS Everywhere will automatically rewrite the link to https://secure.wikimedia.org/wikipedia/en/wiki/EFF_Pioneer_Award. Thus, you might get some protection even if you wouldn't have noticed that the target site is available in HTTPS.

-

-

Q. What's the meaning of the broken padlock icon at the bottom of the browser, or the warning that a site contains "insecure information" or "unauthenticated content"?

-

A. If a site is accessed over HTTPS and loads some parts of a page over insecure HTTP, the user might still be vulnerable to some attacks or some kinds of surveillance. For instance, the New York Times makes many HTML pages available in HTTPS, but other resources such as images, CSS, JavaScript, or third party ads and tracking beacons, are only loadable over HTTP. That means that these resources are sent unencrypted, and someone spying on you could probably infer the article you were reading.

-

There are also potential vulnerabilities when parts of a page are loaded over HTTP because an attacker might replace them with versions containing false information, or Javascript code that helps the attacker spy on the user or take over an account.

-

Currently, HTTPS Everywhere for Firefox does not try to forbid access to pages with mixed secure and insecure content, since the user would have been at least vulnerable to these risks already (although Chrome version 18+ has some built-in protections against insecure scripts in pages, and HTTPS Everywhere for Chrome will in fact trigger these on a site like the New York Times). If you encounter a page that contains mixed secure and insecure content, you can contact the responsible site and ask them to address this risk.

-

We hope to provide a clearer solution for users who are especially concerned about the security risks from mixed-content pages, but the best general solution is to contact the operators of web sites that generate a mixed-content warning and ask them to fix their sites by making all the required resources available in HTTPS. Update: in recent versions of Firefox, Mozilla has removed the broken padlock indicator. Now, the only difference between a secure and insecure HTTPS deployment is the blue or green tint on the left of the address bar for secure deployments

-

-

Q. Why does HTTPS Everywhere include rules for sites like PayPal that already require HTTPS on all their pages?

-

A. HTTPS Everywhere, like the HSTS protocol, tries to address an attack called SSL stripping. Users are only protected against the SSL stripping attack if their browsers don't even try to connect to the HTTP version of the site — even if the site would have redirected them to the HTTPS version. With HTTPS Everywhere, the browser won't even attempt the insecure HTTP connection, even if that's what you ask it to do. (Note that HTTPS Everywhere currently does not include a comprehensive list of such sites, which are mainly financial institutions.)

-

-

Q. What do the different colors for rulesets in the toolbar menu mean?

-

A. See this email for an explanation.

- - diff --git a/faq.md b/faq.md new file mode 100644 index 0000000..39dc275 --- /dev/null +++ b/faq.md @@ -0,0 +1,273 @@ +HTTPS Everywhere FAQ | Electronic Frontier Foundation + +This page answers frequently-asked questions about EFF's [HTTPS +Everywhere](/https-everywhere) project. If your question isn't answered +below, you can try the resources [listed +here](/https-everywhere/development). + +## Q. What if HTTPS Everywhere breaks some site that I use? + +A. This is occasionally possible because of inconsistent support for +HTTPS on sites (e.g., when a site seems to support HTTPS access but +makes a few, unpredictable, parts of the site unavailable in HTTPS). If +you [report the problem to us](/https-everywhere/development), we can +try to fix it. In the meantime, you can disable the rule affecting that +particular site in your own copy of HTTPS Everywhere by clicking on the +HTTPS Everywhere toolbar button +(![](/sites/default/files/images_insert/https-everywhere-24.png)) and +unchecking the rule for that site. + +You can also report the problem to the site, since they have the power +to fix it! + +## Q. Why is HTTPS Everywhere preventing me from joining this hotel/school/other wireless network? + +A. Some wireless networks hijack your HTTP connections when you first +join them, in order to demand authentication or simply to try to make +you agree to terms of use. HTTPS pages are protected against this type +of hijacking, which is as it should be. If you go to a website that +isn't protected by HTTPS Everywhere (currently, yahoo.com is one such +site) that will allow your browser to be +hijacked. + +## Q. Will there be a version of HTTPS Everywhere for IE, Safari, Opera, or some other browser? + +A. Some members of our developer community are working on an IE port of +HTTPS Everywhere. As of early 2012, the Safari extension API does not +offer a way to perform secure rewriting of http requests to https. But +if you happen to know a way to perform secure request rewriting in these +browsers, feel free to let us know at https-everywhere at EFF.org (but +note that modifying document.location or window.location in JavaScript +is not +secure). + +## Q. Why use a whitelist of sites that support HTTPS? Why can't you try to use HTTPS for every last site, and only fall back to HTTP if it isn't available? + +A. There are several problems with the idea of trying to automatically +detect HTTPS on every site. Firstly, there is no guarantee that sites +are going to give the same response via HTTPS that they give via HTTP. +As of 2010, LiveJournal is a good example of this problem: compare these +[HTTP](http://www.livejournal.com) and +[HTTPS](https://www.livejournal.com) responses. Secondly, we don't think +it's possible to test for HTTPS in real time without introducing +security vulnerabilities (What should the extension do if the HTTPS +connection attempt fails? Falling back to insecure HTTP isn't safe). +Lastly, in some cases, HTTPS Everywhere has to perform quite complicated +transformations on URIs — for example until recently the Wikipedia rule +had to turn an address like +http://en.wikipedia.org/wiki/World\_Wide\_Web into one like +https://secure.wikimedia.org/wikipedia/en/wiki/World\_Wide\_Web because +HTTPS was not available on Wikipedia's usual +domains. + +## Q. How do I get rid of/move the HTTPS Everywhere button in the toolbar? + +The HTTPS Everywhere button is useful because it allows you to see, and +disable, a ruleset if it happens to be causing problems with a site. But +if you'd rather disable it, go to View-\>Toolbars-\>Customize, and drag +the button out of the toolbar into the Addons bar at the bottom of the +page. Then you can hide the Addons bar. (In theory you should be able to +drag it into the tray of available icons too, but that may trigger [this +bug](https://trac.torproject.org/projects/tor/ticket/6276). + +## Q. Why does HTTPS Everywhere use encrypted.google.com? It looks different... + +A. The HTTPS version of Google at encrypted.google.com looks different, +and sometimes omits links and buttons, that are on the www.google.com +domain. In the past, HTTPS Everywhere had to use encrypted.google.com +because that was the only way to perform searches over https. It is now +possible to use https://www.google.com, but we continue to use the +encrypted.google.com subdomain by default, because it provides [slightly +better security +properties](//www.eff.org/deeplinks/2011/10/google-encrypts-more-searches). +However, you can use www.google.com instead by enabling the "Search +www.google.com" ruleset in the HTTPS Everywhere +preferences. + +## Q. When does HTTPS Everywhere protect me? When does it not protect me? + +A. HTTPS Everywhere protects you only when you are using *encrypted +portions of supported web sites*. On a supported site, it will +automatically activate HTTPS encryption for all known supported parts of +the site (for some sites, this might be only a portion of the entire +site). For example, if your web mail provider does not support HTTPS at +all, HTTPS Everywhere can't make your access to your web mail secure. +Similarly, if a site (like the New York Times website) allows HTTPS for +text but not images, someone might be able to see which images your +browser loads and guess what you're accessing. + +HTTPS Everywhere depends entirely on the security features of the +individual web sites that you use; it *activates* those security +features, but it can't *create* them if they don't already exist. If you +use a site not supported by HTTPS Everywhere or a site that provides +some information in an insecure way, HTTPS Everywhere can't provide +additional protection for your use of that site. Please remember to +check that a particular site's security is working to the level you +expect before sending or receiving confidential information, including +passwords. + +One way to determine what level of protection you're getting when using +a particular site is to use a packet-sniffing tool like +[Wireshark](http://www.wireshark.org/) to record your own communications +with the site. The resulting view of your communications is about the +same as what an eavesdropper on your wifi network or at your ISP would +see. This way, you can determine whether some or all of your +communications would be protected; however, it may be quite +time-consuming to make sense of the Wireshark output with enough care to +get a definitive answer. + +## Q. What does HTTPS Everywhere protect me against? + +A. On supported parts of supported sites, HTTPS Everywhere enables the +sites' HTTPS protection which can protect you against eavesdropping and +tampering with the contents of the site or with the information you send +to the site. Ideally, this provides some protection against an attacker +learning the content of the information flowing in each direction — for +instance, the text of e-mail messages you send or receive through a +webmail site, the products you browse or purchase on an e-commerce site, +or the particular articles you read on a reference site. + +However, HTTPS Everywhere **does not conceal the identities of the sites +you access**, the amount of time you spend using them, or the amount of +information you upload or download from a particular site. For example, +if you access http://www.eff.org/issues/nsa-spying and HTTPS Everywhere +rewrites it to https://www.eff.org/issues/nsa-spying, an eavesdropper +can still trivially recognize that you are accessing www.eff.org (but +might not know which issue you are reading about). In general, the +entire hostname part of the URL remains exposed to the eavesdropper +because this must be sent repeatedly in unencrypted form while setting +up the connection. Another way of saying this is that HTTPS was never +designed to conceal the identity of the sites that you visit. + +Researchers have also shown that it may be possible for someone to +figure out more about what you're doing on a site merely through careful +observation of the amount of data you upload and download, or the timing +patterns of your use of the site. A simple example is that if the site +only has one page of a certain total size, anyone downloading exactly +that much data from the site is probably accessing that page. + +[]()If you want to protect yourself against monitoring of the sites you +visit, consider using HTTPS Everywhere together with software like +[Tor](https://www.torproject.org/). + +## Q. How do I get support for an additional site in HTTPS Everywhere? + +A. You can learn [how to write +rules](https://www.eff.org/https-everywhere/rulesets) that teach HTTPS +Everywhere to support new sites. You can install these rules in your own +browser or send them to us for possible inclusion in the official +version. + +## Q. What if the site doesn't support HTTPS, or only supports it for some activities, like entering credit card information? + +A. You could try to contact the site and point out that using HTTPS for +all site features is an increasingly common practice nowadays and +protects users (and sites) against a variety of Internet attacks. For +instance, it defends against the ability of other people on a wifi +network to spy on your use of the site or even take over your account. +You can also point out that credit card numbers aren't the only +information you consider private or sensitive. + +Sites like Google, Twitter, and Facebook now support HTTPS for +non-financial information — for general privacy and security +reasons. + +## Q. Why isn't HTTPS Everywhere available for download from [addons.mozilla.org](https://addons.mozilla.org/) like most other Firefox add-ons? + +A. We felt that the [Mozilla privacy +policy](https://www.mozilla.com/en-US/privacy-policy.html) that applies +to downloads from addons.mozilla.org is somewhat less protective than +the privacy policies of the organizations that develop HTTPS Everywhere, +and we prefer for HTTPS Everywhere users to be protected by our privacy +policy. This decision could change in the future as Mozilla's privacy +practices evolve or as we re-examine the details of the current Mozilla +policy. + +## Q. Isn't it more expensive or slower for a site to support HTTPS compared to regular HTTP? + +A. It can be, but some sites have been pleasantly surprised to see how +practical it can be. Also, experts at Google are currently implementing +several enhancements to the TLS protocol that make HTTPS dramatically +faster; if these enhancements are added to the standard soon, the speed +gap between the two should almost disappear. See [Adam Langley's +description of the HTTPS deployment +situation](http://www.imperialviolet.org/2010/06/25/overclocking-ssl.html) +for more details on these issues. Notably, Langley states: "In order to +\[enable HTTPS by default for Gmail\] we had to deploy no additional +machines and no special hardware. On our production frontend machines, +SSL/TLS accounts for less than 1% of the CPU load, less than 10KB of +memory per connection and less than 2% of network overhead." + +Although we're quite concerned about the certificate authority system, +certificates in the current system are now quite cheap — paid +certificates can cost just ten to twenty dollars a +year. + +## Q. Why should I use HTTPS Everywhere instead of just typing https:// at the beginning of site names? + +A. Even if you normally type https://, HTTPS Everywhere might protect +you if you occasionally forget. Also, it can rewrite other people's +links that you follow. For instance, if you click on a link to +, HTTPS Everywhere will +automatically rewrite the link to +. +Thus, you might get some protection even if you wouldn't have noticed +that the target site is available in +HTTPS. + +## Q. What's the meaning of the broken padlock icon at the bottom of the browser, or the warning that a site contains "insecure information" or "unauthenticated content"? + +A. If a site is accessed over HTTPS and loads some parts of a page over +insecure HTTP, the user might still be vulnerable to some attacks or +some kinds of surveillance. For instance, the New York Times makes many +HTML pages available in HTTPS, but other resources such as images, CSS, +JavaScript, or third party ads and tracking beacons, are only loadable +over HTTP. That means that these resources are sent unencrypted, and +someone spying on you could probably infer the article you were reading. + +There are also potential vulnerabilities when parts of a page are loaded +over HTTP because an attacker might replace them with versions +containing false information, or Javascript code that helps the attacker +spy on the user or take over an account. + +Currently, HTTPS Everywhere for Firefox does not try to forbid access to +pages with mixed secure and insecure content, since the user would have +been at least vulnerable to these risks already (although Chrome version +18+ has some built-in protections against insecure scripts in pages, and +HTTPS Everywhere for Chrome will in fact trigger these on a site like +the New York Times). If you encounter a page that contains mixed secure +and insecure content, you can contact the responsible site and ask them +to address this risk. + +We hope to provide a clearer solution for users who are especially +concerned about the security risks from mixed-content pages, but the +best general solution is to contact the operators of web sites that +generate a mixed-content warning and ask them to fix their sites by +making all the required resources available in HTTPS. **Update: in +recent versions of Firefox, Mozilla has removed the broken padlock +indicator. Now, the only difference between a secure and insecure HTTPS +deployment is the blue or green tint on the left of the address bar for +secure +deployments** + +## Q. Why does HTTPS Everywhere include rules for sites like PayPal that already require HTTPS on all their pages? + +A. HTTPS Everywhere, like the [HSTS +protocol](http://www.w3.org/Security/wiki/Strict_Transport_Security), +tries to address an attack called [SSL +stripping](http://www.thoughtcrime.org/software/sslstrip/). Users are +only protected against the SSL stripping attack if their browsers don't +even *try* to connect to the HTTP version of the site — even if the site +would have redirected them to the HTTPS version. With HTTPS Everywhere, +the browser won't even attempt the insecure HTTP connection, even if +that's what you ask it to do. (Note that HTTPS Everywhere currently does +not include a comprehensive list of such sites, which are mainly +financial +institutions.) + +## Q. What do the different colors for rulesets in the toolbar menu mean? + +A. See [this +email](https://lists.eff.org/pipermail/https-everywhere/2012-April/001368.html) +for an explanation. + diff --git a/rulesets.html b/rulesets.html deleted file mode 100644 index ce81840..0000000 --- a/rulesets.html +++ /dev/null @@ -1,70 +0,0 @@ - - -HTTPS Everywhere Rulesets - -

This page describes how to write rulesets for HTTPS Everywhere, the Firefox plugin that switches sites over from http to https automatically. HTTPS Everywhere comes with thousands of rulesets, but you might want to edit them, or write new ones.

-

[We believe this information is correct as of version 3.0 of HTTPS Everywhere.]

-

Rulesets are simple xml files. Here is a simplified version of Twitter.xml, from the plugin distribution:

-
<ruleset name="Twitter">
-  <target host="www.twitter.com" />
-  <target host="twitter.com" />
-
-  <rule from="^http://(www\.)?twitter\.com/" to="https://twitter.com/"/>
-</ruleset>

-The "target" tag specifies which domains the ruleset might apply to. The target host tag does not use regular expressions. The content of a target tag should be the actual name of a web server to which the ruleset applies or partially applies, like www.eff.org, www.google.com, secure.wikimedia.org, and so on. If your rule applies to the domain itself (like "eff.org", not just "www.eff.org"), you need an additional target tag to say so. For example, the sample ruleset above is meant to apply to either www.twitter.com or twitter.com, so it has a separate target tag for each.

-

A target may, however, contain a wildcard in one portion of the domain (like *.google.com or google.*, but *.google.* would not work). A wildcard on the left will match arbitrarily deep subdomains (for instance, *.facebook.com will match s-static.ak.facebook.com).1

-

The "rule" does the actual rewriting work. The "from" and "to" clauses in each rule are JavaScript regular expressions. You can use them to rewrite URLs in more complicated ways. Here's a simplified (and now obsolete) example for Wikipedia:

-
<ruleset name="Wikipedia">
-  <target host="*.wikipedia.org" />
-
-  <rule from="^http://([^@:/][^/:@])\.wikipedia\.org/wiki/"
-          to="https://secure.wikimedia.org/wikipedia/$1/wiki/"/>
-</ruleset>

-That rewrites a URL like http://fr.wikipedia.org/wiki/Chose to https://secure.wikimedia.org/wikipedia/fr/wiki/Chose. Notice, again, that the target is allowed to contain (just one) * as a wildcard meaning "any".

-

It is possible to add exclusions. An exclusion specifies a pattern, using a regular expression, for URLs where the rule should not be applied. The EFF rule contains one exclusion, for a domain that is hosted externally and does not support HTTPS:

-
<ruleset name="EFF">
-  <target host="eff.org" />
-  <target host="*.eff.org" />
-
-  <exclusion pattern="^http://action\.eff\.org/"/>
-  <rule from="^http://eff\.org/" to="https://eff.org/"/>
-  <rule from="^http://([^/:@]*)\.eff\.org/" to="https://$1.eff.org/"/>
-</ruleset>

-Note that if your rules include ampersands (&), they need to be appropriately XML-encoded: replace each occurence of & with &#x26;.

-

Lastly, because many HTTPS websites fail to correctly set the secure flag on authentication cookies, there is a facility for turning this flag on. For instance:

-
<securecookie host="^market\.android\.com$" name=".*" />

-The "host" parameter is a regexp specifying which domains should have their cookies secured; the "name" parameter is a regexp specifying which cookies should be secured. Note that HTTPS Everywhere will only secure a cookie when it is set over HTTPS.

-

Once you've written a ruleset, you can use and test it by placing it in the HTTPSEverywhereUserRules/ subdirectory in your Firefox profile directory, and then restarting Firefox. While using the rule, check for messages in the Firefox Error Console to see if there are any issues with the way the site supports HTTPS. Note that it is inadvisable to edit the builtin rules in-place, since they will be overwritten by upgrades to the extension. Either keep your edits in a safe place, or use a git repository.

-

If you've tested your rule and are sure it would be of use to the world at large, send it to the rulesets mailing list at https-everywhere-rules AT eff.org. Please be aware that this is a public and publicly-archived mailing list. NOTE: many rules that are not yet distributed in the official version of HTTPS Everywhere are already in our git repository! Before sending us a new rule, please check there to see if your rule has already been submitted by someone else.

-

Note that there are currently hundreds of pending rules which are not present in the latest stable version but which are included in development builds. If a version of the rule you're interested in is found in the relevant part of our git repository, you don't need to write a new one -- just switch to the the development branch or build your own .xpi from git.

-

make-trivial-rule and trivial-validate.py

-

As an alternative to writing rules by hand, there are scripts you can run from a Unix command line to automate the process of creating a simple rule for a specified domain. These scripts are not included with HTTPS Everywhere releases but are available in our development repository and are described in our development documentation.

-

-

Disabling a ruleset by default

-

Sometimes rulesets are useful or interesting, but contain some bugs or issues that make them unsuitable for being enabled by default in everyone's browsers. For instance, the HTTPS website may use a Certificate Authority that is not trusted by everyone's browsers (most commonly, CAcert or a self-signed certificate). Or the ruleset may successfully secure parts of a site but interfere with others.

-

In such cases, rulesets should be disabled by default. This is done by adding a default_off attribute to the ruleset element, with a value explaining why the rule is off.

-
<ruleset name="Amazon (buggy)" default_off="currently somewhat broken">
-   <target host="www.amazon.*" />
-   <target host="amazon.*" />

-By convention, you should add a parenthetical to the name of the ruleset — like (buggy) while it is off. If you reenable a ruleset, you should remove the parenthetical. This convention is important: it exists so that the change to the default overrides existing users' settings for whether the ruleset is on or off.

-

-

Disabling a ruleset on some platforms

-

Sometimes bugs on a platform may mean that a ruleset should be off by default on that platform only. For instance, this bug caused us to temporarily disable the Google Translate rules on Chromium and Chrome. This can be achieved with the "platform" attribute:

-
<ruleset name="Google Translate" platform="firefox">
-<target host="translate.googleapis.com"/>
-<target host="translate.google.com"/>
-<rule from="^http://translate\.googleapis\.com/"
-        to="https://translate.googleapis.com/"/>
-<rule from="^http://translate\.google\.com/translate_a/element\.js"
-        to="https://translate.google.com/translate_a/element.js"/>
-</ruleset>

-Platform is a space-delimited list of platforms on which the ruleset works. Currently anticipated values are "firefox", "chromium", "mixedcontent", "cacert" and "ipsca". The "mixedcontent" value is important, and should be used for sites that render badly in Chrome because that browser blocks HTTP content from loading in HTTPS pages by default. If the platform attribute is present, but does not match the current platform, the ruleset will be treated as off-by-default.

-

Update (12/12/13): Firefox 23+ has enabled mixed content blocking by default. As a result, many rules that were previously labeled "firefox" should now be labeled "mixedcontent."

-

-

HTTPS->HTTP downgrade rules

-

By default, HTTPS Everywhere will refuse to allow rules that would downgrade a URL from HTTPS to HTTP. Occasionally, this has turned out to be necessary because when HTTPS Everywhere is active some sites write broken relative links to HTTPS resources on their own domains that are not actually available over HTTPS. If you want to have a <rule> like that (here's an example), it will need a downgrade="1" attribute to make sure you really meant it, and to facilitate auditing of the ruleset library.

- -
  • 1. Exception: currently this is not true for a target host that is less than three levels deep. <target host="*.com"> would match thing.com but not very.thing.com. We would consider changing that if anybody needs to use it. <target host="*"> means a ruleset should be tested for every single URL.
- - diff --git a/rulesets.md b/rulesets.md new file mode 100644 index 0000000..967acf1 --- /dev/null +++ b/rulesets.md @@ -0,0 +1,197 @@ +HTTPS Everywhere Rulesets + +This page describes how to write rulesets for [HTTPS +Everywhere](https://eff.org/https-everywhere), the Firefox plugin that +switches sites over from http to https automatically. HTTPS Everywhere +comes with +[thousands](https://gitweb.torproject.org/https-everywhere.git/tree/HEAD:/src/chrome/content/rules) +of rulesets, but you might want to edit them, or write new ones. + +*\[We believe this information is correct as of version 3.0 of HTTPS +Everywhere.\]* + +Rulesets are simple xml files. Here is a simplified version of +[Twitter.xml](https://gitweb.torproject.org/https-everywhere.git/blob/HEAD:/src/chrome/content/rules/Twitter.xml), +from the plugin distribution: + + + + + + + + +The "target" tag specifies which domains the ruleset might apply to. The +target host tag does not use regular expressions. The content of a +target tag should be the actual name of a web server to which the +ruleset applies or partially applies, like www.eff.org, www.google.com, +secure.wikimedia.org, and so on. If your rule applies to the domain +itself (like "eff.org", not just "www.eff.org"), you need an additional +target tag to say so. For example, the sample ruleset above is meant to +apply to either www.twitter.com or twitter.com, so it has a separate +target tag for each. + +A target may, however, contain a wildcard in one portion of the domain +(like \*.google.com or google.\*, but \*.google.\* would not work). A +wildcard on the left will match arbitrarily deep subdomains (for +instance, \*.facebook.com will match +s-static.ak.facebook.com).[1](#footnote1_fxaiuyg "Exception: currently this is not true for a target host that is less than three levels deep. \ would match thing.com but not very.thing.com. We would consider changing that if anybody needs to use it. \ means a ruleset should be tested for every single URL.") + +The "rule" does the actual rewriting work. The "from" and "to" clauses +in each rule are [JavaScript regular +expressions](http://www.regular-expressions.info/javascript.html). You +can use them to rewrite URLs in more complicated ways. Here's a +simplified (and now obsolete) example for Wikipedia: + + + + + + + +That rewrites a URL like http://fr.wikipedia.org/wiki/Chose to +https://secure.wikimedia.org/wikipedia/fr/wiki/Chose. Notice, again, +that the target is allowed to contain (just one) \* as a wildcard +meaning "any". + +It is possible to add exclusions. An exclusion specifies a pattern, +using a regular expression, for URLs where the rule should **not** be +applied. The EFF rule contains one exclusion, for a domain that is +hosted externally and does not support HTTPS: + + + + + + + + + + +Note that if your rules include ampersands (&), they need to be +appropriately XML-encoded: replace each occurence of **&** with +**&\#x26;**. + +Lastly, because many HTTPS websites fail to correctly set the [secure +flag](https://secure.wikimedia.org/wikipedia/en/wiki/HTTP_cookie#Secure_and_HttpOnly) +on authentication cookies, there is a facility for turning this flag on. +For instance: + + + +The "host" parameter is a regexp specifying which domains should have +their cookies secured; the "name" parameter is a regexp specifying which +cookies should be secured. Note that HTTPS Everywhere will only secure a +cookie when it is set over HTTPS. + +Once you've written a ruleset, you can use and test it by placing it in +the HTTPSEverywhereUserRules/ subdirectory in [your Firefox profile +directory](http://kb.mozillazine.org/Profile_folder_-_Firefox), and then +restarting Firefox. While using the rule, check for messages in the +Firefox Error Console to see if there are any issues with the way the +site supports HTTPS. Note that it is inadvisable to edit the builtin +rules in-place, since they will be overwritten by upgrades to the +extension. Either keep your edits in a safe place, or use a [git +repository](/https-everywhere/development). + +If you've tested your rule and are sure it would be of use to the world +at large, send it to the rulesets mailing list at https-everywhere-rules +AT eff.org. Please be aware that this is a public and publicly-archived +mailing list. **NOTE**: many rules that are not yet distributed in the +official version of HTTPS Everywhere are already in our git repository\! +Before sending us a new rule, please [check +there](https://gitweb.torproject.org/https-everywhere.git/tree/HEAD:/src/chrome/content/rules) +to see if your rule has already been submitted by someone else. + +Note that there are currently hundreds of pending rules which are not +present in the latest stable version but which are included in +development builds. If a version of the rule you're interested in is +found in [the relevant part of our git +repository](https://gitweb.torproject.org/https-everywhere.git/tree/HEAD:/src/chrome/content/rules), +you don't need to write a new one -- just switch to the the [development +branch](https://www.eff.org/files/https-everywhere-devel.xpi) or build +your own .xpi from git. + +## make-trivial-rule and trivial-validate.py + +As an alternative to writing rules by hand, there are scripts you can +run from a Unix command line to automate the process of creating a +simple rule for a specified domain. These scripts are not included with +HTTPS Everywhere releases but are available in our development +repository and are described in [our development +documentation](development). + +## Disabling a ruleset by default + +Sometimes rulesets are useful or interesting, but contain some bugs or +issues that make them unsuitable for being enabled by default in +everyone's browsers. For instance, the HTTPS website may use a +Certificate Authority that is not trusted by everyone's browsers (most +commonly, [CAcert](http://www.cacert.org/) or a self-signed +certificate). Or the ruleset may successfully secure parts of a site but +interfere with others. + +In such cases, rulesets should be disabled by default. This is done by +adding a default\_off attribute to the ruleset element, with a value +explaining why the rule is + off. + + + + + +By convention, you should add a parenthetical to the name of the ruleset +— like (buggy) while it is off. If you reenable a ruleset, you should +remove the parenthetical. *This convention is important: it exists so +that the change to the default overrides existing users' settings for +whether the ruleset is on or off.* + +### Disabling a ruleset on some platforms + +Sometimes bugs on a platform may mean that a ruleset should be off by +default on that platform only. For instance, [this +bug](https://trac.torproject.org/projects/tor/ticket/5196) caused us to +temporarily disable the Google Translate rules on Chromium and Chrome. +This can be achieved with the "platform" attribute: + + + + + + + + +Platform is a space-delimited list of platforms on which the ruleset +works. Currently anticipated values are "firefox", "chromium", +"mixedcontent", "cacert" and "ipsca". The "mixedcontent" value is +important, and should be used for sites that render badly in Chrome +because that browser [blocks HTTP content from loading in HTTPS +pages](https://trac.torproject.org/projects/tor/ticket/6975) by default. +If the platform attribute is present, but does not match the current +platform, the ruleset will be treated as off-by-default. + +**Update (12/12/13)**: Firefox 23+ has enabled mixed content blocking by +default. As a result, many rules that were previously labeled "firefox" +should now be labeled "mixedcontent." + +### HTTPS-\>HTTP downgrade rules + +By default, HTTPS Everywhere will refuse to allow rules that would +downgrade a URL from HTTPS to HTTP. Occasionally, this has turned out to +be necessary because when HTTPS Everywhere is active some sites write +broken relative links to HTTPS resources on their own domains that are +not actually available over HTTPS. If you want to have a \ like +that ([here's an +example](https://gitweb.torproject.org/pde/https-everywhere.git/blob/4.0:/src/chrome/content/rules/BBC.xml)), +it will need a downgrade="1" attribute to make sure you really meant it, +and to facilitate auditing of the ruleset library. + + - [1.](#footnoteref1_fxaiuyg) Exception: currently this is not true + for a target host that is less than three levels deep. \ would match thing.com but not very.thing.com. We + would consider changing that if anybody needs to use it. \ means a ruleset should be tested for every single URL. +