An unofficial, read-only Hacker News reader.

AI made self-hosting fun again (opens external site)

1144 points by jlelse 1 day ago | janlukas.blog | 538 comments on HN

View full thread · View on Hacker News

Comment thread (75)

  1. In some ways it's better, in some ways it's worse.

    It's certainly easier than ever to spin up a VPS/cloudflare proxy and deploy. Agents can pretty much do that end to end.

    The bigger issue is you're then accountable for keeping up with security. Previously that meant using fail2ban and running a system update every few months. Now it means patching within 24hrs of a CVE9+ dropping, which is happening at an accelerated rate.

    It got so bad during October I made https://firefighter.sh/ as a joke (a root-permissioned agent that continuously monitors for CVEs and patches your system live as soon as they drop - it's a security nightmare given the nondeterministic aspect of AI), but I'm actually starting to come around to the idea for my non-critical servers.

    Replies (24)
    1. Replies (2)
      1. I have a public ip VPS proxying to my home lab and I’m wondering where to go for the least attack surface if I’m just running caddy and wireguard.

        Fedora CoreOS is an interesting offering, and Debian with unattended updates sounds good too. I like what SELinux can do for hardening the filesystem. Seems like even if a subprocess gets owned you get isolation from siblings.

        Replies (2)
        1. Same setup. I went with Debian. Non standard ssh port, no pass, key only and wireguard. So far so good.
          Replies (1)
          1. You're not gonna get pwned through SSH. You'll get pwned through some random dependency one of your things is using.
            Replies (1)
            1. Is that possible if there are only 2 open ports on the whole machine? Everything else is on the VPN. I think either SSH or WireGuard must have a vulnerability to get pwned.

              Continue this thread (1 replies) →

        2. Fedora IOT on a Raspberry Pi with automatic updates works pretty well too for internal network services (pihole, jellyfin etc)
      2. Unattended upgrades will only patch system packages installed via apt-get. You still need to patch node, python packages, or random software you downloaded and installed (via curl piped to sh).
        Replies (4)
        1. And for some reason these days everyone and their cat wants you to install their software with `curl http://some-sketchy-site.com/install | bash`, even if building packages is easier than ever with LLMs and free Github Actions.
        2. cron + topgrade -y will handle most of the userspace updates.

          `curl | sh` is a whole other ballpark though. that's not managed software, so of course you're going to have to manually update it. do you even remember what you've installed? i don't know how people think this is an acceptable way to install software.

        3. For my needs, to minimize the manual effort, I limit my dependencies to those that come with the default distro repositories. I know it's not possible for each single application one may want to self-host, but there's already a lot that is possible by sticking to the default repos.
        4. If you install these things you lost already…
    2. I have AI craft make files for common operations, patching, deploys etc. The makefiles compose terraform, ansible, misc scripts, DB migrations etc. this way, something reproducible and tested can be "trusted" to let AI operate with without it getting carried away or deep into the weeds on simple shit. Of course, I also use the same makefiles too when I want, and it's just great. Keeps credentials safe-ish, AI doesn't need to SSH itself or even know about the actual systems.
      Replies (3)
      1. If only nixos existed and llms were good at it :)
        Replies (2)
        1. I'm just way more comfortable and used to traditional bare metal, kvm, and k8s via RKE2.
        2. gentoo is far superior in every way :)
          Replies (3)
          1. Are they comparable, though?
            Replies (1)
            1. Not really no. I tend to think everyone should be building their entire stack from source these days. I don't know why these distros with binaries pre-compiled are so popular these days when an LLM can fork it for you at any time. Especially among the Nix crowd. Like why would you want someone else to compile your software? I mean this seriously. Between you and bare metal there's really not that much. Linux kernel? 20 minute compile. Grub2, OpenRC / Systemd / sddm, kde or hyprland w/e, the browser is actually the thing that will take the longest to build. So do it. There's no excuses anymore. You can do it while you sleep.

              Continue this thread (3 replies) →

          2. I use windows, btw
          3. Is it reproduicable though? Can you run nixos-anywhere <host>, then ssh into into it run borg restore and you have same server as you backuped? Doubts
            Replies (1)
            1. Gentoo ebuilds are the original byte for byte immutable build architecture. Have an LLM explain it to you.

              Continue this thread (1 replies) →

      2. LLMs that write and then update your Ansible really is the super combo.

        If you throw in tests that the LLM also writes and it brings together the best of DevOps and LLM.

        Replies (1)
        1. How do you reliably test ansible? I've been vibing ansible deployments at work instead of letting LLMs free roam on servers, but the deployment frequently works only on second or third try. The only way to do testing that I see is run a VM with a replica of the entire infra, which is infeasible for large or mixed legacy deployments...
      3. Allow me to throw in mise-en-place (mise.sh).

        As someone who always loved to do organize projects with Make, mise was an easy upsell for me.

    3. Another massive drawback is the slop-avalanche on self-hosting communication channels.

      I don't mind someone vibing something out for their needs; but as soon as you advertise it and invite external users, I feel there was a moral obligation to provide a certain level of quality and security. Which doesn't seem to be as prevalent now.

      Building out a project used to take a fair amount of investment for the creator; now that producing code is "cheap", that price-to-entry is so low that anyone can spin up a project in a couple of hours.

      It has added a lot of noise to the community channels - making it hard for good projects to stand out among the noise.

      Replies (1)
      1. > It has added a lot of noise to the community channels - making it hard for good projects to stand out among the noise.

        Yeah I agree, I bailed out of most of the community due to this.

    4. Keep it all internal with Tailscale, or use Pangolin (or Cloudflare)
    5. debian + unattended-upgrades + scheduled reboot for kernel upgrades gets you most of the way there
      Replies (1)
      1. probably all the way there
    6. I'm updating my stuff WAY more often with AI. I have an agent check the current version, pull changelogs, look for anything that could go wrong, do a backup, stop, pull, start, verify, then delete backups and dangling containers. Pre AI I did that... basically never. Now I do it once a week. Could even schedule it if I really felt like it.

      Also, I don't put two things on the open internet. My other 2-dozen services are behind Tailscale only.

      Replies (2)
      1. Due to some limitations I cannot use Tailscale - so I started to put my services behind Iroh network. And it goes a bit too much. I even use Iroh on Pocketbook to access torrent served flibusta library service.
      2. Other than “look for anything that could go wrong,” what does AI do here that a script can’t?
    7. Or you can just use wire guard to your router, or tail scale, or cloudflare tunnels and never actually expose the endpoint directly.
    8. > Now it means patching within 24hrs of a CVE9+ dropping

      I know security by obscurity is not a good defense, but if the internet were on IPv6, it would be a lot harder for bots to find hosts by scanning the whole IP space, whereas when I open a port on IPv4 I can always see activity on it almost immediately. I've been watching traffic to IPv6-only hosts despite connecting to them from outside the local network and it's been completely silent from strangers. This would buy extra time for any critical CVE that needs patching.

      Replies (2)
      1. Maybe, but if using https with a public CA then your domain info is already well know. DIY CA not an issue, but has worse caveats imo.
        Replies (2)
        1. Yeah, that's a point worth mentioning, but none of the hosts I connect to have public DNS records pointing to them or use a public CA.
          Replies (2)
          1. Yeah then you’re fine
          2. What do you use for CA? I have an internal network on LetsEncrypt because it's annoying as hell to add special allowances to a couple dozen browsers/etc. Is there a solution you use that improves this?
            Replies (1)
            1. I'm not who you asked, and I'm interested to see if they have a wildly different take. But here's mine:

              For someone who doesn't use public DNS records (and therefore has a more localized way of resolving/bookmarking the IP address), wouldn't they also do just fine using a certificate signed by something manually added to their local trust store? It's only once you have the general public resolving your domain that you also need the general public to easily validate your cert (through a chain that includes a root cert everyone's trust store already contains).

              Do both in public, or do both in private. While overkill and cumbersome, things like Group Policy, MDM, etc. can handle the "I have many devices" issue.

              Or if you're in control of the network E2E (LAN, or VPN with a CA cert) then there is no MITM and therefore no need for TLS.

              Or if something like SSH rather than HTTPS, you've got TOFU instead of PKI.

              Continue this thread (1 replies) →

        2. Often you can get by with wildcard certificate.
      2. Maybe the ASI's first show of force will be to hack the internet and finally push everything to IPv6
    9. > Previously that meant using fail2ban and running a system update every few months. Now it means patching within 24hrs of a CVE9+ dropping, which is happening at an accelerated rate.

      Yeah. This has fully changed my approach to web dev; for me as a solo/freelance developer at this scale, pretty much all interpreted languages are too great a risk in various different ways.

    10. > Previously that meant using fail2ban and running a system update every few months. Now it means patching within 24hrs of a CVE9+ dropping,

      Honestly, most of those issues can be mitigated by NOT exposing your services to the web and instead relying on Wireguard — and I am not mentioning other VPNs here because they, too, are vulnerable with their vast attack surfaces, like OpenVPN.

      In fact I believe all this will lead to better VPN integration in our devices. I REALLY hope Wireguard gets widely adopted to the point every major platform finally adds support for it.

      Replies (1)
      1. I know Netbird or Pangolin use WireGuard, but what do you think of this tools ?
        Replies (2)
        1. I've setup netbird for Mario Kart World multiplayer ...
        2. I prefer plain WireGuard. Anything else is needless bloat to me. Especially if you consider that Tailscale already had an exploit if sort (don't remember the details).
    11. > The bigger issue is you're then accountable for keeping up with security. Previously that meant using fail2ban and running a system update every few months. Now it means patching within 24hrs of a CVE9+ dropping, which is happening at an accelerated rate.

      You can automate that

    12. Do you need to pubicly serve the self hosted stuff? With a few exceptions I have opted to simply put the services behind a tailnet and use that as the simple security boundary. It works OK for a small team.
      Replies (2)
      1. This applies in general. You can do a lot of cool things, across many domains. Only a very minute slice of that should ever be internet reachable.

        The biggest boon of AI boosted vulnerability discovery / exploit development is defence in depth is something that is more widely considered and applied.

      2. If you want to share it with people without getting them to install something, yeah.

        I’ve been using a https reverse proxy with BasicAuth and strong passwords

        Replies (2)
        1. Cloudflare zero trust tunnel seems to be working fine.
        2. (Pre-AI) I'v been thinking of a system that firewalls off 443 connections by default, but you get some sort of internal panel where you see these "knocks" and can choose to open access from that IP for x amount of time...

          Would work for occassional sharing/look at this scenario, but... in the end I decided I'm gonna just wireguard my internal network and deal with sharing using public services

          Replies (1)
          1. A commercial version of this is Palo Alto firewall with User ID and Authentication Portal. It is typically used for internal network segmentation but I see no reason why it wouldn't work on the public side of things.

            Oh, I guess your firewall itself would get owned pretty fast...the mgmt and other webpages hosted on the firewall tend to have a lot of CVEs which probably carries over to the Auth Portal too.

    13. I have a few raspi throwaway servers I don't really care about losing data on, so I wanted to try firefighter but couldn't because I use claude subscription rather than API key billing. Any plans to support users on subscriptions?
    14. Yep, a few times this month I've had to postpone sleep because a CVE was released and I had to patch
    15. Cloudflare Tunnels and Cloudflare Access used together pretty much eliminate this worry for the average person.

      No ports exposed, all outgoing traffic, and Cloudflare won’t let you actually reach the service until you provide a service token or do an email 2FA from an authorized email domain/address.

    16. > The bigger issue is you're then accountable for keeping up with security.

      Without agentic help, there's no chance I'd have: setup Falco and Trixy properly; properly segmented my home network with MikroTik hardware; setup Tailscale properly; built out a proper Yubikey-backed ssh-agent strategy; properly split out work and personal physical devboxes from my laptop; regularly scanned every device I own for credential leaks; etc etc etc

    17. I would say it's been the complete opposite experience for me - more like the original author's experience.

      I've been able to start moving my config to ansible, build and deploy Wazuh across my homelab, decman for arch config, move my self hosted services to cloudflare reverse proxy, deploy OPNSense with better firewall rules than I could previously on my Asus router, add VLANs and IOT monitoring.

      The amount of Crowdsec alerts I get now for bans is 10x lower because my services are only responding to IPs in my geo, after filtering for bad IPs, and Crowdsec also catches crawlers/scrapers before they reach my services.

      I also setup Incus VM with nested containerisation and network restrictions so I don't have to worry about auto mode nuking anything. They (agents) can work on my ansible config, test it, and push it to git. I can feed logs as needed for review and troubleshooting. And misconfigurations I'd had in Authelia (nothing impactful for external services) have been picked up as well.

      I am totally onboard with the author's experience.

      Love the site and concept too.

      Replies (1)
      1. Wazuh works great for my homelab too!
    18. no man. you firewall everything except a wireguard udp port in the 65k - which most dont scan.
    19. 24h is perhaps good for this month, be prepared for sub 1h responses with your agents patching the vulns as they are released, or else.
    20. This was my thought exactly. I took a lot of my internet exposed stuff down because I know I'm on the wrong side of the dunning-kruger on cybersecurity and if the experts can't find stability in the current historical moment then I should probably think twice.
    21. I've put the whole homelab behind wireguard/TailScale along with magic/split DNS - I get nice looking subdomains (e.g. jellyfin.home.top) with trusted SSL from ACME/LetsEncrypt. I actually bought real domain for that, but it has no public DNS records, all domain to IP stuff is done in the AdGuard-Home.

      And even with that - renovate bot creates MRs for new releases/images/versions and GitLab-CE and a bit of scripting makes a btrfs snapshot, updates service, even rolls back to last snapshot if it fails to reach running/healthy state.

    22. With the caddy webserver/reverse proxy, you can make so a file existing shuts down asses to a service, without editing the main config or reloading caddy. I wonder if an Ai agent that can autonomously create said files could work, as most vulnerabilities are for programs behind a reverse proxy anyways.
    23. That website is *chef's kiss*.
      Replies (1)
      1. ty ty. I enjoyed making the FAQ.
    24. for side projects, i have a locked down container running within gcp cloud run services, with automated redeployments of updated dependencies. bit costlier than a bare vm but it generally means i don't need to think about security as much.