Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

README: refactor addons section; other fixes; fix GEOLOCATION/QUIET FOX sections of #208 #255

Merged
merged 20 commits into from
Apr 3, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
47bbbe5
improve comment-out referer spoofing prefs, closes #193
nodiscc Mar 25, 2017
cdf0bf5
simplify privacy.resistfingerprinting references:
nodiscc Mar 25, 2017
311c51d
README: improve FAQ about deprecated preferences, closes #33 #251
nodiscc Mar 25, 2017
97b3166
README: refactor addons section:
nodiscc Mar 25, 2017
c850e47
README: add-ons: add extra blocklists recommendation, shorten addon-s…
nodiscc Mar 25, 2017
70185dc
add intl.locale.matchOS and general.useragent.locale, fixes items 020…
nodiscc Mar 26, 2017
2e32077
add browser.search.geoSpecificDefaults* prefs, fixes item 0206 of #208
nodiscc Mar 26, 2017
1eb9ec9
Prevent leaking application locale/date format using JavaScript, fixe…
nodiscc Mar 26, 2017
a83b828
opt-out of themes (persona) updates, fixes item 0307 of #208
nodiscc Mar 26, 2017
33e9469
disable flash player crash reports, don't send URLs in crash reports …
nodiscc Mar 26, 2017
d70077a
Disallow Necko to do A/B testing, fixes itme 0341 of #208,
nodiscc Mar 26, 2017
c4db308
Disable sending Firefox crash reports to Mozilla servers, fixes item …
nodiscc Mar 26, 2017
6562602
Disable sending reports of tab crashes to Mozilla (about:tabcrashed),…
nodiscc Mar 26, 2017
30c0965
disable flyweb, fixes item 0376 of #208
nodiscc Mar 26, 2017
cef186b
disable Firefox SYnc, fixes item 0380 of #208
nodiscc Mar 26, 2017
e92362c
run make - generate README 'What does it do' section from user.js com…
nodiscc Mar 26, 2017
093bd97
README: credit ghacks-user.js in documentation section
nodiscc Mar 26, 2017
c0962da
doc: update README/user.js:
nodiscc Mar 27, 2017
24a5cfe
run make - update what does it do section
nodiscc Mar 27, 2017
c37bf58
Makefile: add tests and authors targets
nodiscc Mar 28, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ before_script:
script:
- acorn user.js
- bash -n cas.sh
- make tests
notifications:
irc:
channels:
Expand Down
16 changes: 16 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pyllyukko <[email protected]>
nodiscc <[email protected]>
CHEF-KOCH <[email protected]>
Francois Marier <[email protected]>
CHEF-KOCH <[email protected]>
Francois Marier <[email protected]>
Alex Hirsch <[email protected]>
DrunkenSasquatch <[email protected]>
Frank LENORMAND <[email protected]>
Sebastian Schmidt <[email protected]>
Steffen Gransow <[email protected]>
devmapper0 <[email protected]>
Mehmet Atif Ergun <[email protected]>
mengele-chan <[email protected]>
uberspot <[email protected]>
zummuz <[email protected]>
Copy link
Owner

Choose a reason for hiding this comment

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

This is not needed. All the info is available as metadata.

54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,56 @@
all: whatdoesitdo tests authors

whatdoesitdo:
@# generate the README "What does it do?" section
@./gen-readme.sh

# To decrease tests verbosity, comment out unneeded targets
tests: downloadffprefs checknotcovered checkdeprecated stats cleanup
Copy link
Owner

Choose a reason for hiding this comment

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

This will fail horribly if you have e.g. MAKEFLAGS="-j 4", like I do.

I'm not entirely sure what is the proper way to fix it, as I'm not that familiar with makefiles. Maybe with .NOTPARALLEL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes apparently a target named .NOTPARALLEL should inhibit the -j cli/config file option

Copy link
Owner

Choose a reason for hiding this comment

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

Cool, that's what I thought. I'm still not sure as to where and how to add it.

e.g., should it be like:

.NOTPARALLEL: downloadffprefs

Or just as it's own line? It wasn't completely clear to me.

Copy link
Contributor Author

@nodiscc nodiscc Apr 3, 2017

Choose a reason for hiding this comment

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

I forgot to post the link I found: http://stackoverflow.com/questions/4346399/how-can-i-force-gnu-make-to-not-build-recipe-in-parallel/23903293#23903293

