Commit Graph

659 Commits

Author SHA1 Message Date
Brian Cunnie
b497beddd2 Deprecate custom listLocalIPCIDRs()
We don't need a custom `listLocalIPCIDRs()`; Golang now has a builtin:
`net.InterfaceAddrs()`. [0]

This is one of those wonderful commits that removes more lines than it
adds.

[0] https://pkg.go.dev/net#InterfaceAddrs
2024-12-03 11:21:06 -05:00
Brian Cunnie
0fc3c81641 Replace ambiguous metric, "Answered Queries"
I've always been uncomfortable with the metric "Answered Queries" — it
implies that we don't answer all the queries. But we do answer all the
queries!

What the metric meant is "the number of DNS responses that we send that
have one or more records in the ANSWER section".

The new metric is "Answer ≥ 1". Not great, but better than before.
2024-11-19 09:25:10 -08:00
Brian Cunnie
3ed466bc74 Placate the linter
- check for errors when I was previously skipping them
- use module `time` better

Drive-by: Shorter way to copy the new `index.html` to the 5 servers.
2024-11-17 07:22:37 -08:00
Brian Cunnie
8c89816eeb 🐞 ns.sslip.io → +ns-hetzner, -ns-azure
When I had introduced ns-hetzner, I forgot to update the records for
ns.sslip.io, which continued to point to the old, deprecated ns-azure.

This commit updates the ns.sslip.io records.
2024-11-17 06:54:33 -08:00
Brian Cunnie
cb2424ac2a web page: +ns-hetzner, -ns-azure
- remove the alert about not using the sslip.io nameservers as
  general-purpose nameservers — I feel if they're looking at the page,
  they already know enough not to use the nameservers as recursive
  nameservers.
- deprecate ns-azure.
- extend the shutdown to 12/25 for ns-aws & ns-azure
- add a shoutout to Let's Encrypt
2024-11-16 20:02:14 -08:00
Brian Cunnie
1eab46ca7c index.html; use VS Code to format, not tidy
`tidy`, a UNIX-based HTML-formatter, has had its day in the sun, but
with the advent of VS Code, which I'll be using often to modify the
HTML, it makes more sense to format within the editor rather than in a
separate terminal window.
2024-11-16 19:05:41 -08:00
Brian Cunnie
1da3b67af2 3.2.4: Introduce new nameserver, ns-hetzner.sslip.io 3.2.4 2024-11-16 17:26:04 -08:00
Brian Cunnie
30d51c3014 Update SOA to 11/15
Jon Penn's birthday; probably the most life-changing birthday party I've
ever been to.
2024-11-16 16:09:43 -08:00
Brian Cunnie
ce852009c5 "ns-azure is dead, long live ns-hetzner"
The nameserver on Azure is probably my least-favorite: much slower, much
higher latency. Even though it would've made more geographic sense to
dismantle my GCP nameserver in favor of the Hetzner, I'm using this
opportunity to get rid of the Azure.

And, of course, introduce the Hetzner nameserver with its 20TB of
bandwidth allowance, which I've come to need.
2024-11-16 16:02:25 -08:00
Brian Cunnie
f6c3fca560 Heck, let's dedicate the entire service to Roopinder
It feels lonely not having him around.
2024-11-11 08:40:28 -08:00
Brian Cunnie
1ed661419b Let's dedicate this to Roopinder 2024-11-11 08:37:53 -08:00
Brian Cunnie
680fa3d8f3 Schedule de-commissioning of ns-aws
It costs too much.
2024-11-11 07:48:50 -08:00
Brian Cunnie
7a26f40ee6 Warn white labellers to update their NS servers
ns-aws.sslip.io is deprecated.

