7 ms·
The first paragraph already highlights the issue I have with it. I don't want to loosen my firewall, some countries and their IP ranges just need not access my
by Avamander 7y ago
The first paragraph already highlights the issue I have with it. I don't want to loosen my firewall, some countries and their IP ranges just need not access my server.
- vegardx 7y agoThen use a different method of validation, like DNS?
- josteink 7y agoDNS validation once setup is so much easier to work with, for all use-cases I can imagine, I will never go back to HTTP-based authentication. Really, do give it a try.
- Avamander 7y agoImpossible (to do safely) with most providers I've seen, even CloudFlare doesn't offer a properly limited API key.
- RL_Quine 7y agoSo delegate the validation with a CNAME and do it somewhere that’s not cloudflare. They provide signing with their own CA for origin certificates so I don’t really know why you’re using Let’s Encrypt at all. Your idea of just randomly blocking access from certain IP address ranges doesn’t really provide you with any security at all. If you’re worried about rusaian hackers or whatever, most people exploiting anything have access to botnets with whatever bespoke IP address ranges they need to bypass those sort of rules. In anti fraud we see this commonly, people using stolen details will happily get better matches with GEOIP than the legitimate users of the credentials. Blocking specific countries IP allocations is just providing a false sense security on your part.
- Avamander 7y ago> So delegate the validation with a CNAME and do it somewhere that’s not cloudflare. Like? For what price? > Blocking specific countries IP allocations is just providing a false sense security on your part. No, it's a preventative measure. Just like changing SSH to a non-standard port reduces pointless attempts.
- throw0101a 7y ago> Like? For what price? If you own example.com, you can delegate to dnsauth.example.com for $0 (or simply the price of a Internet-facing machine that has DNS open). Say you want a cert for www.example.com. LE will check for ownership by looking up _acme-challenge.www.example.com. Instead of having a TXT record with the nonce, _acme-challenge.www is actually a CNAME pointing to _acme-challenge.www.dnsauth--where the TXT nonce lives. The DNS daemon that is authoritative for dnsauth can be the traditional BIND, or other software: * https://github.com/joohoi/acme-dns https://github.com/joohoi/acme-dns This is often called 'DNS alias' mode: * https://github.com/acmesh-official/acme.sh/wiki/DNS-alias-mode https://github.com/acmesh-official/acme.sh/wiki/DNS-alias-mo... * https://www.eff.org/deeplinks/2018/02/technical-deep-dive-securing-automation-acme-dns-challenge-validation https://www.eff.org/deeplinks/2018/02/technical-deep-dive-se...
- Avamander 7y agoI did not ask "how", I wished to know who supports a DNS service like that and for what price.
- GuyPostington 7y agoThe parent stated that you can run your own DNS server temporarily for the cost of the hardware to run the server and shut the DNS server off after the certificate has been issued. The cost is basically free.
- jlgaddis 7y agoAny DNS service which allows you to create a CNAME RR supports it. You delegate the subdomain to any DNS server you wish. This isn't some special "Let's Encrypt DNS forwarding mode" that DNS providers have to explicitly support. It's simply part of "how DNS works".
- TrueDuality 7y agoEven with CloudFlare in front of your servers, it is still valuable to use Let's Encrypt certificates. You can turn on Full Strict SSL validation to the backend and reduce another attack vector. It's an unlikely attack vector to be exploited but it's also a trivial amount of work to implement. Every layer of security makes attacks that much more costly.
- RL_Quine 7y agoLike I said cloudflare signs certificates for your origin as well.
- tialaramex 7y agoAnd if you always use Cloudflare (or at least are sure you'd have days-weeks not minutes-hours between making a decision to cease using Cloudflare and actually executing) then it's actually safer to tell them you'll use their Origin certs rather than a public CA as well as likely being easier.
- aianus 7y agoWhy can't you do this safely with AWS? You can restrict the API key to write only to the zone _acme-challenge.<your domain>.
- vegardx 7y agoSmart way to do it, but it will set you back $0.5/month. You can likely do it cheaper with Lambda and API Gateway, but you'll have to invent the secret sauce yourself. I'm always a little surprised when there are short comings in IAM like that with route53 and records. It seems like a natural thing to be able to control, but for some reason you don't have resource level controls on hosted zones. It's all or nothing.
- stilldavid 7y agoThis is now supported as of a few weeks ago! I just set it up for a new domain using a cancel-able API key.
- watermelon0 7y agoI've just checked it, but with API tokens, I can only allow 'edit' rights on DNS records for a specific domain. There is no way to create a token allowing access only to _acme-challenge record.
- tialaramex 7y agoYou can use the CNAME trick to canonicalize all ACME challenge requests into a subdomain you reserved for this purpose and then give the tokens access to that subdomain. Let's Encrypt is obeying normal DNS mechanics, so when they ask for a TXT record for _acme-challenge.cat-photos.example.com and get a CNAME as a response, they'll ask for the TXT record for the name in the CNAME answer instead. If that's cat-photos.cert-issuer.example.com then a token valid only for the sub-domain cert-issuer.example.com can write that TXT record. You sort out the CNAME once, probably when creating cat-photos.example.com or setting it up to get a certificate, and then afterwards the API token is enough for automation.
- belorn 7y agoIf you have that kind of security profile that you need to lock down what ip addresses that can make a port 80 connection, and can't use the api of the dns provider because of security considerations, then how is giving a third party dns provider full control of DNS acceptable within the threat model? Run your own DNS server and get a registrar lock. If that is not feasible, and consultants are too expensive, I would look into the more expensive dns providers that provide custom interface that fit the threat model of your system. If that is also too expensive then I would take a second look at the risk analysis and recalculate the cost of each risk.
- scarejunba 7y agoYeah, looks like you have created a problem there for yourself. Back to other SSL providers for you, then. Unless you want to jump through some hoops.
- ahyattdev 7y agoYou can use pre and post renewal hooks in order to temporarily disable those firewall rules.
- elmo2you 7y agoAnd how does filtering on the IP range of a country prevent traffic from that country? Or are you also blocking every known proxy and VPN service? Are you sure that your strict firewall even provides the security you wish it did? Either way, letsencrypt will probably have a somewhat fixed pool of these challenge validation IP addresses/ranges, so adding those to a white list should probably work with a strict firewall.
- yjftsjthsd-h 7y agoI'm pretty sure that even a 50% mitigation is still valuable, and a remarkable number of attacks are completely unsophisticated. Having gone over server logs specifically looking at this sort of thing, I can tell you that a lot of attacks absolutely do appear to originate in countries that are vanishingly unlikely to have legitimate interest in the site (this was a small local business in the US, with logs showing a lot of `/wp-admin`-type attempts from Asia/Russia). So yes, blindly banning unexpected countries is very likely to reduce the number of attacks that you get, and if nothing else reduce log spam. It's a bit like changing your SSH port: easy to bypass, but it still reduces attacks by quite a bit.
- gruez 7y ago>but it still reduces attacks by quite a bit. But that's a wrong metric to optimize for. Cutting down the number of "attacks" by 90% doesn't improve your security. If your server has a vulnerability that can be picked up by script kiddie scanners, changing the default port only delays the inevitable.
- Sohcahtoa82 7y agoI think the idea isn't to increase security, but to decrease log spam from attacks that are attempted but won't work. For example, if you don't have WordPress, then all the attempts to access /wp-admin will never work, but will fill your logs with 404 errors.
- Avamander 7y agoIt does improve security by improving the SNR in logs.
- dspillett 7y agoI have my certs issued to a VM this is not accessible via HTTP(S) anyway, just DNS. It runs a small DNS server which answers to _acme-challenge.* requests "forwarded" via CNAME. As that is the only part of is visible to the rest it has a very small security surface to worry about. It then pushes out the keys & certs to the places that need them (directly in the case of local machines, less directly for some others). I set that up originally for a wildcard, as http validation is not supported for them and I didn't fancy mucking about automating updating the main bind instances, but it is convenient for the others too and will be unaffected by these changes. Not a perfect solution for everyone of course, copies of all the keys are in one place for one thing, and it all in one place could be bad or good for maintenance (single point of failure, but single service to monitor & maintain), but worth considering if you expect problems with http validation. > some countries and their IP ranges just need not access my server I'm guessing that they won't be using locations that are commonly blocked in this way anyway. And if they do happen to use one, you may be fine as only two of the three external checks need to be responded to.
- nomercy400 7y agoI've read about this a few times now, but have been unable to find a good resource on how to set such a VM up. Do you have a link or resource somewhere so that I can at least get started? Still unexperienced with letsencrypt, but I know enough that I cannot use the standard way.
- movedx 7y agoI think what they're doing here is running a DNS server on a VM that only answers to requests for specific ACME address prefixes. Then at the actual domain, say example.com, they may ask for cool.example.com but it's a CNAME record that directs to something the DNS server is authority over, say xyz.io or something along those lines. Therefore ACME's DNS request for checking via DNS validation is validated directly by the tiny DNS server due to the CNAME record directing traffic to it. I've never done this my self neither, but I think it would be along those lines.
- throw0101a 7y ago
- sergiotapia 7y agoI’m with you I have China completely blocked from my servers. There is no reason for anyone in that country to access my apis
- jlgaddis 7y agoRecently, the U.S. government accused four Chinese nationals in the Equifax hack. The U.S. says they made us of something like 34 servers in 20 countries to carry out the attack. Do you really think you're stopping anyone in .cn who wants to actually connect to your server from doing so? Proxies and botnets are a thing.
- sergiotapia 7y agoI don't care - my country block is a two second thing that cuts off the vast majority of regular people hitting my server.
- Avamander 7y ago"Limiting attack surface" is also a thing. Claiming there's no benefit is empirically false.
- cm2187 7y agoYou could just loosen the firewall for a few minutes before and after you requested DNS validation.