Commit Graph

39 Commits

Author SHA1 Message Date
Brian Cunnie
27d7f4bcd6 3.1.0: Shorten TTL for publicly-accessible A & AAAA records 2024-03-09 07:20:50 -08:00
Brian Cunnie
aacd566ab4 3.0.0: enable TCP binding in addition to UDP 2023-10-04 08:07:03 -07:00
Brian Cunnie
3e688e61de dns-servers test: remove key-value tests
We are no longer doing key-value-over-DNS.

Fixes <https://ci.nono.io/teams/main/pipelines/sslip.io/jobs/dns-servers/builds/1097>
```
rspec './spec/check-dns_spec.rb[1:17:1]' # sslip.io k-v.io tested on the ns-aws.sslip.io. nameserver sets a value, 1678804743, on the key sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:17:2]' # sslip.io k-v.io tested on the ns-aws.sslip.io. nameserver gets the newly-set value, 1678804743, from the key, sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:33:1]' # sslip.io k-v.io tested on the ns-azure.sslip.io. nameserver sets a value, 1678804743, on the key sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:33:2]' # sslip.io k-v.io tested on the ns-azure.sslip.io. nameserver gets the newly-set value, 1678804743, from the key, sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:49:1]' # sslip.io k-v.io tested on the ns-gce.sslip.io. nameserver sets a value, 1678804743, on the key sslipio-spec.k-v.io
rspec './spec/check-dns_spec.rb[1:49:2]' # sslip.io k-v.io tested on the ns-gce.sslip.io. nameserver gets the newly-set value, 1678804743, from the key, sslipio-spec.k-v.io
```
2023-03-14 10:40:04 -04:00
Brian Cunnie
451ad0ef5f 2.7.0: remove key-value store 2023-03-13 16:46:20 -04:00
Brian Cunnie
776fe532ce 2.6.2: -quiet suppresses logs for each query 2022-11-26 13:55:38 -08:00
Brian Cunnie
262a1e0ea1 2.6.1: -addresses flag enables custom addresses 2022-11-11 10:48:37 -08:00
Brian Cunnie
6363636c21 Hygeine: Ruby: Use shorter regexps
`[0-9]` → `\d`, `[0-9a-f]` → `[[:xdigit:]]`

A follow on to the previous commit, which did the same for Golang.

Ruby supports the above matchers like Golang does:
<https://ruby-doc.org/core-3.1.2/Regexp.html>
2022-07-22 12:47:14 -04:00
Brian Cunnie
f598bb52c7 Version 2.6.0: PTR records for IPv4 & IPv6 2022-07-14 18:34:40 -07:00
Brian Cunnie
50d843a16a Version 2.5.4: .acme_challenge.k-v.io isn't settable 2022-04-30 16:42:35 -07:00
Brian Cunnie
4d339cd861 Version 2.5.3: k-v.io is operational 2022-04-22 14:33:47 -07:00
Brian Cunnie
19668fac7f CI: rigorously test k-v.io
We make sure that each of the three nameservers
(ns-{aws,azure,gce}.sslip.io) can set a key-value, that the value
propagates to the remaining nameservers, that a nameserver can delete a
key, and that the deletion propagates to the remaining nameservers.
2022-04-20 16:48:50 -07:00
Brian Cunnie
294f54a79a Version 2.5.2: DELETE on k-v.io returns no TXT records
The original behavior was to return the deleted record, which
inadvertently prolonged the lifetime (in DNS cache) of the record which
was meant to expire as soon as possible.

- Removed the instructions to create a BOSH release. We are no longer
  creating a BOSH release because we needed to colocate an etcd release
  alongside the BOSH release, and we couldn't find an etcd BOSH release.
- Updated the instructions to run a quick test against the sslip.io DNS
  server locally (sanity check) instead of deploying a VM with the BOSH
  release & testing against that.
- Updated the instructions for updating ns-azure's DNS server. ns-azure
  is no longer a BOSH-deployed VM.