Drive-by: used absolute paths in the description of how I can use the
logs.
2024-11-07 17:41:14 -08:00
Brian Cunnie
ad91ae880e DEVELOPER instructions: corrected wrong comments 2024-11-07 07:17:36 -08:00
Brian Cunnie
c6c5435e4a 3.2.3: ns-aws is no longer an NS for sslip.io 3.2.3 2024-11-04 18:14:17 -08:00
Brian Cunnie
ef731f067d Update SOA to 11/5
The late, great Tom Casey's birthday
2024-11-04 18:05:37 -08:00
Brian Cunnie
ab78120615 Bump dependencies go get -u -t; go mod tidy 2024-11-04 18:02:33 -08:00
Brian Cunnie
34318bbb43 Retire DNS server, ns-aws.sslip.io
The torrent of traffic I'm receiving has caused my AWS bill to spike
from $9 to $148, all of the increase due to bandwidth charges.

I'm still maintaining ns-aws; the VM still continue to run, and continue
to serve web traffic, and maintain its hostname and IP addresses;
however, it will no longer be in the list of NS records for sslip.io.

There are much less expensive hosting providers. OVH is my current
favorite.
2024-11-04 17:56:03 -08:00
Brian Cunnie
1f7a54db73 Revert "Introduce new flag, -max_queries_per_sec"
Rather than bloating the code with yet another flag, one that only I
would use, and in only one specific case (ns-aws.sslip.io), it would be
better to simply take ns-aws.sslip.io out of the NS list.
2024-11-04 07:16:52 -08:00
Brian Cunnie
9c8712578d Introduce new flag, -max_queries_per_sec
I'm being gouged by bandwidth costs by AWS. Last month's bill was $148,
and all but $9 was about bandwidth.

My bandwidth has been inexplicably climbing since February:

Billing
Month   Total GB % increase

2024/2		  37.119
2024/3		  52.953	42.66%
2024/4		  58.745	10.94%
2024/5		  69.307	17.98%
2024/6		 173.371	150.15%
2024/7		 334.064	92.69%
2024/8		 539.343	61.45%
2024/9		 568.745	5.45%
2024/10	1365.305	140.06%

The new flag will allow me to throttle the AWS bandwidth to ~287 queries
/ second, which, according to my calculations, will max out the free
100 GB bandwidth without dipping into the for-pay bandwidth.
2024-11-03 17:35:46 -08:00
Brian Cunnie
078a69f75e 3.2.2: Join the Public Suffix List 3.2.2 2024-10-08 18:53:08 -07:00
Brian Cunnie
dea655a990 TXT record attests ownership for the Public Suffix List
We want to place sslip.io on the Public Suffix List so we don't need to
pester Let's Encrypt for rate limit increases.

According to https://publicsuffix.org/submit/:

> owners of privately-registered domains who themselves issue subdomains
to mutually-untrusting parties may wish to be added to the PRIVATE
section of the list.

References:

- https://publicsuffix.org/
- https://github.com/publicsuffix/list/pull/2206

