I understand that people enter the world of self hosting for various reasons. I am trying to dip my toes in this ocean to try and get away from privacy-offending centralised services such as Google, Cloudflare, AWS, etc.

As I spend more time here, I realise that it is practically impossible; especially for a newcomer, to setup any any usable self hosted web service without relying on these corporate behemoths.

I wanted to have my own little static website and alongside that run Immich, but I find that without Cloudflare, Google, and AWS, I run the risk of getting DDOSed or hacked. Also, since the physical server will be hosted at my home (to avoid AWS), there is a serious risk of infecting all devices at home as well (currently reading about VLANS to avoid this).

Am I correct in thinking that avoiding these corporations is impossible (and make peace with this situation), or are there ways to circumvent these giants and still have a good experience self hosting and using web services, even as a newcomer (all without draining my pockets too much)?

Edit: I was working on a lot of misconceptions and still have a lot of learn. Thank you all for your answers.

  • hsdkfr734r@feddit.nl
    link
    fedilink
    English
    arrow-up
    36
    arrow-down
    1
    ·
    edit-2
    3 months ago

    One aspect is how interesting you are as a target. What would a possible attacker gain by getting access to your services or hosts?

    The danger to get hacked is there but you are not Microsoft, amazon or PayPal. Expect login attempts and port scans from actors who map out the internets. But I doubt someone would spend much effort to break into your hosts if you do not make it easy (like scripted automatic exploits and known passwords login attempts easy) .

    DDOS protection isn’t something a tiny self hosted instance would need (at least in my experience).

    Firewall your hosts, maybe use a reverse proxy and only expose the necessary services. Use secure passwords (different for each service), add fail2ban or the like if you’re paranoid. Maybe look into MFA. Use a DMZ (yes, VLANs could be involved here). Keep your software updated so that exploits don’t work. Have backups if something breaks or gets broken.

    In my experience the biggest danger to my services is my laziness. It takes steady low level effort to keep the instances updated and running. (Yes there are automated update mechanisms - unattended upgrades i.e. -, but also downwards compatibility breaking changes in the software which will require manual interactions by me.)

    • thirdBreakfast@lemmy.world
      link
      fedilink
      English
      arrow-up
      28
      ·
      3 months ago

      +1 for the main risk to my service reliability being me getting distracted by some other shiny thing and getting behind on maintenance.

    • mad_asshatter@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      3 months ago

      …maybe use a reverse proxy…

      +1 post.

      I would suggest definitely reverse proxy. Caddy should be trivial in this use case.

      cheers,

          • atzanteol@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            edit-2
            3 months ago

            I’m positive that F5’s marketing department knows more than me about security and has not ulterior motive in making you think you’re more secure.

            Snark aside, they may do some sort of WAF in addition to being a proxy. Just “adding a proxy” does very little.

        • d_ohlin@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          3 months ago

          May not add security in and of itself, but it certainly adds the ability to have a little extra security. Put your reverse proxy in a DMZ, so that only it is directly facing the intergoogles. Use firewall to only expose certain ports and destinations exposed to your origins. Install a single wildcard cert and easily cover any subdomains you set up. There’s even nginx configuration files out there that will block URL’s based on regex pattern matches for suspicious strings. All of this (probably a lot more I’m missing) adds some level of layered security.

          • atzanteol@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            5
            arrow-down
            1
            ·
            edit-2
            3 months ago

            Put your reverse proxy in a DMZ, so that only it is directly facing the intergoogles

            So what? I can still access your application through the rproxy. You’re not protecting the application by doing that.

            Install a single wildcard cert and easily cover any subdomains you set up

            This is a way to do it but not a necessary way to do it. The rproxy has not improved security here. It’s just convenient to have a single SSL endpoint.

            There’s even nginx configuration files out there that will block URL’s based on regex pattern matches for suspicious strings. All of this (probably a lot more I’m missing) adds some level of layered security.

            If you do that, sure. But that’s not the advice given in this forum is it? It’s “install an rproxy!” as though that alone has done anything useful.

            For the most part people in this form seem to think that “direct access to my server” is unsafe but if you simply put a second hop in the chain that now you can sleep easily at night. And bonus points if that rproxy is a VPS or in a separate subnet!

            The web browser doesn’t care if the application is behind one, two or three rproxies. If I can still get to your application and guess your password or exploit a known vulnerability in your application then it’s game over.

            • zingo@lemmy.ca
              link
              fedilink
              English
              arrow-up
              3
              ·
              3 months ago

              The web browser doesn’t care if the application is behind one, two or three rproxies. If I can still get to your application and guess your password or exploit a known vulnerability in your application then it’s game over.

              Right!?

              Your castle can have many walls of protection but if you leave the doors/ports open, people/traffic just passes through.

            • Auli@lemmy.ca
              link
              fedilink
              English
              arrow-up
              1
              ·
              3 months ago

              So I’ve always wondered this. How does a cloudflare tunnel offer protection from the same thing.

              • atzanteol@sh.itjust.works
                link
                fedilink
                English
                arrow-up
                2
                ·
                3 months ago

                They may offer some sort of WAF (web application firewall) that inspects traffic for potentially malicious intent. Things like SQL injection. That’s more than just a proxy though.

                Otherwise, they really don’t.

        • Oisteink@feddit.nl
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          3 months ago

          A reverse proxy is used to expose services that don’t run on exposed hosts. It does not add security but it keeps you from adding attack vectors.

          They usually provide load balancing too, also not a security feature.

          Edit: in other words what he’s saying is true and equal to “raid isn’t baclup”

    • Oisteink@feddit.nl
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 months ago

      All reverse proxies i have used do rudimentary DDoS protection: rate limiting. Enough to keep your local script kiddy at bay - but not advanced stuff.

      You can protect your ssh instance with rate limiting too but you’ll likely do this in the firewall and not the proxy.