Earlier quoted context omitted.
Google's reach of "Edge Caches" seems closer to Akamai's than CloudFront's though - lots of indivdual ISPs have them.
I have pretty strong doubts that the Google Cloud Platform team would have convinced the broader organisation to host customer stuff on their mission critical caches. As I understand it, there's not a lot of dogfooding (let alone cooperation!) between GCP and Google.
Google has quietly launched a CDN
21–30 of 46 posts
Re: Google has quietly launched a CDN
#22Earlier quoted context omitted.
Google's reach of "Edge Caches" seems closer to Akamai's than CloudFront's though - lots of indivdual ISPs have them.
I have pretty strong doubts that the Google Cloud Platform team would have convinced the broader organisation to host customer stuff on their mission critical caches. As I understand it, there's not a lot of dogfooding (let alone cooperation!) between GCP and Google.
Re: Google has quietly launched a CDN
#23Earlier quoted context omitted.
If you trust your CDN, then no, you have less issues if you use the same domain as the one you use for your APIs.
It's not about the security of the cookies, it's about the bandwidth you save by having a separate domain for static content, because the client does not have to transmit the cookies for each request.
Each cookie has a path set to it and browsers will obey it, this includes inter-domain paths and restrictions. If you want you can go even further and assign a cookie to a specific URI path so the cookie will only be issues to pages that fall under www.example.com/private/ for example if that's what the path is set too.
Re: Google has quietly launched a CDN
#24Earlier quoted context omitted.
It's not about the security of the cookies, it's about the bandwidth you save by having a separate domain for static content, because the client does not have to transmit the cookies for each request.
If you issue cookies to www.example.com your browser will not send them to cdn.example.com unless it's very poorly written. Each cookie has a path set to it and browsers will obey it, this includes inter-domain paths and restrictions. If you want you can go even further and assign a cookie to a specific URI path so the cookie will only be issues to pages that fall under www.example.com/private/ for example if that's…
Re: Google has quietly launched a CDN
#25Earlier quoted context omitted.
If you issue cookies to www.example.com your browser will not send them to cdn.example.com unless it's very poorly written. Each cookie has a path set to it and browsers will obey it, this includes inter-domain paths and restrictions. If you want you can go even further and assign a cookie to a specific URI path so the cookie will only be issues to pages that fall under www.example.com/private/ for example if that's…
There are many high profile websites that use the cookieless domain approach: Google, Facebook, and Reddit off the top of my head. I wouldn't say they are poorly written - it's more of a design decision to have cookies in the top-level domain.
And the fact that big sites use it doesn't mean that they were "well written", Google mostly issues only tracking cookies for wildcard domains like .google.com as far as private cookies go they usually would be issued for each domain individually (play.google.com etc.). Issuing authentication cookies to wildcard domains and root paths isn't advisable even if some big sites do it doesn't mean you should take it as an example :)
P.S. I really hate "Google and Facebook are doing it" as an example, even if they are you most likely aren't either of them, not even close they have quite different considerations than you. Even when they do things which aren't best practice or common sense it doesn't mean that you should decide to take the same path, both Google and Facebook have plethora of ways to ensure account security including quite decent activity heuristics, they have many ways of detecting attacks such as XSS, and they have most likely a much better process of ensuring that vulnerable pages do not go live or do so quite rarely. Unless you can say the same then do not use them as an excuse, you do not need to issue cookies to wildcard domains and you can restrict them to certain paths, and you better do so because you do not have many other mitigating controls in place as the big players do.
Re: Google has quietly launched a CDN
#26Earlier quoted context omitted.
Usually you created CNAMEs from your domain to your CDN's.
Is it best practice to use a separate domain for CDN because of cookies? Eg: examplecdn.com instead of cdn.example.com
Another big one is security of cookies and data, like you mentioned. Most of the time CDNs will return an access allow origin * header. This is literally the worst thing you can do for security of your users if they have a secret cookie. A different domain minimizes the risk of making a mistake to zero since it is completely separate, and is easier since you don't need any nginx funny business proxy passing to a server with static assets with a location directive.
The allow access origin * is a death sentence that breaks same origin policy if you make a mistake.
Re: Google has quietly launched a CDN
#27Earlier quoted context omitted.
Is it best practice to use a separate domain for CDN because of cookies? Eg: examplecdn.com instead of cdn.example.com
There are many reasons. One old reason is because your browser will only make so many concurrent Connections to one domain, so this spreads the load. I'm not sure how many concurrent resources they will download nowadays though. Another big one is security of cookies and data, like you mentioned. Most of the time CDNs will return an access allow origin * header. This is literally the worst thing you can do for securi…
You share quite a bit of things with your CDN quite often various API keys, as well as SSL certificates unless you do not serve your main content over SSL in the first place.
Most (I'm pretty sure all) CDN's give you the ability to set your own CORS policy if you see a CDN on cdn.example.com returns allow origin * then it means it's user did not set the CORS headers properly. Also the CDN can return allow allow and it still will not make a difference if you issue your cookies to the proper domain and path e.g. www.example.com/account if that's the domain and path there is no way a modern browser will attach that request to anything which doesn't sit on www.example.com and is located under /account.
If you issue your auth cookies to .example.com and the / path don't be surprised why ever XSS and other client side attacks end up compromising your users, you can have 100 XSS's in your site, you can have a shitty CORS policy and if your cookies are issued and restricted properly it's more likely than not that those vuln's could not be leveraged to compromised your users' sessions (not through a classic session theft that is).
Re: Google has quietly launched a CDN
#28Not to rag on the offering, but the headline is just not right. This is a CloudFront competitor not an Akamai competitor. Its a very rigid barebones product at a low margin via self-serv tooling.
The best part about it, I automatically write to three caches whenever I write to GAE datastore. One to the instance, one to memcache and one to Google's edge cache. It's just part of the GAE api, you get it for free.
Re: Google has quietly launched a CDN
#29Earlier quoted context omitted.
There are many reasons. One old reason is because your browser will only make so many concurrent Connections to one domain, so this spreads the load. I'm not sure how many concurrent resources they will download nowadays though. Another big one is security of cookies and data, like you mentioned. Most of the time CDNs will return an access allow origin * header. This is literally the worst thing you can do for securi…
Cookies should be secured using the domain and path attributes. You share quite a bit of things with your CDN quite often various API keys, as well as SSL certificates unless you do not serve your main content over SSL in the first place. Most (I'm pretty sure all) CDN's give you the ability to set your own CORS policy if you see a CDN on cdn.example.com returns allow origin * then it means it's user did not set the…
I cant discuss your whole comment because it's long and I'm on a phone.
"If you issue your auth cookies to .example.com and the / path don't be surprised why ever XSS and other client side attacks end up compromising your users, you can have 100 XSS's in your site, you can have a shitty CORS policy and if your cookies are issued and restricted properly it's more likely than not that those vuln's could not be leveraged to compromised your users' sessions (not through a classic session theft that is)."
There is so much wrong about this paragraph. Who needs session theft in the scenario you provide..
If you have 100s of XSS on your site and a bad CORs policy there is a lot an attacker can do... Data exfiltration is very easy if you can execute js and so are things like XSRF.
A correct path and domain setting for cookies is important but web security is a lot harder than your acting like it is..