.PHONY: all clean

.NOTPARALLEL:

anotherTarget: dependency1

Apparently on it's own line. The MAKEFLAGS variable can also be used (solution 3)

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah I saw that post also when I was looking at the subject. Is it so, that everything below that will not run as parallel or what? I mean there are still some things, that can be run as parallel in the makefile, e.g. authors, whatdoesitdo and all the rest for that matter, once downloadffprefs has finished.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it so, that everything below that will not run as parallel or what?

This is what it looks like, but I have no experience with parallel usage of Make - very interesting, I really need to read the full Make manual.

Unfortunately no time to work on it at the moment, would you be ok to apply the global MAKEFLAGS := --jobs=1 var, and open an issue (Makefile: parallelize tests) ? We can improve this later.

Copy link
Owner

Choose a reason for hiding this comment

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

Sounds good.



downloadffprefs:
@# download and sort all known preferences files from Firefox (mozilla-central) source
@# specify wanted Firefox version/revision below (eg. "tip", "FIREFOX_AURORA_45_BASE", "9577ddeaafd85554c2a855f385a87472a089d5c0"). See https://hg.mozilla.org/mozilla-central/tags
@SOURCEVERSION="tip"; \
FIREFOX_SOURCE_PREFS=" \
https://hg.mozilla.org/mozilla-central/raw-file/$$SOURCEVERSION/toolkit/components/telemetry/datareporting-prefs.js \
https://hg.mozilla.org/mozilla-central/raw-file/$$SOURCEVERSION/toolkit/components/telemetry/healthreport-prefs.js \
https://hg.mozilla.org/mozilla-central/raw-file/$$SOURCEVERSION/security/manager/ssl/security-prefs.js \
https://hg.mozilla.org/mozilla-central/raw-file/$$SOURCEVERSION/modules/libpref/init/all.js \
https://hg.mozilla.org/mozilla-central/raw-file/$$SOURCEVERSION/testing/profiles/prefs_general.js \
https://hg.mozilla.org/mozilla-central/raw-file/$$SOURCEVERSION/layout/tools/reftest/reftest-preferences.js \
https://hg.mozilla.org/mozilla-central/raw-file/$$SOURCEVERSION/js/src/tests/user.js"; \
for SOURCEFILE in $$FIREFOX_SOURCE_PREFS; do wget "$$SOURCEFILE" -O - ; done | egrep "(^pref|^user_pref)" | sort --unique >| sourceprefs.js

######################

checknotcovered:
@# check for preferences present in firefox source but not covered by user.js
@# configure ignored preferences in ignore.list
@SOURCE_PREFS=$$(egrep '(^pref|^user_pref)' sourceprefs.js | awk -F'"' '{print $$2}'); \
for SOURCE_PREF in $$SOURCE_PREFS; do \
grep "\"$$SOURCE_PREF\"" user.js ignore.list >/dev/null || echo "Not covered by user.js : $$SOURCE_PREF"; \
done | sort --unique

checkdeprecated:
@# check for preferences in hardened user.js that are no longer present in firefox source
@HARDENED_PREFS=$$(egrep "^user_pref" user.js | cut -d'"' -f2); \
for HARDENED_PREF in $$HARDENED_PREFS; do \
grep "\"$$HARDENED_PREF\"" sourceprefs.js >/dev/null || echo "Deprecated : $$HARDENED_PREF"; \
done | sort --unique

stats:
@# count preferences number, various stats
@echo "$$(egrep "^user_pref" user.js | wc -l | cut -f1) preferences in user.js"
@echo "$$(wc -l sourceprefs.js | cut -d" " -f1) preferences in Firefox source"

cleanup:
@# remove temporary files
@# please comment this out when not needed, to minimize load on Mozilla servers
@rm sourceprefs.js

authors:
@# generate an AUTHORS file, ordered by number of commits
@# TODO: add a .mailmap file to deduplicate authors with multiple email addresses
@# to add extra authors/credits, git commit --allow-empty --author="A U Thor <[email protected]>"
@git shortlog -sne | cut -f1 --complement >| AUTHORS
Copy link
Owner

@pyllyukko pyllyukko Apr 3, 2017

Choose a reason for hiding this comment

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

