News for hackers. Stuff that matters.
Re:Show HN: Lockdown.sh Simple shell script for locking down... by amarshall on Sunday May 24, 2020 @01:16PM (#23292963)
> [top of readme] lockdown a newly installed linux os

> [bottom of readme] Supported OS: Debian

Not all Linux is Debian or a Debian derivative.

> Remounts /tmp /proc /dev /run to be more restrictive

Unfortunately it only appears to remount, which will not persist across reboots (unless I’m missing something).

> Restrict access to compilers

Is this actually meaningful from a security perspective? If one can get some source onto a machine and execute a compiler and then execute that binary, how is that substantially different than them just getting a binary onto the machine and executing that instead?

Re:Show HN: Lockdown.sh Simple shell script for locking down... by q3k on Sunday May 24, 2020 @01:58PM (#23293256)
> Unfortunately it only appears to remount, which will not persist across reboots (unless I’m missing something).

Yeah and then it also reboots immediately. What's the point? Has this even been tested?

Re:Show HN: Lockdown.sh Simple shell script for locking down... by hwerehqrw on Sunday May 24, 2020 @01:42PM (#23293150)
the whole script is a beautiful exercise in cargo-cult security

it's so far out there that I almost think it's intended as performance art, rather than something anyone is supposed to actually use

Re:Show HN: Lockdown.sh Simple shell script for locking down... by q3k on Sunday May 24, 2020 @01:57PM (#23293244)

    # Add legal banner
    echo "
    Unauthorized access to this server is prohibited.
    Legal action will be taken. Disconnect now.
    " > /etc/issue
Heh.
Re:Show HN: Lockdown.sh Simple shell script for locking down... by pero_p on Sunday May 24, 2020 @09:38PM (#23296848)
Cute
Re:Show HN: Lockdown.sh Simple shell script for locking down... by igetspam on Sunday May 24, 2020 @05:36PM (#23295035)
We already have sensible OS level and app level baselines in CIS workbenches. There's also code to apply the policies and check the policies. It's nice that this is an attempt to set some kind of sanity in a single shell script but unless the author is a known quantity expert in this area, it's not a good idea to use this, unless you are also capable of vetting this code, in which case you probably don't need it.
Re:Show HN: Lockdown.sh Simple shell script for locking down... by getcrunk on Monday May 25, 2020 @02:27AM (#23298547)
Can u reccomended somethings I can refer to?
Re:Show HN: Lockdown.sh Simple shell script for locking down... by ivan_ah on Sunday May 24, 2020 @01:20PM (#23292988)
Wow nice! This will be useful both for expert users who can go through and learn about various security options and apply manually, but also useful for non-expert users who can just run the script.
Re:Show HN: Lockdown.sh Simple shell script for locking down... by amarshall on Sunday May 24, 2020 @01:28PM (#23293063)
> useful for non-expert users who can just run the script.

Running random scripts one doesn’t understand as root has its potential problems, though. Non-experts should still audit what this script (or any script requiring elevated privileges) is doing and strive to understand it.

Re:Show HN: Lockdown.sh Simple shell script for locking down... by ivan_ah on Sunday May 24, 2020 @02:08PM (#23293319)
True that. After looking through the script in more details, I wouldn't recommend running without checking. I thought it was doing just basic ssh + firewall, but it does a lot more things, so probably better to run piecemeal even for non-experts.

Maybe this could be turned into some interactive script that explains a little (in beginner-friendly language) what each step does? It would be also nice to have a log of which steps were performed, and instructions for the undo-step in case users want to go back... wishlist.append( ^ ).

Re:Show HN: Lockdown.sh Simple shell script for locking down... by rmrfstar on Monday May 25, 2020 @05:17AM (#23299430)
This is a reasonable jumping off point for someone newly interested in hardening a bare-metal Debian deployment. [1,2] are also quite good.

[1] https://github.com/Whonix/security-misc

[2] https://forums.whonix.org/t/fixing-the-desktop-linux-securit...

Re:Show HN: Lockdown.sh Simple shell script for locking down... by mathiasrw on Sunday May 24, 2020 @07:20PM (#23295835)
Would love to see this as an interactive informing and asking leaving you with the parts you want.
Re:Show HN: Lockdown.sh Simple shell script for locking down... by x8d on Monday May 25, 2020 @05:52PM (#23305342)
Hey, thanks for the feedback. I've just updated it so each section prompts you with the commands its about to run and whether or not to run them.