2022-04-13 12:55:34 -07:00
Brian Cunnie
2a0e6b105d Health checks conform to new key-value delete behavior
When we check the production servers, we now expect, when we delete a
key, to NOT receive the key's old value as a response, lest we
inadvertently extend the lifetime of the key that we want to expire.
2022-04-13 08:35:21 -07:00
Brian Cunnie
cd2b14b924 BOSH release: 2.5.1: block phishers with CIDRs 2022-02-26 16:41:05 -08:00
Brian Cunnie
51ed47317e BOSH release: 2.5.0: block phishers 2022-02-06 19:51:06 -08:00
Brian Cunnie
8f2890d90e BOSH release: 2.4.2: fix panic() 2022-01-22 09:41:49 -08:00
Brian Cunnie
c61b81c29b Server tests: update for new endpoints
fixes:
<https://ci.nono.io/teams/main/pipelines/sslip.io/jobs/dns-servers/builds/271>
2022-01-20 09:50:58 -08:00
Brian Cunnie
bbf1925be4 BOSH release: 2.4.1: fewer panics
customized records w/ non-existent TXTs don't panic().
2022-01-20 08:10:03 -08:00
Brian Cunnie
e215c4fda4 🐞 Don't panic() invoking a customized TXT
We made a mistake: we blindly invoked a function that was sometimes
`nil`. Specifically, if we had a customized domain (e.g. `ns.sslip.io`)
that didn't have a TXT record (a function), we'd try to invoke it
anyway. Bad move.

Now we ensure the function is there before we try to invoke it.

This is a curious affirmation of installing metrics: if we hadn't seen
that the server had been restarted because uptime was too low, we
wouldn't have caught this bug.

Drive-by: we made the lengths of TXT records of `version.status.sslip.io`
exactly match what we replace them with during the linking phase. We
hope that this fixes the wrong-line-numbers we see in the `panic()`
messages.

