TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Linux Hardening Checklist

42 pointsby petecooper10 months ago

8 comments

redundantly10 months ago
I'm not a fan of security checklists that don't provide an explanation or references on why something is or isn't a high priority item.
评论 #41026033 未加载
评论 #41026054 未加载
评论 #41028159 未加载
ementally10 months ago
I doubt a 5 year old hardening is any relevant today. I would stick to a well researched article like Privsec[0] where they explain the reasoning for each step.<p>[0] <a href="https:&#x2F;&#x2F;privsec.dev&#x2F;posts&#x2F;linux&#x2F;desktop-linux-hardening&#x2F;" rel="nofollow">https:&#x2F;&#x2F;privsec.dev&#x2F;posts&#x2F;linux&#x2F;desktop-linux-hardening&#x2F;</a>
评论 #41026285 未加载
评论 #41026632 未加载
irundebian10 months ago
I thought about developing a community based open (CC0 licensed) hardening standard and tool which allows giving more details about the system to be hardened to cover even more hardening options. I&#x27;m working as an Information Security Auditor and most companies I have audited are using CIS standards for this. While they are free, they are proprietary and you are not allowed to build products on top of these standards. Additionally these standards are relatively generic and I don&#x27;t know anybody who knows the decision process on their standards. Also, the Windows standards doesn&#x27;t even recommend using Windows application allowlisting functionalities such as AppLocker or WDAC.
josephcsible10 months ago
The advice in this checklist is horrendously bad and nobody should follow it. Details:<p>&gt; Restrict &#x2F;usr partition mount options. Example: UUID=&lt;...&gt; &#x2F;usr ext4 defaults,nodev,ro 0 2<p>Mounting &#x2F;usr read-only will break system updates, and it&#x27;s worthless from a security perspective, since nothing in &#x2F;usr is writable by anyone but root, and root is capable of remounting it read-write. Ditto for the same advice about &#x2F;boot. Also, nodev is only useful on things unprivileged users can mount, like external media, since on internal partitions like &#x2F;usr, once again, only root can do mknod, and root can remove the nodev mount option too.<p>&gt; Restrict &#x2F;proc partition mount options. Example: proc &#x2F;proc proc defaults,hidepid=2 0 0<p>Setting hidepid=2 is a really, really breaking change. I&#x27;d never even consider doing that on a production system without extensively testing every piece of it with that on first. And since it&#x27;s only security-through-obscurity and not real security, it&#x27;s approximately never worth doing so.<p>&gt; Polyinstantiated directories<p>A really common use case of &#x2F;tmp and &#x2F;var&#x2F;tmp is to transfer files between local user accounts, when your home directory is something like a Kerberized NFS mount where you can&#x27;t give each other direct access. Polyinstantiating those directories breaks that.<p>&gt; Protect Single User Mode with root password. Example: # Edit &#x2F;etc&#x2F;sysconfig&#x2F;init. SINGLE=&#x2F;sbin&#x2F;sulogin<p>This is actively harmful for security, because now you need to give the root account a password and leave it unlocked, instead of having it locked out and only allowing root access via sudo. And the protection it does offer is trivially bypassable by, e.g., a LiveUSB boot.<p>&gt; chmod og-rwx &#x2F;etc&#x2F;grub.conf chmod -R og-rwx &#x2F;etc&#x2F;grub.d<p>Seems like security through obscurity. Nothing sensitive belongs in either of those places.<p>&gt; ExecShield protection. Example: echo &quot;kernel.exec-shield = 2&quot; &gt; &#x2F;etc&#x2F;sysctl.d&#x2F;50-exec-shield.conf<p>ExecShield tries to emulate the NX bit on x86 CPUs that don&#x27;t have it. All such CPUs are now so old that unless you&#x27;re doing something like <a href="https:&#x2F;&#x2F;yeokhengmeng.com&#x2F;2018&#x2F;01&#x2F;make-the-486-great-again&#x2F;" rel="nofollow">https:&#x2F;&#x2F;yeokhengmeng.com&#x2F;2018&#x2F;01&#x2F;make-the-486-great-again&#x2F;</a>, any system where it makes sense to use this is so old that the software you&#x27;ll be running on it will be full of unpatched critical security holes.<p>&gt; Update password policy (PAM). Secure &#x2F;etc&#x2F;login.defs password policy.<p>This is exactly the kind of password advice that NIST has now has been admitting is harmful for years. You shouldn&#x27;t require special characters, and you shouldn&#x27;t require 60-day password changes.<p>&gt; Set auto logout inactive users. Example:<p><pre><code> &gt; echo &quot;readonly TMOUT=900&quot; &gt;&gt; &#x2F;etc&#x2F;profile.d&#x2F;idle-users.sh &gt; echo &quot;readonly HISTFILE&quot; &gt;&gt; &#x2F;etc&#x2F;profile.d&#x2F;idle-users.sh &gt; chmod +x &#x2F;etc&#x2F;profile.d&#x2F;idle-users.sh </code></pre> This fundamentally misunderstands what logout means. If you&#x27;re logged in to a graphical session and have a bunch of terminal windows open, you don&#x27;t want each one closing after 15 minutes of idle in itself. And it doesn&#x27;t even work; if you&#x27;re idle in a text editor or something, that won&#x27;t do anything. And it has nothing to do with HISTFILE, so I&#x27;m not sure why that&#x27;s included at all.<p>&gt; unlock_time=never<p>This neglects the availability component of the CIA triad. Now it&#x27;s trivial for an attacker to DoS your system by locking out all of your accounts at once.<p>&gt; Disable uncommon filesystems.<p>All EFI hosts need an EFI System Partition that uses vfat, so it&#x27;s definitely not uncommon. This error is so obvious that it makes me doubt the rest of this list.
ok12345610 months ago
Mounting &#x2F;usr ro would make it hard to apply updates.
nprateem10 months ago
Missing &quot;install Crowdstrike&quot;
PUSH_AX10 months ago
I see the rationales are on the todo. But this feels useless without it.
iefbr1410 months ago
It would be nice if it would also mention the reason for each measure.