17 Oct 2010, 00:00

Locking down Firefox

Edit prefs.js file located in Firefox’s profile directory to:

  • Stop Referrers
  • Stop all known communication with Google
  • Disable SafeBrowsing
  • Disable cache. (If you want a few cookies for your favourite sites, set browser.cache.disk.enable to true and then back to false when done).
  • Stop writing to disk and instead only write to memory.

    *Accepts no Third party cookies and will not accept any new ones while browser.cache.disk.enable is false

  • Turn off geolocation.

  • Turn off DNS prefetching

  • Turn off content prefetching

  • Remove all application handlers

  • Remove address bar searching and url making

  • Remove google as default keyword search and disables that search

  • Disable Download manager and form retention.

  • Turn of javascript

Disabling javascript, referers and cookies completely is probably a bad idea (many trusted website can become unusable), one should probably use NoScript, ModifyHeaders or CookieSafe add-ons insteads.

# Mozilla User Preferences

/* Do not edit this file.

*

* If you make changes to this file while the application is running,

* the changes will be overwritten when the application exits.

*

* To make a manual change to preferences, you can visit the URL about:config

* For more information, see http://www.mozilla.org/unix/customizing.html#prefs

*/

user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1287207323);

user_pref("app.update.lastUpdateTime.blocklist-background-update-timer", 1287207586);

user_pref("app.update.lastUpdateTime.microsummary-generator-update-timer", 1287207396);

user_pref("app.update.lastUpdateTime.places-maintenance-timer", 1287206929);

user_pref("app.update.lastUpdateTime.search-engine-update-timer", 1287287126);

user_pref("browser.cache.disk.enable", false);

user_pref("browser.cache.offline.enable", false);

