Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Selfhosted
  3. What steps do you take to secure your server and your selfhosted services?

What steps do you take to secure your server and your selfhosted services?

Scheduled Pinned Locked Moved Selfhosted
selfhosted
58 Posts 32 Posters 470 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O This user is from outside of this forum
    O This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #1

    Inspired by this comment to try to learn what I'm missing.

    • Cloudflare proxy
    • Reverse Proxy
    • Fail2ban
    • Docker containers on their own networks
    akatsukilevi@lemmy.worldA C G kratoz29@lemm.eeK ace@lemmy.ananace.devA 18 Replies Last reply
    1
    0
    • System shared this topic on
    • O [email protected]

      Inspired by this comment to try to learn what I'm missing.

      • Cloudflare proxy
      • Reverse Proxy
      • Fail2ban
      • Docker containers on their own networks
      akatsukilevi@lemmy.worldA This user is from outside of this forum
      akatsukilevi@lemmy.worldA This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #2

      Disable password authentication on SSH

      Enable firewall and block all ports you're not using(most firewalls do this by default)

      Switch to a LTS kernel(not security related, but it keeps things going smooth... Technically it is safer since it gets updated less often so it is a bit more battle tested? Never investigated whenever a LTS kernel is safer than a standard one)

      Use Caddy to proxy to services instead of directly exposing them out

      HTTPS for web stuff(Caddy does it automatically)

      zonenranslite@feddit.orgZ shimitar@downonthestreet.euS R justenoughducks@feddit.nlJ ? 5 Replies Last reply
      0
      • O [email protected]

        Inspired by this comment to try to learn what I'm missing.

        • Cloudflare proxy
        • Reverse Proxy
        • Fail2ban
        • Docker containers on their own networks
        C This user is from outside of this forum
        C This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #3

        I don't put it on the Internet.

        I have automatic updates enabled and once in a while I scan with Nessus. Also I have backups. Stuff dying or me breaking it is a much greater risk than getting hacked.

        N ? 2 Replies Last reply
        0
        • akatsukilevi@lemmy.worldA [email protected]

          Disable password authentication on SSH

          Enable firewall and block all ports you're not using(most firewalls do this by default)

          Switch to a LTS kernel(not security related, but it keeps things going smooth... Technically it is safer since it gets updated less often so it is a bit more battle tested? Never investigated whenever a LTS kernel is safer than a standard one)

          Use Caddy to proxy to services instead of directly exposing them out

          HTTPS for web stuff(Caddy does it automatically)

          zonenranslite@feddit.orgZ This user is from outside of this forum
          zonenranslite@feddit.orgZ This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #4

          This and fail2ban

          O 1 Reply Last reply
          0
          • O [email protected]

            Inspired by this comment to try to learn what I'm missing.

            • Cloudflare proxy
            • Reverse Proxy
            • Fail2ban
            • Docker containers on their own networks
            G This user is from outside of this forum
            G This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #5

            My new strategy is to block EVERY port except WireGuard. This doesn't work for things you want to host publicly ofc, like a website, but for most self host stuff I don't see anything better than that.

            R irmadlad@lemmy.worldI 2 Replies Last reply
            0
            • C [email protected]

              I don't put it on the Internet.

              I have automatic updates enabled and once in a while I scan with Nessus. Also I have backups. Stuff dying or me breaking it is a much greater risk than getting hacked.

              N This user is from outside of this forum
              N This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #6

              Is Nessus free for personal use?

              C 1 Reply Last reply
              0
              • C [email protected]

                I don't put it on the Internet.

                I have automatic updates enabled and once in a while I scan with Nessus. Also I have backups. Stuff dying or me breaking it is a much greater risk than getting hacked.

                ? Offline
                ? Offline
                Guest
                wrote on last edited by
                #7

                I agree - I don’t expose anything to the internet other than the WireGuard endpoint.

                I’m only hosting services that my immediate family need to access, so I just set up WireGuard on their devices, and only expose the services on the LAN.

                I used to expose services to the internet, until one of my #saltstack clients was exploited through a very recent vulnerability I hadn’t yet patched (only a week or so since it was announced). I was fortunate that the exploit failed due to the server running FreeBSD, so the crontab entry to download the next mailicious payload failed because wget wasn’t available on the server.

                That’s when I realised - minimise the attack surface - if you’re not hosting services for anyone in the world to access, don’t expose them to everyone in the world to exploit.

                R ? 2 Replies Last reply
                0
                • N [email protected]

                  Is Nessus free for personal use?

                  C This user is from outside of this forum
                  C This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #8

                  For up to 16 endpoints or something like that, yes.

                  1 Reply Last reply
                  0
                  • akatsukilevi@lemmy.worldA [email protected]

                    Disable password authentication on SSH

                    Enable firewall and block all ports you're not using(most firewalls do this by default)

                    Switch to a LTS kernel(not security related, but it keeps things going smooth... Technically it is safer since it gets updated less often so it is a bit more battle tested? Never investigated whenever a LTS kernel is safer than a standard one)

                    Use Caddy to proxy to services instead of directly exposing them out

                    HTTPS for web stuff(Caddy does it automatically)

                    shimitar@downonthestreet.euS This user is from outside of this forum
                    shimitar@downonthestreet.euS This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #9

                    This, but I prefer nginx.

                    And no real need for tailscale or cloudflare. If you do not like to depend on a third party service, either port forward and ddns or an external vps+wire guard if you have gcnat

                    ? 1 Reply Last reply
                    0
                    • ? Guest

                      I agree - I don’t expose anything to the internet other than the WireGuard endpoint.

                      I’m only hosting services that my immediate family need to access, so I just set up WireGuard on their devices, and only expose the services on the LAN.

                      I used to expose services to the internet, until one of my #saltstack clients was exploited through a very recent vulnerability I hadn’t yet patched (only a week or so since it was announced). I was fortunate that the exploit failed due to the server running FreeBSD, so the crontab entry to download the next mailicious payload failed because wget wasn’t available on the server.

                      That’s when I realised - minimise the attack surface - if you’re not hosting services for anyone in the world to access, don’t expose them to everyone in the world to exploit.

                      R This user is from outside of this forum
                      R This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #10

                      I don’t expose anything to the internet other than the WireGuard endpoint.

                      This is the way

                      1 Reply Last reply
                      0
                      • ? Guest

                        I agree - I don’t expose anything to the internet other than the WireGuard endpoint.

                        I’m only hosting services that my immediate family need to access, so I just set up WireGuard on their devices, and only expose the services on the LAN.

                        I used to expose services to the internet, until one of my #saltstack clients was exploited through a very recent vulnerability I hadn’t yet patched (only a week or so since it was announced). I was fortunate that the exploit failed due to the server running FreeBSD, so the crontab entry to download the next mailicious payload failed because wget wasn’t available on the server.

                        That’s when I realised - minimise the attack surface - if you’re not hosting services for anyone in the world to access, don’t expose them to everyone in the world to exploit.

                        ? Offline
                        ? Offline
                        Guest
                        wrote on last edited by
                        #11

                        TBF if you want, you can have a bastion server which is solely whitelisted by IP to stream your content from your local server. It's obviously a pivot point for hackers, but it's the level of effort that 99% of hackers would ignore unless they really wanted to target
                        you. And if you're that high value of a target, you probably shouldn't be opening any ports on your network, which brings us back to your original solution.

                        I, too, don't expose things to the public because I cannot afford the more safe/obfuscated solutions. But I do think there are reasonable measures that can be taken to expose your content to a wider audience if you wanted.

                        1 Reply Last reply
                        0
                        • zonenranslite@feddit.orgZ [email protected]

                          This and fail2ban

                          O This user is from outside of this forum
                          O This user is from outside of this forum
                          [email protected]
                          wrote on last edited by
                          #12

                          Anything else?

                          I 1 Reply Last reply
                          0
                          • O [email protected]

                            Anything else?

                            I This user is from outside of this forum
                            I This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #13

                            There are ip lists that let you iptables drop all traffic from China and Russia.

                            Strongly recommend.

                            O L 2 Replies Last reply
                            0
                            • I [email protected]

                              There are ip lists that let you iptables drop all traffic from China and Russia.

                              Strongly recommend.

                              O This user is from outside of this forum
                              O This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #14

                              I was auto banning all countries but my own but now I’m hosting one resource that has an audience including Chinese…

                              Good advice outside of this use case! 🙂

                              I 1 Reply Last reply
                              0
                              • O [email protected]

                                Inspired by this comment to try to learn what I'm missing.

                                • Cloudflare proxy
                                • Reverse Proxy
                                • Fail2ban
                                • Docker containers on their own networks
                                kratoz29@lemm.eeK This user is from outside of this forum
                                kratoz29@lemm.eeK This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #15

                                I expose some stuff through IPv6 only with my Synology NAS (I am CGNATED) and I have always wondered if I still need to use fail2ban in that environment...

                                My Synology has an auto block feature that from my understanding is essentially fail2ban, what I don't know is if such a feature works for all my exposed services but Synology's.

                                L 1 Reply Last reply
                                0
                                • G [email protected]

                                  My new strategy is to block EVERY port except WireGuard. This doesn't work for things you want to host publicly ofc, like a website, but for most self host stuff I don't see anything better than that.

                                  R This user is from outside of this forum
                                  R This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by
                                  #16

                                  I do this too. Took me a little effort to set things up, but now its so easy.

                                  1 Reply Last reply
                                  0
                                  • O [email protected]

                                    Inspired by this comment to try to learn what I'm missing.

                                    • Cloudflare proxy
                                    • Reverse Proxy
                                    • Fail2ban
                                    • Docker containers on their own networks
                                    ace@lemmy.ananace.devA This user is from outside of this forum
                                    ace@lemmy.ananace.devA This user is from outside of this forum
                                    [email protected]
                                    wrote on last edited by
                                    #17

                                    Default block for incoming traffic is always a good starting point.
                                    I'm personally using crowdsec to good results, but still need to add some more to it as I keep seeing failed attacks that should be blocked much quicker.

                                    1 Reply Last reply
                                    0
                                    • O [email protected]

                                      Inspired by this comment to try to learn what I'm missing.

                                      • Cloudflare proxy
                                      • Reverse Proxy
                                      • Fail2ban
                                      • Docker containers on their own networks
                                      M This user is from outside of this forum
                                      M This user is from outside of this forum
                                      [email protected]
                                      wrote on last edited by
                                      #18

                                      Just tailscale really.

                                      My services are only exposed to the tailscale network, so I don't have to worry about otger devices on my LAN.

                                      A good VPN with MFA is all you really need if you are the only user.

                                      1 Reply Last reply
                                      0
                                      • O [email protected]

                                        Inspired by this comment to try to learn what I'm missing.

                                        • Cloudflare proxy
                                        • Reverse Proxy
                                        • Fail2ban
                                        • Docker containers on their own networks
                                        J This user is from outside of this forum
                                        J This user is from outside of this forum
                                        [email protected]
                                        wrote on last edited by
                                        #19

                                        use a cheap vlan switch to make an actual vlan DMZ with the services' router

                                        use non-root containers everywhere. segment services in different containers

                                        1 Reply Last reply
                                        0
                                        • O [email protected]

                                          I was auto banning all countries but my own but now I’m hosting one resource that has an audience including Chinese…

                                          Good advice outside of this use case! 🙂

                                          I This user is from outside of this forum
                                          I This user is from outside of this forum
                                          [email protected]
                                          wrote on last edited by
                                          #20

                                          Yeah, there were other countries to ban, but those 2 cut my attacks down 90%.

                                          Also consider a honeypot that triggers when anyone tries to ssh it at all.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups