confusedpuppy

joined 2 years ago

Yeah, a few weeks ago a achieved my state of "secure" for my server. I just happened to notice a dramatic decrease in activity and that's what prompted this question that's been sitting in the back of my mind for weeks now.

I do think it's important to talk about it though because there seems to be a lack of talk about security in general for self hosting. So many guides focus on getting services up and running as fast as possible but don't give security much thought.

I just so happened to have gained an interest for the security aspect of self hosting over hosting actual services. My risks for self hosting is extremely low so I've reached a point of diminishing returns on security but the mind is still curious and wants to know more.

I might write up a guide/walkthrough of my setup in the future but that's low priority. I have some other not self hosting related things I want to focus on first.

[–] confusedpuppy@lemmy.dbzer0.com 2 points 1 day ago* (last edited 1 day ago) (2 children)

I think I am already doing that. My Kiwix docker container port is set to 127.0.0.1:8080:8080 and my reverse proxy is only open to port 12345 but will redirect kiwi.example. com:12345 to port 8080 on the local machine.

I've learned that docker likes to manipulate iptables without any notice to other programs like UFW. I have to be specific in making sure docker containers only announce themselves to the local machine only.

I've also used this guide to harden Caddy and adjusted that to my needs. I took the advice from another user and use wildcard domain certs instead of issuing certs for each sub domain, that way only the wildcard domain is visible when I search it up at https://crt.sh/ . That way I'm not advertising my sub domains that I am using.

I started with a local scan first, something like nmap 192 168.40.xxx for a specific device or nmap 192.168.40.0/24 for everything in your current network.

Nmap is quite complex with lots of options but there's a lot of guides online to help out with the basics. You can press enter in your terminal while the scan is running and it should give a progress report.

[–] confusedpuppy@lemmy.dbzer0.com 4 points 1 day ago (4 children)

My ISP blocks incoming data to common ports unless you get a business account. That's why I used Cloudflare's tunnel service initially. I changed my plans with the domain name I currently own and I don't feel comfortable giving more power and data to an American Tech company so this is my alternative path.

I use Caddy as my reverse proxy so I only have one uncommon port open. My plans changed from many people accessing my site to just me and very few select friends of mine which does not need a business account.

[–] confusedpuppy@lemmy.dbzer0.com 1 points 1 day ago* (last edited 1 day ago)

I get that.

I was generally (in my head) speaking about all my devices. If someone stole my computer, the full disk encryption is more of a deterrence than the idea of my data being fully secured. My hope is that the third party is more likely to delete than to access. If I catch the attention of someone that actually wants my data, I have bigger issues to worry about than security of my electronic devices.

[–] confusedpuppy@lemmy.dbzer0.com 1 points 1 day ago (2 children)

I agree with the last point, I only mentioned that because I don't really know what other setting in my SSHD config is hiding my SSH port from nmap scans. That just happened to be the last change I remember doing before running an nmap scan again and finding my SSH port no longer showed up.

Accessing SSH still works as expected with my keys and for my use case, I don't believe I need an additional passphrase. Self hosting is just a hobby for me and I am very intentional with what I place on my web facing server.

I want to be secure enough but I'm also very willing to unplug and walk away if I happen to catch unwanted attention.

Thanks for the insight. It's useful to know what tools are out there and what they can do. I was only aware of nmap before which I use to make sure the only ports open are the ports I want open.

My web facing device only serves static sites and a file server with non identifiable data I feel indifferent about being on the internet. No databases or stress if it gets targeted or goes down.

Even then, I still like to know how things work. Technology today is built on so many layers of abstraction, it all feels like an infinite rabbit hole now. It's hard to look at any piece of technology as secure these days.

[–] confusedpuppy@lemmy.dbzer0.com 1 points 1 day ago (4 children)

I use a different port for SSH, I also have use authorized keys. My SSHD is setup to only accept keys with no passwords and no keyboard input. Also when I run nmap on my server, the SSH port does not show up. I've never been too sure how hidden the SSH port is beyond the nmap scan but just assumed it would be discovered somehow if someone was determined enough.

In the past month I did rename my devices and account names to things less obvious. I also took the suggestion from someone in this community and setup my TLS to use wildcard domain certs. That way my sub domains aren't being advertised on the public list used by Certificate Authorities. I simply don't use the base domain name anymore.

[–] confusedpuppy@lemmy.dbzer0.com 2 points 1 day ago (1 children)

Early when I was learning self hosting, I lost my work and progress a lot. Through all that I learned how to make a really solid backup/restore system that works consistently.

Each device I own has it's own local backup. I copy those backups to a partition on my computer dedicated to backups, and that partition gets copied again to an external SSD which can be disconnected. Restoring from external SSD to my Computer's backup partition to each device all works to my liking. I feel quite confident with my setup. It took a lot of failure to gain that confidence.

I also spent time hardening my system. I went through this Linux hardening guide and applied what I thought would be appropriate for my web facing server. Since the guide seems more for a personal computer (I think), the majority of it didn't apply to my use case. I also use Alpine Linux so there was even less I could do for my system but it was still helpful in understanding how much effort it is to secure a computer.

[–] confusedpuppy@lemmy.dbzer0.com 4 points 1 day ago (3 children)

That's been my main goal throughout securing my personal devices including my web facing server. To make things inconvenient as possible for potential outside interference. Even if it means simply wasting their time.

With how complex computers and other electronic devices have become, I never expect anything I own to be 100% secure even if I take steps I think will make me secure.

I've been on the internet long enough to have built a habit of obscuring my online or digital presence. It won't save me but it makes me less or a target.

I noticed this back in 2020 and it's been a real head trip since then. I left all my old friends behind and now only keep a certain type of people close to my heart. People who are honest with themselves and are not afraid to make changes to better themselves. They are few but I'm happy to have them in my life.

Most everyone else that surrounds me have been stuck in a negative cycle or a downward spiral that's become unbearable to be around so I chose to be more solitary.

[–] confusedpuppy@lemmy.dbzer0.com 1 points 1 week ago* (last edited 1 week ago)

I found BashWrite which is just a very simple static site generator written completely in bash as a single file script.

The only dependency is having an up-to-date sed command which most systems should have. I use Alpine Linux which comes with a minimal sed command so I had to download the full command through my package manager.

It's simple, basic and has support for the majority of markdown formatting. There's some limitations due to it being written in Bash only but I am personally okay with that.

I found it on this list of static site generators if you're curious to see more options.

view more: next ›