As the title says, I want to know the most paranoid security measures you’ve implemented in your homelab. I can think of SDN solutions with firewalls covering every interface, ACLs, locked-down/hardened OSes etc but not much beyond that. I’m wondering how deep this paranoia can go (and maybe even go down my own route too!).

Thanks!

  • shadowintheday2@lemmy.world
    link
    fedilink
    English
    arrow-up
    42
    ·
    9 months ago

    My most paranoid config is disabling Ipv4

    That’s it. If someone wants to attack me, they will need to adopt IPv6!

    • dan@upvote.au
      link
      fedilink
      English
      arrow-up
      11
      ·
      9 months ago

      they will need to adopt IPv6!

      And find your IP in a /56 or /64 range (depending on what your ISP gives you). Good luck.

  • dr_robot@kbin.social
    link
    fedilink
    arrow-up
    42
    ·
    9 months ago

    Logcheck. It took ages to make sure innocent logs are ignored, but now I get an email as soon as anything non-routine happens on my servers. I get emails with logs from every update, every time I log in, etc. This has given me the most confidence that nothing unexpected is happening on my servers. Of course, one needs to make sure that the firewall is configured well, and that you use ssh keys etc., but logcheck is how I know I’m doing enough.

  • NuXCOM_90Percent@lemmy.zip
    link
    fedilink
    English
    arrow-up
    41
    arrow-down
    1
    ·
    edit-2
    9 months ago

    Never used it “in anger” but:

    I have my firewall plugged into a metered outlet (plugged into a UPS). I have it set up to send me alerts if power draw increases beyond a certain threshold. I’ve tested it and wireguard is measurable (yay) but so are DDOS attacks. If I get that alert, I can choose to turn off that plug and take my whole network offline until I get home and can sort that out.

    Gotten a few false positives over the years but mostly that is just texting my partner to ask what they are doing.

    • ililiililiililiilili@lemm.ee
      link
      fedilink
      English
      arrow-up
      5
      ·
      9 months ago

      Care to share what outlet you had success with? I’m comfortable with Home Assistant and ZigBee/Z-Wave. Something this critical probably shouldn’t be wireless, but I digress. I’m also interested in what software you’re using for monitoring and alerts (if you’re willing to share). Cheers!

      • NuXCOM_90Percent@lemmy.zip
        link
        fedilink
        English
        arrow-up
        4
        ·
        9 months ago

        I just use a pretty generic z-wave plug and home assistant. In the past I did more complex setups that actually determine what process is spiking and so forth. But eventually realized that “this is doing a lot of compute…” is a catch all for a LOT of potential issues.

        And I guess I don’t understand what you mean by “shouldn’t be wireless”. It is inherently going to be wireless because you will be on your phone on the other side of the planet. If you genuinely suspect you will be vulnerable to attacks of this scale then you… probably have other things to worry about.

        But as a safety blanket?

    • Avid Amoeba@lemmy.ca
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      9 months ago

      Or you could trigger automation that turns it off for hours, then turns it back on. That way you could get around the need to physically turn it on, in case everyone is away.

      • NuXCOM_90Percent@lemmy.zip
        link
        fedilink
        English
        arrow-up
        10
        ·
        9 months ago

        With my firewall disabled a lot of my internal network (including home assistant) will fall over sooner than later.

        But that is also a recipe for mass stress. Because I know “something happened”. And now I know “in six hours, I need to check in and make sure that ‘something’ is still not happening”. Which is extra shitty if I got the notification late evening local time.

        I have friends/neighbors that I trust to swing by and push a button in the event I need to bring it back up before I get home. But if I have reached the point of “it is possible my wireguard credentials were compromised?” then I really don’t need to be able to download the next episode of ATLA NOW.

  • thantik@lemmy.world
    link
    fedilink
    English
    arrow-up
    33
    ·
    edit-2
    9 months ago

    I’ve replaced reconnaissance commands (a handful of them found here: https://www.cybrary.it/blog/linux-commands-used-attackers) – whoami, uname, id, uptime, last, etc

    With shell scripts which run the command but also send me a notification via pushover. I’m running several internet-facing services, and the moment those get run because someone is doing some sleuthing inside the machine, I get notified.

    It doesn’t stop people getting in, I’ve set up other things for that – but on the off chance that there is some zero-day that I don’t know about yet, or they’ve traversed the network laterally somehow, the moment they run one of those commands, I know to kill-switch the entire thing.

    The thing is, security is an on-going process. Leave any computer attached to the internet long enough and it’ll be gotten into. I don’t trust being able to know every method that can be used, so I use this as a backup.

    • MigratingtoLemmy@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      7
      ·
      9 months ago

      That’s a very good idea. Something to think about, especially if you have open ports and are paranoid enough (aren’t we all? Hehe). Thanks

  • Pika@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    26
    ·
    edit-2
    9 months ago

    My security is fairly simplistic but I’m happy with it

    • software protection

      • fail2ban with low warning hold
      • cert based login for ssh (no password Auth)
      • Honeypot on all common port numbers, which if pinged leads to a permanent IP ban
      • drop all firewall
      • PSAD for intrusion/scanning protection (so many Russian scanners… lol)
      • wireguard for VPN to access local virtual machines and resources
      • external VPN with nordVPN for secure containers (yes I know nord is questionable I plan to swap when my sub runs out)
    • physical protection

      • luksCrypt on the sensitive Data/program Drive ( I know there’s some security concerns with luksCrypt bite me)
      • grub and bios locked with password
      • UPS set to auto notify on power outage
      • router with keep alive warning system that pings my phone if the lab goes offline and provides fallback dns
    • things I’ve thought about:

      • a mock recovery partition entry that will nuke the Luks headers on entry (to prevent potential exploit getting through grub)
      • removing super user access completely outside of local user access
      • Pika@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        9 months ago

        I just expanded the existing fail2ban config on the commonly used default ports such as 22, 21 Etc, any requests on those ports get sent into purgatory, so the ip gets blacklisted any connections from it hangs until it times out. It’s a super basic setup iptables logs whenever a request is not in the current firewall (last rule in the chain) and then fail2ban reads the log and handles the block. I don’t count it as part of the normal setup because they’re isolated Because the actual ports the service is on still have the normal rule set but the default port numbers are just an instant if there’s activity on it you’re gone

  • Kata1yst@kbin.social
    link
    fedilink
    arrow-up
    18
    ·
    9 months ago

    Really all I do is setup fail2ban on my very few external services, and then put all other access behind wireguard.

    Logs are clean, I’m happy.

  • gnuplusmatt@reddthat.com
    link
    fedilink
    English
    arrow-up
    15
    ·
    9 months ago

    How do you all that have your services on your LAN accessing it over wireguard when external pass the wife/kids/family test? If I had to have my wife activate a VPN before she could access our nextcloud or bitwarden, she’d just never use it

      • gnuplusmatt@reddthat.com
        link
        fedilink
        English
        arrow-up
        4
        ·
        9 months ago

        always on they wouldnt know about it and if the connection failed or the wg service crashed on their phone then the services wouldn’t work. It adds a complexity that you don’t want when you’re trying to pass the wife test. Plus yes battery.

        • ErwinLottemann@feddit.de
          link
          fedilink
          English
          arrow-up
          4
          ·
          9 months ago

          no wireguard should not decrease batterylife (see my other comment) we use wg eith always on without any problems. sometimes it stops on one phone but l9oking for the key icon and clicking the action button in the navigationcontrolmenuthingy is quite easy

  • JoeKrogan@lemmy.world
    link
    fedilink
    English
    arrow-up
    15
    arrow-down
    1
    ·
    edit-2
    9 months ago

    Only remote access by wireguard and ssh on non standard port with key based access.

    Fail2ban bans after 1 attempt for a year. Tweaked the logs to ban on more strict patterns

    Logs are encrypted and mailed off site daily

    System updates over tor connecting to onion repos.

    Nginx only has one exposed port 443 that is accessible by wireguard or lan. Certs are signed by letsencrypt. Paths are ip white listed to various lan or wireguard ips.

    Only allow one program with sudo access requiring a password. Every other privelaged action requires switching to root user.

    I dont allow devices I dont admin on the network so they go on their own subnet. This is guests phones and their windows laptops.

    Linux only on the main network.

    I also make sure to backup often.

    • constantokra@lemmy.one
      link
      fedilink
      English
      arrow-up
      7
      ·
      9 months ago

      Can you explain why you use onion repos? I’ve never heard of that, and I’ve heard of kind of a lot of things.

      • Semperverus@lemmy.world
        link
        fedilink
        English
        arrow-up
        7
        ·
        9 months ago

        If big corporations hoovering your data should be on everyone’s threat list, then yea, i’d say its a huge benefit.

      • JoeKrogan@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        9 months ago

        Well I dont trust closed source software and so what I can to avoid it when I can. At least foss can be audited. Also all the linux devices on the main network are devices I admin.

    • rekabis@lemmy.ca
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 months ago

      Fail2ban bans after 1 attempt for a year.

      Fail2ban yes; one year, however, is IMO a bit excessive.

      Most ISP IP assignments do tend to linger - even with DHCP the same IP will be re-assigned to the same gateway router for quite a number of sequential times - but most IPs do eventually change within a few months. I personally use 3 months as a happy medium for any blacklist I run. Most dynamic IPs don’t last this long, almost all attackers will rotate through IPs pretty quickly anyhow, and if you run a public service (website, etc.), blocking for an entire year may inadvertently catch legitimate visitors.

      Plus, you also have to consider the load such a large blocklist will have on your system, if most entries no longer represent legitimate threat actors, you’ll only bog down your system by keeping them in there.

      Fail2ban can be configured to allow initial issues to cycle back out quicker, while blocking known repeat offenders for a much longer time period. This is useful in keeping block lists shorter and less resource-intensive to parse.

      • JoeKrogan@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        9 months ago

        My block list is very small actually due to the non standard ssh port. Everything else goes through wireguard.

        If it was open to the public then yes I’d have to reconsider the ban length.

  • enkers@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    13
    ·
    9 months ago

    Using SPA firewall knocking (fwknop) to open ports to ssh in. I suppose if I was really paranoid, the most secure would be an air gap, but there’s only so much convenience I’ll give up for security.

    • MigratingtoLemmy@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      9 months ago

      I’m going to save your comment because it has opened up a new technique for network security that I had never thought of before. Thanks a bunch

  • Decronym@lemmy.decronym.xyzB
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    9 months ago

    Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

    Fewer Letters More Letters
    AP WiFi Access Point
    CA (SSL) Certificate Authority
    DNS Domain Name Service/System
    Git Popular version control system, primarily for code
    HTTP Hypertext Transfer Protocol, the Web
    HTTPS HTTP over SSL
    IP Internet Protocol
    NAT Network Address Translation
    PiHole Network-wide ad-blocker (DNS sinkhole)
    SBC Single-Board Computer
    SSH Secure Shell for remote terminal access
    SSL Secure Sockets Layer, for transparent encryption
    TLS Transport Layer Security, supersedes SSL
    VPN Virtual Private Network
    nginx Popular HTTP server

    15 acronyms in this thread; the most compressed thread commented on today has 16 acronyms.

    [Thread #493 for this sub, first seen 6th Feb 2024, 16:55] [FAQ] [Full list] [Contact] [Source code]

  • Dehydrated@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    arrow-down
    1
    ·
    9 months ago
    • Custom Router/Firewall running OPNsense and the Sensei plugin
    • Extensive DNS filtering through Pihole
    • Redirecting all DNS requests to my Pihole through OPNsense
    • My entire network is behind a multi hop VPN
    • I don’t let any Windows systems connect to the internet, instead, I have a Linux server which is connected to the internet (through a VPN of course) and runs a browser, and I use X2go to access the browser which is running on the Linux server
      • Dehydrated@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        1
        ·
        9 months ago

        I am aware of the ME, but I can’t really do anything about it. Current ARM SBCs are not suitable for a router/firewall (at least in my experience). I’m not that concerned about it though.

        • MigratingtoLemmy@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          4
          arrow-down
          1
          ·
          9 months ago

          OpenWRT isn’t half bad for usual “router stuff”, but advanced usage is a bit hard to do. Of course, that doesn’t eliminate the problem since ARM can have plenty of backdoors too

          • Dehydrated@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            arrow-down
            1
            ·
            9 months ago

            I know, I tried OpenWRT on a Pi, but the experience wasn’t great (at least not as a home router).

    • KairuByte@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      3
      ·
      9 months ago

      Wouldn’t that last bullet mean you’re not updating the windows machines whatsoever? Would this not cause more security issues in the long run, considering “connected tot he internet” isn’t a requirement to spread an infection.

      • Dehydrated@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        1
        ·
        9 months ago

        It might sound ridiculous, but I currently also run a WSUS server to get Windows updates. But I will probably replace my entire Windows setup with a better solution. Since I don’t run Windows bare-metal anymore, I’m looking forward to using offline Windows VMs on my Proxmox host and just accessing the internet directly from my Linux machine.

  • MostlyGibberish@lemm.ee
    link
    fedilink
    English
    arrow-up
    10
    ·
    edit-2
    9 months ago

    I’m not super paranoid about security, but I do try to have a few good practices to make sure that it takes more than a bot scanning for /admin.php to find a way in.

    • Anything with SSH access uses key-based auth with password auth disabled. First thing I do when spinning up a new machine
    • Almost nothing is exposed directly to the Internet. I have wireguard set up on all my devices for remote access and also for extra security on public networks
    • Anyone who comes to visit gets put on the “guest” network, which is a separate subnet that can’t see or talk to anything on the main network
    • For any service that supports creating multiple logins, I make sure I have a separate admin user with elevated permissions, and then create a non-privileged user that I sign in on other devices with
    • Every web-based service is only accessible with a FQDN which auto-redirects to HTTPS and has an actual certificate signed by a trusted CA. This is probably the most “paranoid” thing I do, because of the aforementioned not being accessible on the Internet, but it makes me happy to see the little lock symbol on my browser without having to fiddle around with trusting a self-signed cert.
    • MigratingtoLemmy@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      9 months ago

      Every web-based service is only accessible with a FQDN which auto-redirects to HTTPS and has an actual certificate signed by a trusted CA

      I’m assuming this is in your internal network. The problem with this is that communication from the client to the reverse-proxy (unless you’re running a reverse-proxy sandboxed with each application/are directly decrypting traffic at the base of your application) is encrypted, but the traffic from the server to the reverse-proxy is not.

      • MostlyGibberish@lemm.ee
        link
        fedilink
        English
        arrow-up
        2
        ·
        9 months ago

        Definitely a consideration. In my case, the vast majority of my services are running in docker on a single host box, including the reverse proxy itself (Traefik). That unencrypted traffic never goes out over a wire, so for now I’m not concerned.

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

          Bonus points for creating lots and lots of networks grouping the databases together with only their respective containers.

          ip a is a huge mess.

  • Treczoks@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    9 months ago

    I’ve got systems that can detect suspicious activities in the net, which result in a shutdown of the router. And not like “could you please shut down” but a hard power off type of shutdown.

    • MigratingtoLemmy@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      9 months ago

      Oh, you have a setup that signals to your power source to shut off internet when it detects an anomaly on the internet? That’s quite specific, and I’m having trouble trying to understand the use-case here, but it’s definitely included in the paranoid-list. Thanks!