<!--
	Other Facebook rulesets:

		- Facebook_Studio.xml
		- Fb.me.xml
		- Messenger.com.xml
		- PrivateCore.com.xml
		- FacebookCoreWWWi.onion.xml


	CDN buckets:

		- fbcdn-dragon-a.akamaihd.net
		- fbcdn-photos-a.akamaihd.net
		- fbcdn-profile-a.akamaihd.net
		- fbcdn-sphotos-a.akamaihd.net
		- fbcdn-sphotos-[a-h]-a.akamaihd.net
		- fbexternal-a.akamaihd.net
		- fbstatic-a.akamaihd.net
		- s-static.ak.facebook.com.edgekey.net
		- s-static.ak.fbcdn.net.edgekey.net
		- profile.ak.facebook.com.edgesuite.net
		- dragon.ak.fbcdn.net.edgesuite.net
		- external.ak.fbcdn.net.edgesuite.net

		- photos-c.ak.facebook.com.edgesuite.net

			- photos-g.ak.fbcdn.net

		- photos-d.ak.facebook.com.edgesuite.net

			- photos-h.ak.fbcdn.net

		- static.ak.connect.facebook.com.edgesuite.net

	foo.ak.fbcdn.net	<=>	fb(cdn-)?foo-a.akamaihd.net


	Nonfunctional domains:

		facebook.mx                  (all 5 IPs don't answer on port 80)
		investor.fb.com		     (504, valid cert)
		www.v6.facebook.com          (no DNS entry)
		static.connect.ak.fbcdn.net  (no DNS entry)
		sphotos.ak.fbcdn.net         (no DNS entry)
		static.ak.fbcdn.net          (no DNS for redirect s-sbx.facebook.com)
		s-static.ak.fbcdn.net        (no DNS for redirect s-sbx.facebook.com)
		scontent.fbcdn.net           (no DNS entry)

	Problematic domains:

		- facebook.com:

			- external.ak *
			- profile.ak *
			- connect *
			- www.connect	(shows www)
			- l.prod ³

		- dragon.ak.fbcdn.net *
		- photos-[a-h].ak.fbcdn.net	*
		- sphotos-d.ak.fbcdn.net *

	* akamai
	³ Fails to redirect


	Fully covered domains:

		- facebook.com subdomains:

			- (www.)
			- s-static.ak
			- b.s-static.ak
			- api
			- api-read
			- apps
			- code
			- connect
			- developers
			- govtrequests
			- graph
			- l
			- login
			- m
			- mbasic
			- pixel
			- code.prod
			- www.prod
			- research
			- ssl
			- static-ak
			- \w\w-\w\w 	(language-specific subdomains)

		- connect.facebook.net
		- newsroom.fb.com
		- threatexchange.fb.com

		- fbcdn.net subdomains:

			- dragon.ak		(→ fbcdn-dragon-a.akamaihd.net)
			- photos-[a-h].ak
			- s-static.ak

			- *.xx:

				- profile-a
				- profile-a-ord
				- scontent
				- scontent-02
				- scontent-ams3-1
				- scontent-b-ams
				- scontent-b-lax
				- scontent-b-ord
				- scontent-ord
				- sphotos
				- sphotos-b


	These altnames don't exist:

		- prod.facebook.com

-->
<ruleset name="Facebook">

	<target host=      "facebook.be" />
	<target host=  "www.facebook.be" />
	<target host=      "facebook.de" />
	<target host="de-de.facebook.de" />
	<target host=  "www.facebook.de" />
	<target host=      "facebook.dk" />
	<target host="da-dk.facebook.dk" />
	<target host=  "www.facebook.dk" />
	<target host=      "facebook.es" />
	<target host="es-es.facebook.es" />
	<target host=  "www.facebook.es" />
	<target host=      "facebook.fr" />
	<target host="fr-fr.facebook.fr" />
	<target host=  "www.facebook.fr" />
	<target host=      "facebook.is" />
	<target host=  "www.facebook.is" />
	<target host=      "facebook.it" />
	<target host=  "www.facebook.it" />
	<target host=      "facebook.jp" />
	<target host="ja-jp.facebook.jp" />
	<target host=  "www.facebook.jp" />
	<!-- doesn't answer on port 80
	<target host=      "facebook.mx" />
	-->
	<target host="es-es.facebook.mx" />
	<target host=  "www.facebook.mx" />
	<target host=      "facebook.nl" />
	<target host=  "www.facebook.nl" />
	<target host=      "facebook.no" />
	<target host="nb-no.facebook.no" />
	<target host=  "www.facebook.no" />
	<target host=      "facebook.se" />
	<target host="sv-se.facebook.se" />
	<target host=  "www.facebook.se" />
	<target host=      "facebook.us" />
	<target host=  "www.facebook.us" />
	<target host=              "facebook.com" />
	<target host=          "api.facebook.com" />
	<target host=     "api-read.facebook.com" />
	<target host=         "apps.facebook.com" />
	<target host=        "badge.facebook.com" />
	<target host=         "blog.facebook.com" />
	<target host=         "code.facebook.com" />
	<target host=      "connect.facebook.com" />
	<target host=        "da-dk.facebook.com" />
	<target host=        "de-de.facebook.com" />
	<target host=   "developers.facebook.com" />
	<target host=        "es-es.facebook.com" />
	<target host=        "fr-fr.facebook.com" />
	<target host= "govtrequests.facebook.com" />
	<target host=        "graph.facebook.com" />
	<target host=        "ja-jp.facebook.com" />
	<target host=            "l.facebook.com" />
	<target host=        "login.facebook.com" />
	<target host=            "m.facebook.com" />
	<target host=       "mbasic.facebook.com" />
	<target host=        "nb-no.facebook.com" />
	<target host=        "pixel.facebook.com" />
	<target host=    "code.prod.facebook.com" />
	<target host=     "www.prod.facebook.com" />
	<target host=     "research.facebook.com" />
	<target host="b.s-static.ak.facebook.com" />
	<target host=  "s-static.ak.facebook.com" />
	<target host=    "static.ak.facebook.com" />
	<target host=        "sv-se.facebook.com" />
	<target host=          "ssl.facebook.com" />
	<target host=    "static-ak.facebook.com" />
	<target host=          "www.facebook.com" />
	<target host=      "connect.facebook.net" />
	<target host=                    "fb.com" />
	<target host=           "newsroom.fb.com" />
	<target host=     "threatexchange.fb.com" />
	<target host=                "www.fb.com" />
	<target host=        "dragon.ak.fbcdn.net" />
	<target host=      "external.ak.fbcdn.net" />
	<target host=      "photos-a.ak.fbcdn.net" />
	<target host=      "photos-b.ak.fbcdn.net" />
	<target host=      "photos-c.ak.fbcdn.net" />
	<target host=      "photos-d.ak.fbcdn.net" />
	<target host=      "photos-e.ak.fbcdn.net" />
	<target host=      "photos-f.ak.fbcdn.net" />
	<target host=      "photos-g.ak.fbcdn.net" />
	<target host=      "photos-h.ak.fbcdn.net" />
	<target host=       "profile.ak.fbcdn.net" />
	<target host=    "a1.sphotos.ak.fbcdn.net" />
	<target host=    "a2.sphotos.ak.fbcdn.net" />
	<target host=    "a3.sphotos.ak.fbcdn.net" />
	<target host=    "a4.sphotos.ak.fbcdn.net" />
	<target host=    "a5.sphotos.ak.fbcdn.net" />
	<target host=    "a6.sphotos.ak.fbcdn.net" />
	<target host=    "a7.sphotos.ak.fbcdn.net" />
	<target host=    "a8.sphotos.ak.fbcdn.net" />
	<target host=      "sphotos-b.ak.fbcdn.net" />
	<target host=      "sphotos-d.ak.fbcdn.net" />
	<target host=      "sphotos-h.ak.fbcdn.net" />
	<target host=     "profile-a.xx.fbcdn.net" />
	<target host= "profile-a-ord.xx.fbcdn.net" />
	<target host=      "scontent.xx.fbcdn.net" />
	<target host="scontent-b-ams.xx.fbcdn.net" />
	<target host="scontent-b-lax.xx.fbcdn.net" />
	<target host="scontent-b-ord.xx.fbcdn.net" />
	<target host=       "sphotos.xx.fbcdn.net" />
	<target host=     "sphotos-b.xx.fbcdn.net" />
	<target host="fb.ecn.api.tiles.virtualearth.net" />


	<!--	Not secured by server:
					-->
	<!--securecookie host="^\.facebook\.com$" name="^(datr|m_ts|reg_ext_ref|reg_fb_gate|reg_fb_ref)$" /-->

	<securecookie host="^(?:.*\.)?facebook\.com$" name="(?:c_user|lu|sct|xs)" />
	<securecookie host="^\.facebook\.com$" name=".+" />
	<securecookie host="^newsroom\.fb\.com$" name=".+" />

	<!--	Cert doesn't macht. Also on fbstatic-a.akamaihd.net, but this is what the servers do.
								-->
	<rule from="^http://static\.ak\.facebook\.com/"
		to="https://s-static.ak.facebook.com/" />

	<!--		Cert doesn't match and
		this is what the server does.
						-->
	<rule from="^http://(?:www\.)?facebook\.(?:be|is|it|nl|us)/"
		to="https://www.facebook.com/" />

	<!--	Ditto.
			-->
	<rule from="^http://(?:de-de\.|www\.)?facebook\.de/"
		to="https://de-de.facebook.com/"/>

	<!--	Ditto.
			-->
	<rule from="^http://(?:da-dk\.|www\.)?facebook\.dk/"
		to="https://da-dk.facebook.com/" />

	<!--	Ditto.
			-->
	<rule from="^http://(?:es-es\.|www\.)?facebook\.(?:es|mx)/"
		to="https://es-es.facebook.com/" />

        <!--    Ditto.
		        -->
        <rule from="^http://(?:fr-fr\.|www\.)?facebook\.fr/"
                to="https://fr-fr.facebook.com/"/>
	
	<!--	Ditto.
			-->
	<rule from="^http://(?:ja-jp\.|www\.)?facebook\.jp/"
		to="https://ja-jp.facebook.com/" />

	<!--	Ditto.
			-->
	<rule from="^http://(?:nb-no\.|www\.)?facebook\.no/"
		to="https://nb-no.facebook.com/" />

	<!--	Ditto.
			-->
	<rule from="^http://(?:sv-se\.|www\.)?facebook\.se/"
		to="https://sv-se.facebook.com/" />

	<!--	Akamai.
			-->
	<rule from="^http://dragon\.ak\.fbcdn\.net/"
		to="https://fbcdn-dragon-a.akamaihd.net/" />

	<rule from="^http://external\.ak\.fbcdn\.net/"
		to="https://fbexternal-a.akamaihd.net/" />

	<rule from="^http://s?photos-([a-h])\.ak\.fbcdn\.net/"
		to="https://fbcdn-sphotos-$1-a.akamaihd.net/" />

	<rule from="^http://profile\.ak\.fbcdn\.net/"
		to="https://fbcdn-profile-a.akamaihd.net/" />

	<rule from="^http://(?:a\d\.)?sphotos\.ak\.fbcdn\.net/"
		to="https://fbcdn-sphotos-a.akamaihd.net/" />

	<!--	Bing maps. Should be generalized and moved at some point.

		Cert only matches *.tiles.virtualearth.net.
								-->
	<rule from="^http://fb\.ecn\.api\.tiles\.virtualearth\.net/"
		to="https://api.tiles.virtualearth.net/" />

	<rule from="^http:"
		to="https:" />
</ruleset>