[fixes #14]
2022-01-20 07:47:48 -08:00
Brian Cunnie
b119442a37 BOSH release: 2.4.0: metrics.status.sslip.io returns metrics
Also, I moved the "versio" endpoint: `version.sslip.io` →
`version.status.sslip.io`. It seemed to make more sense to corral the
special endpoints under `status`.
2022-01-20 05:02:21 -08:00
Brian Cunnie
30141f1d90 CI: Test key-value store regularly 2021-12-04 10:31:12 -08:00
Brian Cunnie
bd63421c3f BOSH release: 2.3.0: kv.sslip.io key-value store 2021-12-04 08:16:53 -08:00
Brian Cunnie
90b94baa29 BOSH release: 2.2.4: Deprecate nono.io nameservers 2021-11-28 13:08:49 -08:00
Brian Cunnie
4e22123114 BOSH release: 2.2.3: Include sslip.io nameservers 2021-11-27 11:35:01 -08:00
Brian Cunnie
854d8e8c1b Spec: test ip.sslip.io
Also, change the order of `dig` arguments so that the server being
queried is first (e.g. `@#{whois_nameserver}`) and the arguments (e.g.
`+short`), is last.
2021-11-05 08:10:39 -07:00
Brian Cunnie
1d4e1af656 Production test: all servers run same version 2021-11-02 05:02:46 -07:00
Brian Cunnie
a37bbc150c CI: check sslip.io's A & AAAA records, and website
- The impetus? I deployed a custom webserver but forgot to add the
  A & AAAA records for sslip.io, so the website disappeared.
- I now check for the A & AAAA records (to be present, but not of any
  particular value because that gives me the latitude to migrate to
  other machines).
- I also check that the website is responsive.
- drive by: removed hard-coding of `sslip.io` in many tests; instead we
  now query the domain that the env var `DOMAIN` is set to.
2020-12-01 10:01:08 -08:00
Brian Cunnie
09249be0a0 CI: don't double-count the nameservers
On macOS, `whois` returns _two_ results for the domain `sslip.io` from
two different whois servers:

- whois.nic.io
- whois.namecheap.com

This means that every nameservers is double-counted. To fix, we remove
the duplicates.

fixes:
```
     Failure/Error: expect(dig_nameservers.sort).to eq(whois_nameservers.sort)

       expected: ["ns-aws.nono.io.", "ns-aws.nono.io.", "ns-azure.nono.io.", "ns-azure.nono.io.", "ns-gce.nono.io.", "ns-gce.nono.io."]
            got: ["ns-aws.nono.io.", "ns-azure.nono.io.", "ns-gce.nono.io."]

       (compared using ==)
     # ./spec/check-dns_spec.rb:44:in `block (3 levels) in <top (required)>'
```
2020-12-01 09:22:24 -08:00
Brian Cunnie
06f1556699 Revert "dig shouldn't bomb-out if forbidden hyphen is used"
DiG 9.10.6 no longer has the `+noidn` option, and `dig` will error if we
try to use it.

fixes:
```
dig +short +noidnin ns sslip.io @ns-azure.nono.io.
Invalid option: +noidnin
```

And this previously-invalid dig query now works, so we don't need the
option anyway:
```
dig +short AAAA api.--.sslip.io
::
```

This reverts commit a2564c12d3.
2020-12-01 09:17:08 -08:00
Brian Cunnie
a2564c12d3 dig shouldn't bomb-out if forbidden hyphen is used
Yes, according to the RFC it shouldn't begin with a hyphen. And, since
we're on the topic, underscores were supposed to be off the table, too,
but Microsoft used them anyway, and you know what? We're gonna use the
"forbidden hyphen". And we're gonna instruct `dig` to not be so
persnickety.

fixes:
```
dig +short  AAAA api.--.sslip.io
dig: idn2_lookup_ul failed: string start/ends with forbidden hyphen
```

I had to make it work for old-style (e.g. macOS dig) which is version
"DiG 9.8.3-P1" as well as for the new version ("DiG
9.11.3-RedHat-9.11.3-6.fc28") which has this new
[library](https://www.gnu.org/software/libidn/libidn2/reference/libidn2-idn2.html)
which does the following:

> Perform IDNA2008 lookup string conversion on domain name src , as described in section 5 of RFC 5891
2018-05-23 20:03:34 -07:00
Brian Cunnie
859107de14 🐞 Don't test resolution of Google's IPv6 DNS server twice
Instead, test one of my IPs.
2017-12-10 07:18:16 -08:00
Brian Cunnie
2642344d44 Test FQDNS -> IPv6 addresses 2017-12-10 06:27:58 -08:00
Brian Cunnie
3844f98c28 Unit tests show which command is being run
- helps me troubleshoot; I get lost at times.
- README shows more verbose variant of rspec
2017-09-21 06:01:10 -07:00
Brian Cunnie
a549b5b74d Nameservers should be lowercased
fixes:
```
nameserver NS-AZURE.NONO.IO.'s NS records match whois's ["NS-AZURE.NONO.IO.", "NS-AWS.NONO.IO.", "NS-HE.NONO.IO.", "NS-GCE.NONO.IO."] (FAILED - 1)
```
2017-07-05 13:57:42 -07:00
Brian Cunnie
e779757527 Adjust to new whois format:
- previously Name Server line began with "NS"
- now they begin with "Name Server"
- fixed typo

fixes:
```
1) sslip.io should have at least 2 nameservers
   Failure/Error: expect(whois_nameservers.size).to be > 1

     expected: > 1
          got:   0
   # ./sslip.io/spec/check-dns_spec.rb:37:in `block (2 levels) in <top (required)>'
```
2017-07-01 06:38:16 -07:00
Brian Cunnie
f4c93f3ed9 check for non-sslip.io domains
- fixed bug where SOA wasn't checked properly
- put comment on top so I can run tests locally more easily
2016-10-23 11:35:15 -07:00
Brian Cunnie
8597afdc06 Tests a more complex and random hostname 2016-09-09 13:29:29 -07:00
Brian Cunnie
d80ce16748 Test core fucntion of sslip.io
- w-x-y-z.sslip.io resolves to w.x.y.z
2016-09-09 06:27:41 -07:00
Brian Cunnie
5c5d7ae5ec use RSpec, not a custom bash script
Admittedly it's overkill to use RSpec to run a set of assertions against
a DNS server -- a simple shell script would have been shorter and more
understandable. We are using RSpec merely to practice using RSpec.

Also, RSpec is not quite appropriate because we're not testing a Ruby
class. In fact, we're not test Ruby code at all. So we should not be
using RSpec. Just sayin'.
2016-09-05 05:16:51 -07:00