• 0 Posts
  • 6 Comments
Joined 2 years ago
cake
Cake day: June 30th, 2023

help-circle

  • my router and my reverse proxy (traefik) is able to receive the necessary SSL/TLS certificates however

    From something like LetsEncrypt?
    As an HTTP-01 Challenge? Not an DNS-01 challenge?
    Http challenge means that port 80 is accessible from the public internet (because that’s how LE can confirm it can reach your server via the public DNS records, proof of server ownership).
    DNS-01 is about proof of DNS record ownership, and doesn’t prove public internet access.

    Also, what are you self hosting?
    Does it really need to be publicly accessible? Or just accessible by you and people you trust?


  • You need to control a domain, so LE can verify you are the controller of the domain, then LE will issue you a certificate saying you are the controller of the domain.

    For a wildcard LE cert, you need to use the DNS challenge method.
    Essentially the ACME client (or certbot or whatever) will talk to LE and say “I want a DNS challenge for *.example.com”.
    LE will reply “ok, your order number 69, and your challenge code is DEADBEEF”.
    ACME then interacts with your public nameserver (or you have to do this manually) and add the challenge code as a txt record _acme-challenge.example.com. (I’ve been caught out by the fact LE uses Google DNS for resolution, and Google will only follow 1 level of NS records from the root authorative nameserver).
    All the while, LE is checking for that record. When it finds the record, it mints a wildcard certificate.
    ACME then periodically checks in with LE asking for order 69. Once LE has minted the cert, it will return it to acme.
    And now you have a wildcard cert.

    So, how to use it on a local domain?
    Use a split horizon DNS method.
    Ensure your DHCP is handing out a local DNS for resolving.
    Configure that local DNS to then use 8.8.8.8 or whatever as it’s upstream.
    Then load in static/override records to the local DNS.
    Pihole can do this. OPNSense/pfSense can do this. Unifi can do some of this.

    How does this work?
    Any device on your network that wants to know the IP of example.example.com will ask it’s configured DNS - the local DNS that you have configured.
    The local DNS will check it’s static assignments and go “yeh, example.example.com is 10.10.3.3”.
    If you ask you local DNS for google.com, it won’t have a static assignment for it, so it will ask it’s upstream DNS, and return that result.
    And it means you aren’t putting private IP spaces on public NS records.

    Then you can load in your wildcard cert to 10.10.3.3, and you will have a trusted HTTPS connection.

    Here is a list of LE clients that will automate LE certs.
    https://letsencrypt.org/docs/client-options/

    Have a read through and pick your desired flavour.
    Dig into the docs of that flavour, and start playing around.

    If it’s all HTTPS, consider using something like Nginx Proxy Manager (https://nginxproxymanager.com/) as a reverse proxy in front of your services and for managing the LE cert.
    It’s super easy to use, has a decent GUI, and then it’s only 1 IP to point all DNS records to.


  • DNS and domains are just human-friendly IP addresses.

    You only have 1 public IP address.
    So, to access different services you need to use different ports.
    Or run a service on a single port in front of the other services that can understand the connections and forward the connections to the actual services - known as a reverse proxy. In the case of http/https, there are plenty of reverse proxies that can direct requests based on all sorts of parameters, subdomains being one of them.

    If you are just starting out, I’d recommend a docker compose stack and Nginx Proxy Manager.
    Learning containers & docker makes everything easier.
    NPM is a very easy to use reverse proxy with a nice GUI, so you don’t have to configure CertBot/ACME or learn the specific config language of Nginx.

    If you are unsure of domains and all that, you can try it out for free.
    Your computer has a hosts file (/etc/hosts on Linux, I think it’s in system32 on windows). This allows you to tell the computer “for the domain example.com use the IP 10.0.0.200” or whatever you want. You need a hosts file entry for each subdomain.
    What this means is that you can run up a docker compose stack on your computer and point a bunch of sub domains to 127.0.0.1, use self-signed certs, and play around with nginx proxy manager and docker.
    No money spent, no records published, no traffic leaving your computer.
    Zero risk.

    There are loads of tutorials out there on NPM and docker compose stacks. Probably some close to your specific requirements.


  • Not a lawyer.
    But how to “cover your ass”.

    If pressured to still send a quote with it included, ask your manager to email over the details - ie get it in writing.
    You are looking for them to tell you to include this unprovidable service in the quote as part of the details/instructions.
    IE your manager to tell you to do the unethical thing in writing.
    And respond back along the lines of “as discussed, we can’t provide this service and can’t procure it from the upstream provider. However I will do as instructed and email the quote to the customer with this service included”.
    This is indicating that you have discussed it (ideally save any other emails about this subject).
    If your boss emails back “we haven’t discussed this”, then raise the issue in writing and don’t send the quote until it is resolved by email (if your boss talks to you in person, feel free to send a “follow up” email outlining what you discussed and ask for clarification).
    If your boss emails back “do as you are told”, then do as you are told.
    Save all the emails.

    BCC to a personal account will be seen in server logs. Better to export backups or take screenshots and put them on a USB. Or ZIP them with a password and find a way to exfil them without raising red flags if USB devices are restricted. There are many ways to do this, I’m sure I can suggest some.

    Generally, working under instruction where your pushback might lead to termination generally results in unfair dismissal and settlements.
    Especially if you can prove that you have raised the issue, and still been told to proceed.

    It doesn’t sound like this is a risk-to-life or risk-to-public scenario, so I don’t think “whistle blower” procedures are needed.