Chrome to force .dev domains to HTTPS via preloaded HSTS
ma.ttias.be
ma.ttias.be
I don't know why people thought they could start using random TLD's on their own, there was always the risk they could be delegated officially.
https://www.iana.org/assignments/special-use-domain-names/sp...
For years, Microsoft's own guidelines suggested using .local for internal AD domains. Then one day, Apple started using it on mDNS, and Microsoft advice was suddenly "never use .local".
But renaming an AD domain is painful and in many scenarios not supported at all, and people with domains more than a few years old are regularly pointed at Microsoft's recommendations and forced to explain the situation.
It causes all sorts of grief when shared SMB drives won't resolve on linux, or you can't tell at first blush whether the DNS server is working properly or you just happen to have mDNS correctly resolving something for you on one machine (but not on another).
And on BSD/Linux (with avahi). And on Phones. Actually, I think ONLY windows does not use this, though the mDNS implementation (bonjour) for windows uses that too.
I haven't tried it, but supposedly you could host a .local site on your laptop and access it from your phone using the same wifi network.
Any DNS query for a name ending with ".local." MUST be sent to the mDNS IPv4 link-local multicast address 224.0.0.251 (or its IPv6 equivalent FF02::FB).Rewriting/expanding the statement using my words, this is what they said: "I don't know why people (developers) thought they could start using random TLDs for local/testing purposes".
Yes, Google got the TLD and controls it now. The GP isn't criticizing Google (although I still think "we bought a TLD for internal use" is worth debating), they criticize people like the blog author for using 'random' (i.e. "not meant for that purpose") TLDs in their development process.
The problem here is that Chrome works around that system, which causes pains for others.
The best practice for at least the past decade has been to either use subdomains of globally resolving domains that you own, or use one of the four testing TLDs specified in RFC 2606 that are guaranteed to never be delegated: https://tools.ietf.org/html/rfc2606
Unfortunately, not one of those four is designed for the use case of "private domain, for use in production", which is pretty common for companies to use.
.test is for "testing of current or new DNS related code"
.example is for "documentation or examples"
.invalid is for "online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid"
.localhost is for the loopback (and using it otherwise breaks existing code)
Nothing prevents the first three from being used for this purpose, but at best it's semantically awkward and jarring. What sysadmin wants services running on an internal VPN to use the TLD ".test" or ".example"?
What's so bad about service.company-internal.com? (or service.internal.company.com, but some people understandably prefer having them totally separated) You don't have to actually resolve the internal names publicly.
No, but you do actually have to reserve the public domain, which can be inconvenient or undesirable for all sorts of reasons.
It is, but again, it doesn't help that none of the reserved TLDs actually address the primary use case here for a lot of companies. We can both agree that the companies should be registering their private domains, but clearly most aren't, and there's no reason they shouldn't have a free, reserved-for-private use space that does address it.
* http://jdebp.eu./FGA/dns-use-domain-names-that-you-own.html
I'd also say that, while having TLDs for testing usage is acceptable, there should never be any designed for production use as that would seemingly endorse the idea. The best practice (to use domains/subdomains that you own) should always be followed, and just because people do the wrong thing doesn't mean ICANN or the IETF should go out of their way to make the wrong thing easier to do.
Domain names that only resolve internally are a security anti-pattern. You should have full authentication on all services, and not rely on simply being able to reach a service in order to grant access. See e.g. DNS rebinding as one attack vector that can really ruin your day if you don't do this.
* http://jdebp.eu./FGA/dns-client-all-proxies-must-provide-sam...
I also wrote a Frequently Given Answer describing some more of the mistakes that people have made over and over in this, that one should learn from and not repeat.
* http://jdebp.eu./FGA/dns-use-domain-names-that-you-own.html
For a long time, the set of non-country TLDs was mostly static, and country TLDs were always exactly two characters. The risk was always there, but it looked like it was only a theoretical risk, until recently the floodgates opened and nearly every TLD became fair game.
Edit: This was all described in another part of this thread already, sorry for the pure duplication.
There's been plenty of time to fix things, but as usual, people will delay and only fix things when they break. Hence ICANN's Controlled Interruption process.
So "recently" is even more relative than that. (-:
If a company has its own internal network with its own DNS, does it still need to conform to ICANN's name assignments? I thought it doesn't...?
Probably better to just use real globally delegated domain names though.
First, you will begin leaking internal data by means of DNS requests, server connections, maybe even internal emails - e.g. when a client attempts to connect to the intranet outside of VPN.
Second, you obviously won't be able to communicate with the new owners of that domain.
Except (correct me if I'm wrong), this is not a "modified network", it can be another disconnected network that's just as "correct" in the standard conformance aspect as the Internet. It's more like Chrome is "modified" to support one network better than others - or rather, to possibly break on other networks.
In fact, it seems to me like the very idea of HSTS preload list isn't friendly with UAs working on multiple separate networks.
But yeah, you're right that this is what they are designed for after all. (I'm also probably slightly biased, since some of our test environments use .dev domain in our LAN.)
ICANN can't keep names unique if people just take them.
It stuck, annoyingly, like a misinformed fad that won’t go away.
I agree btw - .test or .local - anything else is just asking for problems
Does anyone have a solution for this?
But to pre-emptively answer the most likely question: We see HTTPS everywhere as being fundamental to improving security of the Web. Ideally all websites everywhere would use HTTPS, but there's decades of inertia of that not being the case. HSTS is one tool to help nudge things towards an HTTPS everywhere future, which has really only become possible in the last few years thanks to the likes of Let's Encrypt.
Since it appears that .dev is a Google internal TLD, would you consider not forcing that rule outside of Google? Effectively, we're getting all the stick and none of the carrot.
Alternately, announce your plans for .dev so as to bring some transparency to the process OR purchase maybe the .vm TLD and mark it for developer local testing in place of/addition to .localhost.
You should not be using globally delegated TLDs for local testing. See RFC 2606. I don't see how using .localhost or .test is any more of an inconvenience than using .dev. Indeed it is less of an inconvenience because it will work without DNS shenanigans.
The last round of gTLD expansion occurred in 2012 and there's still many years left until a potential future round. Additionally, .vm is not a valid gTLD because all two letter combinations are reserved for ccTLDs (countries).
And I would love to have some plans to announce. Maybe soon.
It's like complaining that you're using appname.ycombinatordev.com as a development suffix, then someone registers it and all your stuff breaks, and you want them to fix your problem.
It isn't good practice to use random domains or TLDs that you don't own for testing. At work we have a separate publicly-registered domain, and an internal subdomain with NS records on the primary publicly-registered domain that resolves separately. It's never been a problem..
More broadly, I think it's worth incurring some inconvenience for the sake of security. Go too far in the other direction and you end up like Equifax.
But you can't exactly just skip it (witness Equifax).
https://tools.ietf.org/html/rfc6698
Not really an alternative to HTTP+TLS, but possibly another way of doing it depending on how it's implemented.
Forcing security at multiple levels and making HTTPS easier is the way forward.
Well, many people think that current TLS is too complicated and in part that discussion led to TLS 1.3. While I'm still not entirely happy with the complexity, it is far less complex than TLS 1.2.
TLS 1.3 removes a lot of the options that 1.2 had.
However besides that...just curious: Will Chrome honor a header to disable HSTS for preloaded domains? (e.g. Strict-Transport-Security: max-age=0)? And what is going to happen if I submit my .dev site for removal from https://hstspreload.org/ ?
Also, reading the rules on hstspreload.org, I see the following statement: "Don't request inclusion unless you're sure that you can support HTTPS for your entire site and all its subdomains the long term"
Since you cannot actually guarantee that every .dev site will support HTTPS considering the fact that many developers use it on their LAN...don't you think you're breaking the rules here and possibly causing more problems than solutions?
My understanding is that HSTS carveouts are supported by Chrome but not yet other browsers. There's more standardization work to be done there. That said, you can only request entries on the HSTS list for domains that you own, and since no one (yet?) owns any .dev domain names, no one could request such changes. It goes without saying why you can only change security settings for domain names that you own.
And for the last question: Again, there are no .dev domain names. There never have been. It's never been available for registration. The recommendation for a long time has been to only use either (a) domain names that you actually own, or (b) domain names that are reserved for testing and are guaranteed never to exist a la RFC 2606. Using domain names for testing that don't yet exist but could in the future is a huge security hole that you must fix now. Do it now while the domain names still fail to resolve. Once they resolve, and you don't own them, then your security situation gets a lot worse.
It is, however, in widespread practical use.
> The recommendation for a long time has been to only use either (a) domain names that you actually own, or (b) domain names that are reserved for testing and are guaranteed never to exist a la RFC 2606
If taken to its extreme, that recommendation would mean that any kind of internal hostnames - even dotless ones - are subject to potential override unless they are tied to a public DNS entry.
* http://jdebp.eu./FGA/web-fully-qualified-domain-name.html
Would that I had recorded the case some while back where, when I pointed this out, someone chimed in to note that xe had worked for a company that had actually taken advantage of this in order to usurp external WWW sites.
And then there was WPAD.
* http://jdebp.eu./FGA/web-browser-auto-proxy-configuration.ht...
This is not taking things to an extreme. This is reality right now and has been for many years.
I disagree that this is something that Google needs to do on my behalf. If a cybersquatter squats on <my-startup>.dev, I don't consider it broken if I can't access their squat page. If I'm overriding random domains without doing my due diligence, then I get what I deserve (and probably wanted the results anyways). If somebody is spoofing a domain as a method of cyber attacking, the domain owner should have had HSTS if they had dignificant digital assets and they would already be using a non .dev domain.
I mean, that is exactly what is happening here, so it sounds like you get it. We aren't doing things on other people's behalf; HSTS is part of our plans.
The intention when registering such a domain name would be to follow said requirements, otherwise you wouldn't be able to use the domain name for hosting websites (though you could of course still use it for other services).
I.e., could you actually use your own certificate for a .dev site or would the browser only accept Google's?
For example, I see that .dev has a DS record in the root. But nic.dev is not signed.
I'd be less unhappy about this if web browsers (and application updaters) understood x509 ca cert limits, so you could tell a device to trust the lan cache to impersonate Debian.org, windowsupdate.com and BBC.com - but not Gmail.com...
For reference your options are:
.test
.example
.invalid
.localhost
https://tools.ietf.org/html/rfc2606With only .localhost fitting the purpose of most people's usage of .dev.
Try:
dig any localhost.dog
dig any thing.localhost.dog
dig any you.want.localhost.dog
I find it useful, though its uses are admittedly limited. TTL is 30 days, but some resolvers (e.g. Google's 8.8.8.8, 8.8.4.4) dial it back to 1 day.I meant that I registered the domain name, and setup the A,AAAA DNS records (including wildcards) to point to 127.0.0.1.
First of all I think this is generally a good move. If people use random TLDs for testing then that’s just bad practice and should be considered broken anyway.
But second I think using local host names should be considered a bad practice anyway, whether it’s reserved names like .test or arbitrary ones like .dev. The reason is that you can’t get valid certificates for such domains. This has caused countless instances where people disable certificate validation for test code and then ship that code in production. Alternatively you can have a local CA and ship their root on your test systems, but that’s messy and complicated.
Instead best practice IMHO is to have domains like bla.testing.example.com (where example.com is one of your normal domains) and get valid certificates for it. (In the case where you don’t want to expose your local hostnames you can also use bla-testing.example.com and get a wildcard cert for *.example.com. Although ultimately I’d say you just shouldn’t consider hostnames to be a secret.)
https://letsencrypt.org/2017/07/06/wildcard-certificates-com...
Client support isn't super awesome from what I understand but it's much better than having an unconstrained root ('keys to the internet') on >1 client - especially if you can't go the nines to protect said key.
I think you're oversimplifying.
There are other scenarios you can imagine where it's not a good idea to let one security domain bleed into another.
An internal CA is simply not the problem here, particularly since you can audit your admins' actions.
> An internal CA is simply not the problem here, particularly since you can audit your admins' actions.
If you can properly audit your admins' actions, then that's indeed not a problem.
It's easier said than done; I just tried to mention a few reasons why a lot of people suggest (IMHO rightfully so) that perhaps it's not something just about every company should do.
In particular, it's you don't just have to ensure that the CA is properly defended from outside threats only.
Before letsencrypt we didn't have any choice, but now the landscape is really different and in many cases I believe a company could easily defer dealing with an internal CA, especially after https://letsencrypt.org/2017/07/06/wildcard-certificates-com...
FWIW, certificate pinning (HPKP) and efforts like Certificate Transparency are attempts to address or at least mitigate weaknesses of the PKI system.
One thing I'm not quite sure about is if this means we need to be using the same wildcard cert for both dev and prod? I don't suppose the cert can be considered valid by the browser if otherwise?
If that's the case, I'm wondering if there are any best practices around securely distributing valid production certificates to dev machines across a team and keeping them up-to-date with Let's Encrypt's auto renewing mechanism? Ideally in a way that's transparent to each individual developer? I'm guessing committing them directly into a repo is probably a bad idea, especially for open source projects.
Though I'm still curious how people usually distribute a cert like that internally and update it to keep it in sync with Let's Encrypt automatic renewal mechanism?
As far as I understand, Let's Encrypt requires a public facing web server on the matching domain to renew certificates, so we'd have to actually set up a server solely for the purpose of certificate renewal on a 2-levels deep subdomain, expose it to the public internet, and then propagate the updated certs from that server into every dev machine every time a renewal is triggered?
It sounds like there's little security risk with this approach as long as we use a wildcard cert at least 2-levels deep as you've described, as we don't have to trust this cert for real production traffic at the root domain. But I'm still wondering if there's some tooling I could adopt to streamline this process a bit? Or should I just bite the bullet and script it all myself?
Here's a gist you can follow if you'd like to do things the old fashioned way (i.e. create your own Root Certificate Authority, create a Sub-Root Authority and use that to sign internal certificates): https://gist.github.com/corford/9a206664bb8278c8243821d23666...
It's 99% copy & pasteable (doesn't assume any existing openssl.conf) and should give you decent compatibility and future proofed security. Just remember to keep the root CA safe and only use the sub-ca for signing certs.
Distributing your private SSL certificate to everyone in the company is a bad idea.
.foo is delegated and thusly a full TLD, yes.
On the other hand, you should not be using .localhost if the target is not running on your loopback interface, resolving localhost to anything but loopback is considered harmful.
I find .test or .intranet to be more useful for such installations, they are either designated as "cannot be a TLD" or are very very unlikely to become a TLD, respectively.
I have heard this before, but not really seen any great arguments as to why. Sure, `localhost` should not be bound to anything other than loopback, but I don’t see the harm in remapping `whatever.localhost` to the IP address of the Vagrant box running on your local machine.
The problem is that while the loopback addresses can be mapped as a secure context, even without HTTPS, .localhost. cannot since it might not be a loopback context.
You can literally use anything else to map to your vagrant box including "whatever.i-dont-care" and "whatever.whatever".
Remapping .localhost. destroys the implicit assumption of many developers that a .localhost. means loopback and rightfully the above draft proposes to force any resolve to either fail or resolve to loopback.
Makes developing multi-server apps a bit easier since I can point it all to loopback without worry. (Plus using multiple loopback addresses helps)
Or, making a tradeoff from "accuracy" to "less magical" - ".chrome-hsts"
* DEV is listed on the "delegated strings" page of ICANN[0]
* `dig dev. ns +short` returns a couple of nameservers, the one of Charleston Road Registry: Google's registry.
[0]: https://newgtlds.icann.org/en/program-status/delegated-strin...
The ICANN Wiki specifically lists the .dev domain as proposed, not delegated. Which means they can also just kill it and Google won't have it.
* On https://www.icann.org/resources/agreement/dev-2014-10-16-en you can see the agreement between ICANN and Charleston Road Registry to operate the TLD for 10 years
* other pages on the wiki for TLDs that you can already register now still shows "proposed"
* Publish mDNS records to give myself extra `.local` names, or * Get a wildcard published in the organisation's internal DNS
If you can't do either of those, _please_ use `.test` as your test TLD, as it's explicitly set aside for that purpose so you know you're never going to collide with anyone.
I wrote such a tool:
https://github.com/bertjwregeer/mdns-announce
It allows you to easily announce CNAME's in mDNS to do the sort of dev testing locally that requires alternate domains, without the possibility of leaking them outside of your own local network.
https://github.com/bertjwregeer/mdns-announce
It publishes CNAME records into mDNS for adding additional "hostnames".
I've hacked together an Apache module that tries to announce local hostnames for vhosts, but while it's good enough for me it's never been quite good enough for me to share.
That means your local development machine needs to;
- Be able to serve HTTPs
- Have self-signed certificates in place to handle that
- You'll have to click through the annoying unsecure site window every time
Such fun.
Part of HSTS is the requirement that certificate warnings become unskippable. So the above wouldn't work - you'll need an actual CA-signed certificate that is accepted by the browser, otherwise, you won't be able to access the site.
".localhost" has existed and been popular for local development for MANY years. I've no idea why somebody would use `.dev, but now that it's a registered TLD, using it locally is just asking for trouble.
Also, you can just use 127.0.0.1, 127.0.0.2, 127.0.0.3, etc.
(Well technically you can, but it would be confusing ;)
If only. Those days are long gone.
These days the majority of web-developers I see exclusively use Chrome and test in nothing else.
Google seems to be encouraging this behaviour too, with web-pages promoting people use unfinalized APIs found only in Chrome for production websites. It's the new MSIE, for sure.
I wouldn't register any dev domains though these are supposed to be throwaways based on the project (my "serve" script takes the folder name and uses that plus .dev as a domain)
I'll just switch to .test as recommended elsewhere
From the homepage "That’s it! Your app will be up and running at http://myapp.dev/. See the user’s manual for more information."
I'm sure basecamp won't love this change and I'd guess many rails devs won't like this either.
It's a bit unnerving that the project hasn't seen an update since 2014, and has 100 open issues.
We do not use .dev locally.
dev.ourdomain.net is a web-accessible server on our local network, configured as the dns server for that sub domain and is our internal CA trusted to issue the certs we use for development.
Application software SHOULD NOT recognize test names as special, and SHOULD use test names as they would other domain names.
We have an automated setup of it for devs, but it's out of necessity rather than anything else. It's a pain to deal with.
The real issue (for me at least) is that it's far too much of a pain to run an SSL secured site locally. It can be done, but doesn't work well across teams given you need to register your certificates locally. Being able to serve a site from a Vagrant box or a Docker container over https in a way that a browser will accept (or even just pretend to accept) would be immensely helpful. I'm sure web developers and browser vendors are trying to resolve the problem already, but it can't come soon enough in my opinion.
Sorry for top-leveling a grand-child comment, but reading between
the lines, this is the attack vector:
> And for the last question: Again, there are no .dev domain
> names. There never have been. It's never been available for
> registration. The recommendation for a long time has been to
> only use either (a) domain names that you actually own, or (b)
> domain names that are reserved for testing and are guaranteed
> never to exist a la RFC 2606. Using domain names for testing
> that don't yet exist but could in the future is a huge security
> hole that you must fix now. Do it now while the domain names
> still fail to resolve. Once they resolve, and you don't own
> them, then your security situation gets a lot worse.
Google is concerned with nation-state attacks. This means they
have to assume ninja-assassin-scuba-divers have tapped all their
cables underground. They're also concerned about
ninja-assassin-usb-stick-droppers, and all kinds of other use
cases.
What they're doing is:
1) Requiring *.dev to match PRE-LOADED HSTS certs. This allows
google to "safely" boot up a computer from scratch. Just so long
as "clone-a-computer-from-scratch.dev" matches the
public/private handshake for HSTS/HTTPS then google knows that no
MITM, no nation state DNS takeover, etc. is possible.
So long as the VERY FIRST CONTACT WITH THE INTERNET is a *.dev
domain, then that computer can be "as secure as possibly known".
2) Forcing people to bounce "off" of invalid TLD's as a network
administration method.
Remember, google is concerned about nation states. Remember
wanna-cry? How it was disabled by some random researcher
registering xyz-abc-123.com?
That attack costs $15. Now imagine a nation-state, intentionally
registering a gTLD of "\*.haha-now-your-company-infra-is-pwnd"
which they somehow glean is the gTLD your developers use for
local development / testing / intranet portal.
If you could spoof IBM's intranet by doing something like:
"http://www.welcome.ibm" or "https://www.welcome.ibm" (b/c the
*.ibm wasn't cert-pinned.....) then you could trivially cause
*.ibm to resolve to some sort of spoofed site to collect
passwords. Or what if they're catching `mysql -uroot -pxyz
staging.product.ibm`? Whoops.
Or... perhaps another gTLD we'll see google register is "*.go" or
maybe their internal builds of chrome already do cert-pinning on
that. (Reason is I've seen/heard they allow
'http://go/my-internal-shortlink' ... I know that other tech
companies have had similar setups).
Same attack vector. You control the DNS, you control ALL
responses. And when somebody types www.microsoft.com, it may be
_impossible_ to know if that "Down for Maintenance" banner is
real or fake if their DNS is controlled by somebody who really is
your enemy.There is something about how you've formatted it that requires unreasonable side-to-side scrolling.
This forcing of opinionated things goes on my nerves. How about develop the browser, and let the mass decide what they use. Amazon was 100% HTTP for 20 years (except the single login page) - it worked very well.
Also, wouldn't bundling (tens of) thousands of domains start to add up, and slow down first page load for regular browser use?
I'm sure I must be missing something, because this doesn't seem very logical to me.
> These sites do not depend on the issuing of the HSTS response header to enforce the policy, instead the browser is aleady aware that the host requires the use of SSL/TLS before any connection or communication even takes place. This removes the opportunity an attacker has to intercept and tamper with redirects that take place over HTTP.
Read this: https://scotthelme.co.uk/hsts-preloading/
> Also, wouldn't bundling (tens of) thousands of domains start to add up, and slow down first page load for regular browser use?
Why would it? Checking in a data structure if the domain the user requested should be loaded over HTTPS can be done in a perfectly efficient way. A hash table would give you O(1) lookup times on average and there's other things you can use to mitigate the worst case lookup of O(n).
I was hoping the article would cover the scaling aspect a bit more. I guess it's just meant to be a mid-step towards browsers defaulting to HTTPS at some unknown point in the future.
[1]: https://docs.google.com/document/d/1LqpwT2aAekrWPtLui5GYdHSG...
If there's an attacker between you and the website, you will never see the 301 redirect. The preload list was designed for that kind of scenario.
This is a good thing, of course. Security should be global, not dependent on what browser you happen to use.
I use .local for, well, my local network and I find that Chrome can't find them half the time (telling me that the server can't be found or that I don't have internet connection). Safari, Firefox and even command line tools find them without skipping a beat while Chrome insists that I'm offline.
I think the culprit is the internal DNS cache. If, for whatever reason it can't find the server once, then it gets stored in the cache as unreachable and needs a cache flush to fix. To add insult to injury, in previous versions of Chrome you could disable the internal DNS system, but apparently not anymore.
Plus this isn't even the governments intervention, this is browser vendors raising the bar for online security.
It's Google's browser forcing one of Google's own gTLDs to HTTPS. There is no masses involved. Anything else on the HSTS preload list is there at the request of the domain or gTLD owners.
> Amazon was 100% HTTP for 20 years (except the single login page) - it worked very well.
Sure it did! It also allowed any interested party to observe all your interactions with Amazon. What worked 20 years ago doesn't necessarily work today. Standards evolve, new attack vectors emerge, and people's needs for privacy or what they expect to be private changes.
https://sites.google.com/a/chromium.org/dev/Home/chromium-se...
.dev should have been entirely reserved, or made available publicly. Registering a TLD just for your own internal testing, and forcing everyone to switch away, is the most user unfriendly move you can do.
And specifically, the wildcard DNS entry for 127.0.53.53 is for ICANN's Controlled Interruption process. See here: https://www.icann.org/resources/pages/name-collision-ro-faqs...
(And why is Google in the TLD market at all? Google’s already far too large as company – impossible to democratically control, any further growth of Google should be immediately and forcefully stopped).