Your one-stop-cake-shop for everything Freshly Baked has to offer

feat(pm): block missing nginx host connections #98

closed opened by a.starrysky.fyi targeting main from private/minion/push-zoqyltwplryx

We previously returned One Of The Websites when nginx was accessed from a host that we didn't know about. That included direct IP address access as well as things which have been CNAMEd to us (either through a starred record or due to past services) but which aren't actually hosted by us.

This leads to a number of undesireable effects:

  • User confusion ("why does the aux docs website have Stalwart?")
  • Incorrect SSL certificates ("your blog seems to have an invalid certificate")
  • SSL being offered via direct IPs, which isn't possible to sign on the public internet

We can block this by making a default server to take control whenever nothing matches, and setting that default server to block all connections and reject all SSL handshakes

We need to have a certificate for this, but it needn't actually be valid for anything so let's self sign stuff...

Labels

None yet.

requested-reviewers

None yet.

approved

None yet.

tested-working

None yet.

rejected

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:uuyqs6y3pwtbteet4swt5i5y/sh.tangled.repo.pull/3m3k5g5qfgx22
+10 -8
Interdiff #4 #5
+10 -8
packetmix/systems/common/nginx.nix
··· 2 2 # 3 3 # SPDX-License-Identifier: MIT 4 4 5 - { lib, ... }: 5 + { config, lib, ... }: 6 6 { 7 7 # By default, nginx will serve a "best-effort" site even if there is no matching vhost 8 8 # We can disable this by making a matching vhost and returning 444... ··· 30 30 }; 31 31 32 32 security.acme.acceptTerms = true; 33 - security.acme.certs."missinghost.invalid" = { 34 - dnsProvider = null; 35 - listenHTTP = null; 36 - s3Bucket = null; 37 - webroot = "/dev/null"; 38 - email = "invalid@missinghost.invalid"; 39 - }; # Nix requires some values, even if we're actually disabling the acme-missinghost.invalid service... that's problematic if there are no defaults for the system 33 + security.acme.certs = lib.mkIf config.services.nginx.enable { 34 + "missinghost.invalid" = { 35 + dnsProvider = null; 36 + listenHTTP = null; 37 + s3Bucket = null; 38 + webroot = "/dev/null"; 39 + email = "invalid@missinghost.invalid"; 40 + }; # Nix requires some values, even if we're actually disabling the acme-missinghost.invalid service... that's problematic if there are no defaults for the system 41 + }; 40 42 }
packetmix/systems/umber/grocy.nix

This file has not been changed.

packetmix/systems/umber/silverbullet.nix

This file has not been changed.

History

8 rounds 1 comment
sign up or login to add to the discussion
5 commits
expand
feat(pm): block missing nginx host connections
feat(pm/umber): clean up silverbullet SSL
feat(pm/umber): init grocy
feat(pm/umber): add copyparty
feat(pm/umber): enable RAID
5/5 success
expand
expand 1 comment

resubmitting as stacked PRs - and post- some tangled fixes for CI

closed without merging
3 commits
expand
feat(pm): block missing nginx host connections
feat(pm/umber): clean up silverbullet SSL
feat(pm/umber): init grocy
1/5 failed, 4/5 success
expand
expand 0 comments
3 commits
expand
feat(pm): block missing nginx host connections
feat(pm/umber): clean up silverbullet SSL
feat(pm/umber): init grocy
1/5 failed, 4/5 success
expand
expand 0 comments
3 commits
expand
feat(pm): block missing nginx host connections
feat(pm/umber): clean up silverbullet SSL
feat(pm/umber): init grocy
5/5 success
expand
expand 0 comments
3 commits
expand
feat(pm): block missing nginx host connections
feat(pm/umber): clean up silverbullet SSL
feat(pm/umber): init grocy
1/5 failed, 4/5 success
expand
expand 0 comments
3 commits
expand
feat(pm): block missing nginx host connections
feat(pm/umber): clean up silverbullet SSL
feat(pm/umber): init grocy
1/5 failed, 4/5 success
expand
expand 0 comments
3 commits
expand
feat(pm): block missing nginx host connections
feat(pm/umber): clean up silverbullet SSL
feat(pm/umber): init grocy
1/5 failed, 4/5 success
expand
expand 0 comments
3 commits
expand
feat(pm): block missing nginx host connections
feat(pm/umber): clean up silverbullet SSL
feat(pm/umber): init grocy
expand 0 comments