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. Got any security advice for setting up a locally hosted website/external service?

Got any security advice for setting up a locally hosted website/external service?

Scheduled Pinned Locked Moved Selfhosted
selfhosted
20 Posts 11 Posters 24 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.
  • smokeydope@lemmy.worldS [email protected]

    Setting up a personal site on local hardware has been on my bucket list for along time. I finally bit he bullet and got a basic website running with apache on a Ubuntu based linux distro. I bought a domain name, linked it up to my l ip got SSL via lets encrypt for https and added some header rules until security headers and Mozilla observatory gave it a perfect score.

    Am I basically in the clear? What more do I need to do to protect my site and local network? I'm so scared of hackers and shit I do not want to be an easy target.

    I would like to make a page about the hardware its running on since I intend to have it be entirely ran off solar power like solar.lowtechmagazine and wanted to share technical specifics. But I heard somewhere that revealing the internal state of your server is a bad idea since it can make exploits easier to find. Am I being stupid for wanting to share details like computer model and software running it?

    stardustsystem@lemmy.worldS This user is from outside of this forum
    stardustsystem@lemmy.worldS This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #2

    You might want to set up dynamic DNS for your domain. If you're hosting from a residential internet connection then your ISP will change your address eventually. Ddclient can be used to report your current IP to your Registrar regularly, so if it changes the domain moves along with it.

    D 1 Reply Last reply
    5
    • smokeydope@lemmy.worldS [email protected]

      Setting up a personal site on local hardware has been on my bucket list for along time. I finally bit he bullet and got a basic website running with apache on a Ubuntu based linux distro. I bought a domain name, linked it up to my l ip got SSL via lets encrypt for https and added some header rules until security headers and Mozilla observatory gave it a perfect score.

      Am I basically in the clear? What more do I need to do to protect my site and local network? I'm so scared of hackers and shit I do not want to be an easy target.

      I would like to make a page about the hardware its running on since I intend to have it be entirely ran off solar power like solar.lowtechmagazine and wanted to share technical specifics. But I heard somewhere that revealing the internal state of your server is a bad idea since it can make exploits easier to find. Am I being stupid for wanting to share details like computer model and software running it?

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

      No need to cargo-cult security practices here, chief. You’re not gonna get pwned by publishing your hardware specs. If you’re planning to build some kinda webapp for yourself, that’s a different story - but you have to fuck up hard to get hacked while hosting raw HTML.

      Use an SSH key, disable password auth, make sure you’re firewalled (i.e. test with nmap), and call it a day.

      smokeydope@lemmy.worldS 1 Reply Last reply
      9
      • D [email protected]

        No need to cargo-cult security practices here, chief. You’re not gonna get pwned by publishing your hardware specs. If you’re planning to build some kinda webapp for yourself, that’s a different story - but you have to fuck up hard to get hacked while hosting raw HTML.

        Use an SSH key, disable password auth, make sure you’re firewalled (i.e. test with nmap), and call it a day.

        smokeydope@lemmy.worldS This user is from outside of this forum
        smokeydope@lemmy.worldS This user is from outside of this forum
        [email protected]
        wrote on last edited by [email protected]
        #4

        Thanks for the input! I do eventually plan on making some scripts and a custom web interface to interact with/expose some local services on my network once I have the basics of HTML covered as part of a portfolio thing so would like to cover my ass early and not have problems later

        N 1 Reply Last reply
        1
        • smokeydope@lemmy.worldS [email protected]

          Thanks for the input! I do eventually plan on making some scripts and a custom web interface to interact with/expose some local services on my network once I have the basics of HTML covered as part of a portfolio thing so would like to cover my ass early and not have problems later

          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
          #5

          The most important thing is to use your common sense, think about it an extra minute before punching holes in your fw, and keep those holes documented and to a minimum.

          1 Reply Last reply
          4
          • smokeydope@lemmy.worldS [email protected]

            Setting up a personal site on local hardware has been on my bucket list for along time. I finally bit he bullet and got a basic website running with apache on a Ubuntu based linux distro. I bought a domain name, linked it up to my l ip got SSL via lets encrypt for https and added some header rules until security headers and Mozilla observatory gave it a perfect score.

            Am I basically in the clear? What more do I need to do to protect my site and local network? I'm so scared of hackers and shit I do not want to be an easy target.

            I would like to make a page about the hardware its running on since I intend to have it be entirely ran off solar power like solar.lowtechmagazine and wanted to share technical specifics. But I heard somewhere that revealing the internal state of your server is a bad idea since it can make exploits easier to find. Am I being stupid for wanting to share details like computer model and software running it?

            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
            #6

            Isolate it as much as possible. If you can, put it on a little DMZ subnet with access to nothing else. Don't run any unnecessary services, and especially expose only the services you need to (HTTP) and none of the ones you don't (ssh).

            1 Reply Last reply
            0
            • smokeydope@lemmy.worldS [email protected]

              Setting up a personal site on local hardware has been on my bucket list for along time. I finally bit he bullet and got a basic website running with apache on a Ubuntu based linux distro. I bought a domain name, linked it up to my l ip got SSL via lets encrypt for https and added some header rules until security headers and Mozilla observatory gave it a perfect score.

              Am I basically in the clear? What more do I need to do to protect my site and local network? I'm so scared of hackers and shit I do not want to be an easy target.

              I would like to make a page about the hardware its running on since I intend to have it be entirely ran off solar power like solar.lowtechmagazine and wanted to share technical specifics. But I heard somewhere that revealing the internal state of your server is a bad idea since it can make exploits easier to find. Am I being stupid for wanting to share details like computer model and software running it?

              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
              #7

              Keep it segregated from your internal network, no password auth, or better yet, install a privatenet client (Tailscale, Zerotier...etc) and don't open SSH ports at all, consider using a Cloudflare Tunnel or similar...that's a basic start.

              Honestly, if you're serving a static site, just deploy it on Digitalocean Apps or R2 for free and skip all the worry and get all the Cloudflare protection built-in.

              D 1 Reply Last reply
              2
              • smokeydope@lemmy.worldS [email protected]

                Setting up a personal site on local hardware has been on my bucket list for along time. I finally bit he bullet and got a basic website running with apache on a Ubuntu based linux distro. I bought a domain name, linked it up to my l ip got SSL via lets encrypt for https and added some header rules until security headers and Mozilla observatory gave it a perfect score.

                Am I basically in the clear? What more do I need to do to protect my site and local network? I'm so scared of hackers and shit I do not want to be an easy target.

                I would like to make a page about the hardware its running on since I intend to have it be entirely ran off solar power like solar.lowtechmagazine and wanted to share technical specifics. But I heard somewhere that revealing the internal state of your server is a bad idea since it can make exploits easier to find. Am I being stupid for wanting to share details like computer model and software running it?

                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 [email protected]
                #8

                Fail2ban ufw nftables

                port forward only the bare minimum (80 443)

                Expose docker ports with 127.0.0.1:8000:8000 then port forward with caddy server on the host

                Edit: add nftables

                D 1 Reply Last reply
                0
                • M [email protected]

                  Fail2ban ufw nftables

                  port forward only the bare minimum (80 443)

                  Expose docker ports with 127.0.0.1:8000:8000 then port forward with caddy server on the host

                  Edit: add nftables

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

                  This is dangerous advice because docker is well-known for undoing UFW’s iptable rules. It’s mitigated by binding to localhost, but still way too easy for people to shoot themselves in the foot by using the two together.

                  M 1 Reply Last reply
                  1
                  • D [email protected]

                    This is dangerous advice because docker is well-known for undoing UFW’s iptable rules. It’s mitigated by binding to localhost, but still way too easy for people to shoot themselves in the foot by using the two together.

                    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
                    #10

                    Docker is going to undo your port iptable rules with or without ufw

                    Running rm -rf ~ isn’t that hard to do either just don’t do it.

                    Your router’s NAT should save you if that happens on the wrong port anyway.

                    D 1 Reply Last reply
                    0
                    • M [email protected]

                      Docker is going to undo your port iptable rules with or without ufw

                      Running rm -rf ~ isn’t that hard to do either just don’t do it.

                      Your router’s NAT should save you if that happens on the wrong port anyway.

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

                      You shouldn’t suggest UFW at all then. There are other firewall options that can be used just fine with docker.

                      It does have real potential to cause issues, e.g. if OP were to put their server in DMZ mode on their router and later copy some docker setup instructions that don’t explicitly bind to localhost.

                      M 1 Reply Last reply
                      0
                      • smokeydope@lemmy.worldS [email protected]

                        Setting up a personal site on local hardware has been on my bucket list for along time. I finally bit he bullet and got a basic website running with apache on a Ubuntu based linux distro. I bought a domain name, linked it up to my l ip got SSL via lets encrypt for https and added some header rules until security headers and Mozilla observatory gave it a perfect score.

                        Am I basically in the clear? What more do I need to do to protect my site and local network? I'm so scared of hackers and shit I do not want to be an easy target.

                        I would like to make a page about the hardware its running on since I intend to have it be entirely ran off solar power like solar.lowtechmagazine and wanted to share technical specifics. But I heard somewhere that revealing the internal state of your server is a bad idea since it can make exploits easier to find. Am I being stupid for wanting to share details like computer model and software running it?

                        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
                        #12

                        Use a reverse proxy in a DMZ. You can use something like Bunkerweb + Crowdsec to give you a WAF and dynamic IP blocklist in front of your web service.

                        1 Reply Last reply
                        1
                        • D [email protected]

                          You shouldn’t suggest UFW at all then. There are other firewall options that can be used just fine with docker.

                          It does have real potential to cause issues, e.g. if OP were to put their server in DMZ mode on their router and later copy some docker setup instructions that don’t explicitly bind to localhost.

                          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
                          #13

                          Please tell me more, which firewall would you recommend that plays nice with Docker?

                          No NAT? Hahaha that’s a big if, and why would you copy paste a docker compose without reading it?

                          lars@fedihub.spaceL 1 Reply Last reply
                          0
                          • M [email protected]

                            Please tell me more, which firewall would you recommend that plays nice with Docker?

                            No NAT? Hahaha that’s a big if, and why would you copy paste a docker compose without reading it?

                            lars@fedihub.spaceL This user is from outside of this forum
                            lars@fedihub.spaceL This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #14

                            @[email protected] nftables

                            M 1 Reply Last reply
                            0
                            • lars@fedihub.spaceL [email protected]

                              @[email protected] nftables

                              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
                              #15

                              Cool! ufw supports nftables too.

                              lars@fedihub.spaceL 1 Reply Last reply
                              0
                              • M [email protected]

                                Cool! ufw supports nftables too.

                                lars@fedihub.spaceL This user is from outside of this forum
                                lars@fedihub.spaceL This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #16

                                @[email protected] yes. but I use it without UFW.

                                M 1 Reply Last reply
                                0
                                • lars@fedihub.spaceL [email protected]

                                  @[email protected] yes. but I use it without UFW.

                                  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
                                  #17

                                  ::: spoiler joke 18+
                                  Fine I’ll go sit in the cuck chair again while you write out those long hard nftables commands to my server.
                                  :::

                                  1 Reply Last reply
                                  0
                                  • stardustsystem@lemmy.worldS [email protected]

                                    You might want to set up dynamic DNS for your domain. If you're hosting from a residential internet connection then your ISP will change your address eventually. Ddclient can be used to report your current IP to your Registrar regularly, so if it changes the domain moves along with it.

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

                                    Depends on your ISP and where in the world you live.

                                    1 Reply Last reply
                                    0
                                    • J [email protected]

                                      Keep it segregated from your internal network, no password auth, or better yet, install a privatenet client (Tailscale, Zerotier...etc) and don't open SSH ports at all, consider using a Cloudflare Tunnel or similar...that's a basic start.

                                      Honestly, if you're serving a static site, just deploy it on Digitalocean Apps or R2 for free and skip all the worry and get all the Cloudflare protection built-in.

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

                                      Cloudflared is such a nice feature, I have seperate tunnels for different services hosted on the one machine.

                                      1 Reply Last reply
                                      0
                                      • smokeydope@lemmy.worldS [email protected]

                                        Setting up a personal site on local hardware has been on my bucket list for along time. I finally bit he bullet and got a basic website running with apache on a Ubuntu based linux distro. I bought a domain name, linked it up to my l ip got SSL via lets encrypt for https and added some header rules until security headers and Mozilla observatory gave it a perfect score.

                                        Am I basically in the clear? What more do I need to do to protect my site and local network? I'm so scared of hackers and shit I do not want to be an easy target.

                                        I would like to make a page about the hardware its running on since I intend to have it be entirely ran off solar power like solar.lowtechmagazine and wanted to share technical specifics. But I heard somewhere that revealing the internal state of your server is a bad idea since it can make exploits easier to find. Am I being stupid for wanting to share details like computer model and software running it?

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

                                        pangolin?

                                        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