user_pref("browser.contentHandlers.types.0.title", ");

user_pref("browser.contentHandlers.types.0.type", ");

user_pref("browser.contentHandlers.types.0.uri", ");

user_pref("browser.contentHandlers.types.1.title", ");

user_pref("browser.contentHandlers.types.1.type", ");

user_pref("browser.contentHandlers.types.1.uri", ");

user_pref("browser.contentHandlers.types.2.title", ");

user_pref("browser.contentHandlers.types.2.type", ");

user_pref("browser.contentHandlers.types.2.uri", ");

user_pref("browser.contentHandlers.types.3.title", ");

user_pref("browser.contentHandlers.types.3.type", ");

user_pref("browser.contentHandlers.types.3.uri", ");

user_pref("browser.contentHandlers.types.4.title", ");

user_pref("browser.contentHandlers.types.4.type", ");

user_pref("browser.contentHandlers.types.4.uri", ");

user_pref("browser.contentHandlers.types.5.title", ");

user_pref("browser.contentHandlers.types.5.type", ");

user_pref("browser.contentHandlers.types.5.uri", ");

user_pref("browser.download.manager.retention", 0);

user_pref("browser.formfill.enable", false);

user\_pref("browser.history\_expire_days", 0);

user\_pref("browser.history\_expire_days.mirror", 0);

user\_pref("browser.history\_expire\_days\_min", 0);

user\_pref("browser.history\_expire_sites", 0);

user_pref("browser.migration.version", 1);

user_pref("browser.places.importBookmarksHTML", false);

user_pref("browser.places.smartBookmarksVersion", 2);

user_pref("browser.safebrowsing.enabled", false);

user_pref("browser.safebrowsing.malware.enabled", false);

user_pref("browser.safebrowsing.malware.reportURL", ");

user_pref("browser.safebrowsing.provider.0.gethashURL", ");

user_pref("browser.safebrowsing.provider.0.keyURL", ");

user_pref("browser.safebrowsing.provider.0.lookupURL", ");

user_pref("browser.safebrowsing.provider.0.name", ");

user_pref("browser.safebrowsing.provider.0.reportErrorURL", ");

user_pref("browser.safebrowsing.provider.0.reportGenericURL", ");

user_pref("browser.safebrowsing.provider.0.reportMalwareErrorURL", ");

user_pref("browser.safebrowsing.provider.0.reportMalwareURL", ");

user_pref("browser.safebrowsing.provider.0.reportPhishURL", ");

user_pref("browser.safebrowsing.provider.0.reportURL", ");

user_pref("browser.safebrowsing.provider.0.updateURL", ");

user_pref("browser.safebrowsing.warning.infoURL", ");

user_pref("browser.search.defaultenginename", ");

user_pref("browser.search.order.1", ");

user_pref("browser.search.order.2", ");

user_pref("browser.search.suggest.enabled", true);

user\_pref("browser.startup.homepage\_override.mstone", "rv:1.9.2.10");

user_pref("extensions.enabledItems", "langpack-en-GB@firefox-3.6.ubuntu.com:3.6,ubufox@ubuntu.com:0.9rc2,{972ce4c6-7e08-4474-a285-3208198ce6fd}:3.6.10");

user_pref("extensions.lastAppVersion", "3.6.10");

user_pref("gecko.handlerService.defaultHandlersVersion", ");https://addons.mozilla.org/en-US/firefox/addon/967/

user_pref("gecko.handlerService.schemes.irc.0.name", ");

user_pref("gecko.handlerService.schemes.irc.0.uriTemplate", ");

user_pref("gecko.handlerService.schemes.irc.1.name", ");

user_pref("gecko.handlerService.schemes.irc.1.uriTemplate", ");

user_pref("gecko.handlerService.schemes.irc.2.name", ");

user_pref("gecko.handlerService.schemes.irc.2.uriTemplate", ");

user_pref("gecko.handlerService.schemes.irc.3.name", ");

user_pref("gecko.handlerService.schemes.irc.3.uriTemplate", ");

user_pref("gecko.handlerService.schemes.ircs.0.name", ");

user_pref("gecko.handlerService.schemes.ircs.0.uriTemplate", ");

user_pref("gecko.handlerService.schemes.ircs.1.name", ");

user_pref("gecko.handlerService.schemes.ircs.1.uriTemplate", ");

user_pref("gecko.handlerService.schemes.ircs.2.name", ");

user_pref("gecko.handlerService.schemes.ircs.2.uriTemplate", ");

user_pref("gecko.handlerService.schemes.ircs.3.name", ");

user_pref("gecko.handlerService.schemes.ircs.3.uriTemplate", ");

user_pref("gecko.handlerService.schemes.mailto.0.name", ");

user_pref("gecko.handlerService.schemes.mailto.0.uriTemplate", ");

user_pref("gecko.handlerService.schemes.mailto.1.name", ");

user_pref("gecko.handlerService.schemes.mailto.1.uriTemplate", ");

user_pref("gecko.handlerService.schemes.mailto.2.name", ");

user_pref("gecko.handlerService.schemes.mailto.2.uriTemplate", ");

user_pref("gecko.handlerService.schemes.mailto.3.name", ");

user_pref("gecko.handlerService.schemes.mailto.3.uriTemplate", ");

user_pref("gecko.handlerService.schemes.webcal.0.name", ");

user_pref("gecko.handlerService.schemes.webcal.0.uriTemplate", ");

user_pref("gecko.handlerService.schemes.webcal.1.name", ");

user_pref("gecko.handlerService.schemes.webcal.1.uriTemplate", ");

user_pref("gecko.handlerService.schemes.webcal.2.name", ");

user_pref("gecko.handlerService.schemes.webcal.2.uriTemplate", ");

user_pref("gecko.handlerService.schemes.webcal.3.name", ");

user_pref("gecko.handlerService.schemes.webcal.3.uriTemplate", ");

user_pref("general.smoothScroll", true);

user_pref("general.useragent.extra.firefox", "Firefox");

user_pref("general.useragent.vendor", "Windows NT 6.1");

user_pref("general.useragent.vendorComment", ");

user_pref("general.useragent.vendorSub", ");

user_pref("general.warnOnAboutConfig", false);

user_pref("geo.enabled", false);

user_pref("geo.wifi.uri", ");

user_pref("idle.lastDailyNotification", 1287209609);

user_pref("intl.charsetmenu.browser.cache", "UTF-8");

user_pref("javascript.enabled", false);

user_pref("keyword.URL", ");

user_pref("keyword.enabled", false);

user_pref("layout.spellcheckDefault", 2);

user_pref("network.cookie.cookieBehavior", 1);

user_pref("network.cookie.prefsMigrated", true);

user_pref("network.dns.disablePrefetch", true);

user_pref("network.http.sendRefererHeader", 0);

user_pref("network.prefetch-next", false);

user\_pref("places.last\_vacuum", 1287209609);

user_pref("privacy.clearOnShutdown.cache", false);

user_pref("privacy.clearOnShutdown.cookies", false);

user_pref("privacy.clearOnShutdown.sessions", false);

user_pref("privacy.sanitize.didShutdownSanitize", true);

user_pref("privacy.sanitize.migrateFx3Prefs", true);

user_pref("privacy.sanitize.sanitizeOnShutdown", true);

user_pref("urlclassifier.gethashnoise", 0);

user_pref("urlclassifier.gethashtables", ");

user_pref("urlclassifier.updatecachemax", 0);

Sources: Lock Down Firefox & #1227136 – Pastie.