BTW. would the following .mailmap file be sufficient for this?

Copy link
Contributor Author

@nodiscc nodiscc Apr 4, 2017

Choose a reason for hiding this comment

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

Yes it works with these contents (I just tested it with git shortlog -sne)

Copy link
Owner

Choose a reason for hiding this comment

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

I added it with 563c4c6. Even though I removed the AUTHORS file, but it's still better to get exact stats :)

One thing that is wrong here, is that there are so many people who have contributed through insights in issues & PRs, but haven't pushed any commits.

We would need to have yet-another-script that queries GitHub's API for all the people involved in here to have a complete list :)

Copy link
Contributor Author

@nodiscc nodiscc Apr 4, 2017

Choose a reason for hiding this comment

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

As far as I know there is no way to (directly) list users who posted in a github project issue tracker. But it can be parsed from https://api.github.com/repos/pyllyukko/user.js/issues (login values). If you create a new issue for this, I'll have a look.

Copy link
Owner

Choose a reason for hiding this comment

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

It was a joke, we don't need to do that :)

53 changes: 31 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ make it more secure.

* Limit the possibilities to track the user through [web analytics](https://en.wikipedia.org/wiki/Web_analytics).
* Harden the browser against known data disclosure or code execution vulnerabilities.
* Limit the browser from storing anything even remotely sensitive persistently
* Make sure the browser doesn't reveal too much information to [shoulder surfers](https://en.wikipedia.org/wiki/Shoulder_surfing_%28computer_security%29)
* Harden the browser's encryption (cipher suites, protocols, trusted CAs)
* Hopefully limit the attack surface by disabling various features
* Still be usable in daily use
* Limit the browser from storing anything even remotely sensitive persistently.
* Make sure the browser doesn't reveal too much information to [shoulder surfers](https://en.wikipedia.org/wiki/Shoulder_surfing_%28computer_security%29).
* Harden the browser's encryption (cipher suites, protocols, trusted CAs).
* Limit possibilities to uniquely identify the browser/device using [browser fingerpriting](https://en.wikipedia.org/wiki/Device_fingerprint).
* Hopefully limit the attack surface by disabling various features.
* Still be usable in daily use.

### How to achieve this?

There are several parts to all this and they are:

* [Downloading](#download) and [installing](#installation) the `user.js` file.
* Reading about and applying [further hardening](#further-hardening) techniques.
* _Optional:_ Modifying `user.js` to adapt it to your web browser usage.

----------------------------------------------

Expand Down Expand Up @@ -61,7 +63,22 @@ To enable the Profile Manager, run Firefox with
[command-line arguments](http://kb.mozillazine.org/Command_line_arguments):
`firefox --no-remote -P`

### System-wide installation
### System-wide installation (all platforms)

Copy `user.js` to the Firefox installation directory. The file should be located at:

| OS | Path |
| -------------- | ---------------------------------------------------------- |
| Windows | `C:\Program Files (x86)\Mozilla Firefox\mozilla.cfg` |
| Linux | `/etc/firefox/firefox.js` |
| Linux (Debian) | `/etc/firefox-esr/firefox-esr.js` |
| OS X | `/Applications/Firefox.app/Contents/Resources/mozilla.cfg` |

In `user.js`, Change `user_pref(` to one of:
* `pref(` (the value will be used as default value on Firefox profile creation, it can be changed in `about:config`)
* `lockPref(` (the value will be used as default value on Firefox profile creation, will be locked and can't be changed) in `user.js` or in Firefox's `about:config` or settings.

#### Additional installation steps for Windows/OSX

Create `local-settings.js` in Firefox installation directory, with the following contents:

Expand All @@ -75,23 +92,8 @@ This file should be located at:
| OS | Path |
| ------- | ------------------------------------------------------------ |
| Windows | `C:\Program Files (x86)\Mozilla Firefox\default\pref\` |
| Linux |**This file is not required** |
| OS X | `/Applications/Firefox.app/Contents/Resources/defaults/pref` |


In `user.js`, Change `user_pref(` to one of:
* `pref(` (the value will be used as default value on Firefox profile creation, it can be changed in `about:config`)
* `lockPref(` (the value will be used as default value on Firefox profile creation, will be locked and can't be changed) in `user.js` or in Firefox's `about:config` or settings.

Copy `user.js` to the Firefox installation directory. The file should be located at:

| OS | Path |
| -------------- | ---------------------------------------------------------- |
| Windows | `C:\Program Files (x86)\Mozilla Firefox\mozilla.cfg` |
| Linux | `/etc/firefox/firefox.js` |
| Linux (Debian) | `/etc/firefox-esr/firefox-esr.js` |
| OS X | `/Applications/Firefox.app/Contents/Resources/mozilla.cfg` |

### Updating using git

For any of the above methods, you can keep your browser's `user.js` with the latest version available here: Clone the repository, and create a symbolic link from the appropriate location to the `user.js` file in the repository. Just run `git pull` in the repository when you want to update, then restart Firefox:
Expand Down Expand Up @@ -135,7 +137,7 @@ HTML5 / [APIs](https://wiki.mozilla.org/WebAPI) / [DOM](https://en.wikipedia.org
* Disable WebRTC entirely to prevent leaking internal IP addresses (Firefox < 42)
* Don't reveal your internal IP when WebRTC is enabled (Firefox >= 42) [ [1](https://wiki.mozilla.org/Media/WebRTC/Privacy) [2](https://github.com/beefproject/beef/wiki/Module%3A-Get-Internal-IP-WebRTC) ]
* Disable WebRTC getUserMedia, screen sharing, audio capture, video capture [ [1](https://wiki.mozilla.org/Media/getUserMedia) [2](https://blog.mozilla.org/futurereleases/2013/01/12/capture-local-camera-and-microphone-streams-with-getusermedia-now-enabled-in-firefox/) [3](https://developer.mozilla.org/en-US/docs/Web/API/Navigator) ]
* Disable battery API (<52) [ [1](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager) [2](https://bugzilla.mozilla.org/show_bug.cgi?id=1313580) ]
* Disable battery API (Firefox < 52) [ [1](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager) [2](https://bugzilla.mozilla.org/show_bug.cgi?id=1313580) ]
* Disable telephony API [ [1](https://wiki.mozilla.org/WebAPI/Security/WebTelephony) ]
* Disable DOM timing API [ [1](https://wiki.mozilla.org/Security/Reviews/Firefox/NavigationTimingAPI) ]
* Disable "beacon" asynchronous HTTP transfers (used for analytics) [ [1](https://developer.mozilla.org/en-US/docs/Web/API/navigator.sendBeacon) ]
Expand Down Expand Up @@ -333,11 +335,15 @@ This section tweaks the cipher suites used by Firefox. The idea is to support on
* By default **your browser trusts 100's of [Certificate Authorities](https://en.wikipedia.org/wiki/Certificate_authority)** (CAs) from various organizations to guarantee privacy of your encrypted communications with websites. Some CAs have been known for misusing or deliberately abusing this power in the past, and **a single malicious CA can compromise all** your encrypted communications! Follow [this document](CAs.md) to only trust a selected, trimmed-down list of CAs.
* Keep your browser updated! If you check [Firefox's security advisories](https://www.mozilla.org/security/known-vulnerabilities/firefox.html), you'll see that pretty much every new version of Firefox contains some security updates. If you don't keep your browser updated, you've already lost the game.
* Disable/uninstall all unnecessary extensions and plugins!
* Use long and **unique** passwords/passphrases for each website/service.
* Prefer open-source, reviewed and audited software and operating systems whenever possible.
* Do not transmit information meant to be private over unencrypted communication channels.
* Use a search engine that doesn't track its users, and set it as default search engine.
* If a plugin is absolutely required, [check for plugin updates](https://www.mozilla.org/en-US/plugincheck/)
* Create different [profiles][15] for different purposes
* Change the Firefox's built-in tracking protection to use the [strict list](https://support.mozilla.org/en-US/kb/tracking-protection-pbm?as=u#w_change-your-block-list)
* Change the timezone for Firefox by using the ```TZ``` environment variable (see [here](https://wiki.archlinux.org/index.php/Firefox_privacy#Change_browser_time_zone)) to reduce it's value in browser fingerprinting
* If you are concerned about more advanced threats, use specialized hardened operating systems and browsers such as [Tails](https://tails.boum.org/) or [Tor Brower Bundle](https://www.torproject.org/projects/torbrowser.html.en)


### Add-ons
Expand Down Expand Up @@ -372,6 +378,7 @@ Hardening your often implies a trade-off with ease-of-use and comes with reduced
<!-- BEGIN PROBLEMS-LIMITATIONS -->
* Disabling ServiceWorkers breaks functionality on some sites (Google Street View...)
* Disabling DOM storage is known to cause`TypeError: localStorage is null` errors
* Disabling WebRTC breaks peer-to-peer file sharing tools (reep.io ...)
* IndexedDB could be used for tracking purposes, but is required for some add-ons to work (notably uBlock), so is left enabled
* Firefox Hello requires setting `media.peerconnection.enabled` and `media.getusermedia.screensharing.enabled` to true, `security.OCSP.require` to false to work.
* Do No Track must be enabled manually
Expand Down Expand Up @@ -401,6 +408,7 @@ In addition see the current [issues](https://github.com/pyllyukko/user.js/issues

No. Please read [Known problems and limitations](#known-problems-and-limitations), the project's
[issue](https://github.com/pyllyukko/user.js/issues) tracker, and report new issues there.
Please open separate issues for each individual problem/question you may have.

> Why are obsolete/deprecated entries included in the user.js file?

Expand Down Expand Up @@ -504,6 +512,7 @@ For more information, see [CONTRIBUTING](https://github.com/pyllyukko/user.js/bl
* [Advices from Mozilla Firefox on privacy and government surveillance](https://www.mozilla.org/en-US/teach/smarton/surveillance/)
* [Polaris - advance privacy technnology for the web](https://wiki.mozilla.org/Polaris)
* [Mozilla Privacy Principles](https://wiki.mozilla.org/Privacy/Principles)
* [List of Firefox "about:" URLs](https://developer.mozilla.org/en-US/Firefox/The_about_protocol)
* [Mozilla preferences for uber-geeks](https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/Mozilla_preferences_for_uber-geeks)
* [Privacy & Security related add-ons](https://addons.mozilla.org/firefox/extensions/privacy-security/) ([RSS](https://addons.mozilla.org/en-US/firefox/extensions/privacy-security/format:rss?sort=featured))

Expand Down
12 changes: 12 additions & 0 deletions ignore.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// List of preferences to ignore during comparison with Firefox upstream prefs
// Preference names must use double quotes

// Don't touch Firefox social API preferences, fully opt-in, WONTFIX
"toolkit.telemetry.unifiedIsOptIn"
"social.whitelist"
"social.toast-notifications.enabled"
"social.shareDirectory"
"social.remote-install.enabled"
"social.directories"
"social.share.activationPanelEnabled"
"social.enabled"
5 changes: 3 additions & 2 deletions user.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ user_pref("dom.mozTCPSocket.enabled", false);
user_pref("dom.netinfo.enabled", false);

// PREF: Disable WebRTC entirely to prevent leaking internal IP addresses (Firefox < 42)
// NOTICE: Disabling WebRTC breaks peer-to-peer file sharing tools (reep.io ...)
user_pref("media.peerconnection.enabled", false);

// PREF: Don't reveal your internal IP when WebRTC is enabled (Firefox >= 42)
Expand All @@ -69,7 +70,7 @@ user_pref("media.navigator.video.enabled", false);
user_pref("media.getusermedia.screensharing.enabled", false);
user_pref("media.getusermedia.audiocapture.enabled", false);

// PREF: Disable battery API (<52)
// PREF: Disable battery API (Firefox < 52)
// https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager
// https://bugzilla.mozilla.org/show_bug.cgi?id=1313580
user_pref("dom.battery.enabled", false);
Expand Down Expand Up @@ -439,7 +440,7 @@ user_pref("browser.newtabpage.directory.source", "data:text/plain,{}");
// https://trac.torproject.org/projects/tor/ticket/19047
user_pref("browser.selfsupport.url", "");

// PREF: Disable Firefox Hello (disabled) (<49)
// PREF: Disable Firefox Hello (disabled) (Firefox < 49)
// https://wiki.mozilla.org/Loop
// https://support.mozilla.org/t5/Chat-and-share/Support-for-Hello-discontinued-in-Firefox-49/ta-p/37946
// NOTICE: Firefox Hello requires setting `media.peerconnection.enabled` and `media.getusermedia.screensharing.enabled` to true, `security.OCSP.require` to false to work.
Expand Down