[Fixes #57]
2024-10-08 18:08:59 -07:00
Brian Cunnie
39d876079c Update SOA to 10/8
Lucy's birthday.
2024-10-08 09:09:24 -07:00
Brian Cunnie
705c50b70e Bump dependencies go get -u -t; go mod tidy 2024-10-08 09:06:54 -07:00
Brian Cunnie
8eb5d82e83 Who is querying us the most? 2024-09-23 07:20:21 -07:00
Brian Cunnie
d0c3927415 3.2.1: Return NS records in random order 3.2.1 2024-09-17 06:34:32 -07:00
Brian Cunnie
63a2be439e Return NS records randomly
Previously when the NS records were returned, ns-aws was always returned
first. Coincidentally, 64% of the queries were directed to ns-aws. And
once I exceeded AWS's 10 TB bandwidth limit, AWS began gouging me for
bandwidth charges, and $12.66/month rapidly climbed to $62.30

I'm hoping that by randomly rotating the order of nameservers, the
traffic will balance across the nameservers.

Current snapshot (already ns-ovh is helping):

ns-aws.sslip.io
"Queries: 237744377 (1800.6/s)"
"Answered Queries: 63040894 (477.5/s)"

ns-azure.sslip.io
"Queries: 42610823 (323.4/s)"
"Answered Queries: 14660603 (111.3/s)"

ns-gce.sslip.io
"Queries: 59734371 (454.1/s)"
"Answered Queries: 17636444 (134.1/s)"

ns-ovh.sslip.io
"Queries: 135897332 (1034.4/s)"
"Answered Queries: 36010164 (274.1/s)"
2024-09-17 06:27:53 -07:00
Brian Cunnie
c4310ebb86 3.2.0: Introduce new nameserver, ns-ovh.sslip.io 3.2.0 2024-09-15 17:45:01 -07:00
Brian Cunnie
6855598f0f Introduce new name server, ns-ovh.sslip.io
- located in Warsaw, Poland
- IPv4: 51.75.53.19
- IPv6: 2001:41d0:602:2313::1

The crux of this is to take the load off ns-aws, which jumped from
$12.66 → $20.63 → $38.51 → $62.30 in the last four months due to
bandwidth charges exceeding 10 TB.

The real fix is to randomize the order in which the nameservers are
returned.
2024-09-15 17:21:16 -07:00
Brian Cunnie
afe851a867 Dismantle DNS-backed key-value store, k-v.io
I'm no longer engaged on setting up k-v.io; I thought it'd be cool to
have a DNS-backed etcd implementation, but now I don't care anymore.

There were technical challenges, too: Specifically, updating values did
not play well with DNS caching — you'd get the old value after updating.

If the service became popular, I'd quickly run out of disk space on my
tiny cloud VMs.

The service would most likely be used by people doing data exfiltration
via DNS. I already have enough problems with sslip.io scammers — the
last thing I want is to sign up for dealing with k-v.io scammers.

This commit removes the etcd configuration, certificates, and pipelines.
2024-09-15 07:30:57 -07:00
Brian Cunnie
450fc67a57 Prune unused default.json
I had big plans for feeding in the configuration of the DNS server with
a JSON file, but since then I've come to consider command-line flags
good enough, so there's no reason to leave this useless file lingering —
it'll only server to confuse.
2024-09-15 06:54:43 -07:00
Brian Cunnie
4111f7c1ba Update SOA to 9/15
In preparation of adding a new nameserver, ns-ovh.sslip.io
2024-09-15 06:48:45 -07:00
Brian Cunnie
76d27df591 Bump dependencies go get -u -t; go mod tidy 2024-09-15 06:44:49 -07:00
Brian Cunnie
ba85d1aacf 🐞 Remove incorrect -delegates warning
fixes, when server is started with `-delegates` unset:

```
-delegates: arguments should be in the format "delegatedDomain=nameserver", not ""
```
2024-07-04 05:47:45 -07:00
Brian Cunnie
74a5c2edfd Bump Ruby 3.1 → 3.3 (for rspec) 2024-06-17 06:22:42 -07:00
Brian Cunnie
1ec255123f A first-class page about blocked sites
We warn people that they're scammers.
2024-06-16 11:55:00 -07:00
Brian Cunnie
48dd9269f9 Placate the linter
- `ip.String()` → `ip` might be nil

Drive-bys:

- better documentation for NameToA() and NameToAAAA()
- better naming: public → allowPublicIPs
2024-06-15 20:23:16 -07:00
Brian Cunnie
093fc5dadf Appease/placate/mollify the linter
- Unnecessarily handle the error in the `defer`
- Do a better comparison of the address-in-use error
2024-06-15 18:49:18 -07:00
Brian Cunnie
8a08e49034 Flag -delegates for delegated domains
Meant for obtaining wildcard certs from Let's Encrypt using the DNS-01
challenge.

- introduce a variant of `blocklist.txt` to be used for testing
  (`blocklist-test.txt`) because the blocklist has grown so large it
  clutters the test output
- more rigorous about lowercasing hostnames when matching against
  customized records. This needs to be extendend when we parse _any_
  arguments

TODOs:

- remove the wildcard DNS servers
- update instructions
2024-06-08 19:40:09 -07:00
Brian Cunnie
d52d97f478 Bump dependencies go get -u -t; go mod tidy 2024-06-08 16:16:40 -07:00
Brian Cunnie
1a42b85926 Warn developers to not index their sites
The sslip.io service has been abused by scammers and phishers who create
sites that masquerade as legitimate sites. For example,
<https://nf-43-134-66-67.sslip.io/sg> masqueraded as Netflix.

To combat this, we've undertaken to block all sites that masquerade as a
legitimate sites, but this had the unfortunate consequence of ensnaring
a legitimate staging site (th-ab.de).

This commit assists developers by updating the documentation to warn
developers not to index their staging site.

[#53]
2024-05-29 08:27:28 -07:00
Brian Cunnie
bce9e3971b 🐞 Fix broken paths caused by moving code
When we promoted the Golang code to the root of the repo, we neglected
to update the paths in the documentation, helper scripts, and pipelines.

This commit addresses that oversight by updating the paths.
2024-05-11 10:54:54 -07:00
Brian Cunnie
2fe81195d7 The BOSH Release is dead
The last BOSH Release was cut over two years ago (Feb 26, 2022), and I
don't think we're ever gonna cut another one, so I'm clearing out the
BOSH-related files.

I deployed to BOSH until I decided k8s was the way to go, and then later
decided to deploy to standalone VMs
2024-05-11 10:20:56 -07:00
Brian Cunnie
1bdd03fd39 Promote Golang code to the root of the repo
- That's where the code is expected to be
- The only reason the code was buried two directories down was because
  it was originally a BOSH release
- There hasn't been a BOSH release in over two years; last one was Feb
  26, 2022
- Other than a slight adjustment to the relative location of
  `blocklist.txt` file in the integration tests, there were no other
  changes
2024-05-11 10:14:23 -07:00
Brian Cunnie
9a238f4165 Bump dependencies 2024-05-11 06:24:56 -07:00
Brian Cunnie
758006e66b Update SOA to the Cinquo de Mayo (5/5)
Also, the date of the celebrated "Five Coves of Death" swim.
2024-05-07 06:29:51 -07:00
Brian Cunnie
fc4ecd6018 -public flag controls resolution of public IPs
Companies who run their own sslip.io DNS nameservers may want to restrict
the resolution of public IPs to mitigiate bad actors from impersonating
them. For example, the corporation Pivotal, which owns the domain
pivotal.io, may want to set `-public=false` when they delegate the
domain `xip.pivotal.io` to their internal instances of sslip.io
nameservers, which enables their developers to use their internal IPs
(e.g. 10-9-9-31.xip.pivotal.io) while preventing a bad actor from using
a public IP (e.g. 52-0-56-137.xip.pivotal.io) to trick users.

- `-public` defaults to `true`
- `-public=true` enables resolution of all hostnames with embedded IP
  addresses
- `-public=false` restricts resolution to hostnames with private IP
  addresses

The following ranges are not considered public and always resolve:

- 10/8, 172.16/12, 192.168/16 — RFC 1918
- fc/7                        — RFC 4193
- 100.64/10                   — CG-NAT
- 127/8, ::1                  — loopback
- 169.254/16                  — IPv4 link local
- fe80/10                     — IPv6 link local
- 64:ff9b:1/48                — IPv4/IPv6 translation private internet
- 2001:20/28                  — ORCHIDv2
- 2001:db8/32                 — Documentation
2024-05-07 06:29:17 -07:00
Brian Cunnie
75ba5b62f4 ns-gce has an IPv6 address
- This IPv6 address is "ephemeral" in the sense that if a `terraform
  destroy` and `terraform apply` are run I'll get a different address
  (not `2600:1900:4000:4d12::`)
- I don't plan on updating the WHOIS information because the address is
  somewhat ephemeral
2024-03-09 10:39:48 -08:00
Brian Cunnie
a442a7d368 Release Procedure: Include GCP
Previously the GCP NS was a k8s container, but now it's a standalone VM
(for, believe it or not, cost reasons: it was cheaper to assign a static
IP to a VM than to a load balancer).

The instructions now include the procedure to update the GCP VM.

Also, we double-checked that all servers had the same version number
twice, and now we only do it once. And we incorporate it with another
step, so there are two fewer steps to follow.
2024-03-09 08:15:00 -08:00
Brian Cunnie
27d7f4bcd6 3.1.0: Shorten TTL for publicly-accessible A & AAAA records 3.1.0 2024-03-09 07:20:50 -08:00