Latest / CyberSecurity Summary / Mastering Linux Security and Hardening: A practical guide to protecting your Linux system from cyber attacks
Transcript
- 0:00Speaker 1: Welcome to the deep dive. Today, we're tackling Linux security
- 0:04Speaker 1: and hardening. It's not just about servers anymore, is it.
- 0:08Speaker 1: I mean Linux is everywhere now, cloud stuff, IoT devices,
- 0:13Speaker 1: even your smart fridge maybe.
- 0:15Speaker 2: Right, So understanding how to lock these systems down is
- 0:19Speaker 2: becoming way more critical.
- 0:20Speaker 1: So our goal in this deep dive is really to
- 0:22Speaker 1: pull out the most practical, actionable stuff from our sources
- 0:26Speaker 1: help you build a more secure Linux setup exactly.
- 0:28Speaker 2: We've gone through a lot of material covers pretty much
- 0:31Speaker 2: everything from like the initial setup to more advanced things
- 0:35Speaker 2: intrusion prevention, data protection, all that. Okay, we'll hit on updates, firewalls.
- 0:39Speaker 2: Think of those as your digital border control, h encryption
- 0:43Speaker 2: obviously access control, who gets to do what, and you know,
- 0:46Speaker 2: tools to spot threats. We want to give you real
- 0:48Speaker 2: world knowledge, but without drowning you in jargon.
- 0:52Speaker 1: Good and to make it practical. A lot of the
- 0:55Speaker 1: source materials suggests using virtual box for practice environments.
- 0:59Speaker 2: Yeah, that's a great tip. Virtual box is fantastic. It's free,
- 1:02Speaker 2: runs on almost anything, Windows, Linux, Mac.
- 1:05Speaker 1: Even Solaris apparently.
- 1:06Speaker 2: Ah yeah, if you're feeling nostalgic, and the examples will
- 1:09Speaker 2: draw on used various Linux versions Bontouo server, Sento seven,
- 1:14Speaker 2: Analynux eight eight and nine, Fedora two. So good mix, okay,
- 1:19Speaker 2: And for anyone listening who's on Windows, connecting to those
- 1:23Speaker 2: Linux vms is key, right right. So the sources mentioned
- 1:26Speaker 2: tools like siguin or you know, the built in SSH
- 1:28Speaker 2: client in Windows ten and eleven, they get you into
- 1:31Speaker 2: your Linux lab.
- 1:32Speaker 1: Perfect. Okay, So where do we start.
- 1:34Speaker 2: Let's dive right in with the absolute foundation.
- 1:38Speaker 1: Keeping systems updated updates always fun, though I guess it's
- 1:42Speaker 1: maybe less painful on Linux than say Windows sometimes.
- 1:46Speaker 2: Generally, yeah, it's often more streamlined, but it's completely non
- 1:50Speaker 2: negotiable for security, you've got to patch those vulnerabilities. Think
- 1:53Speaker 2: of it like regular checkups for your system's health.
- 1:57Speaker 1: Makes sense. So how does it work on say a
- 1:59Speaker 1: Buntu or Debi based systems.
- 2:00Speaker 2: Pretty simple? Actually, two main steps. First, apped update that
- 2:04Speaker 2: just refreshes the list of what packages are available, like
- 2:06Speaker 2: checking the catalog. Then apped upgrade that's the part that
- 2:10Speaker 2: actually downloads and installs the new versions. Puts the potentially
- 2:13Speaker 2: more secure stuff in place.
- 2:14Speaker 1: And you can automate this, right, I think I saw
- 2:16Speaker 1: something about that.
- 2:17Speaker 2: You absolutely can on a Buntu, you can tweak a
- 2:19Speaker 2: file at captaped dot com dot D twenty auto auto upgrades.
- 2:23Speaker 2: Right inside there, there's a setting apt dot periodic dot
- 2:26Speaker 2: unattended upgrade. You can set it to one one for
- 2:29Speaker 2: fully automatic.
- 2:29Speaker 1: Installs, or you can just get notified.
- 2:31Speaker 2: Exactly set it to zero one to disable the installed part.
- 2:34Speaker 2: But you can still configure it to download or just
- 2:36Speaker 2: notify you. Gives you that balance, you know, convenience versus control.
- 2:40Speaker 1: Nice? And what about the red hat world CentOS on
- 2:44Speaker 1: my Linux?
- 2:44Speaker 2: Similar idea, different commands. You'll use YUM on older stuff
- 2:47Speaker 2: like Cento AS seven or DNF on the newer ones
- 2:51Speaker 2: like Almal Linux eight and nine. Same principle, they'll get
- 2:53Speaker 2: those security patches installed.
- 2:55Speaker 1: And if you really want to stay on top of vulnerabilities.
- 2:57Speaker 2: The CVE database is your friend, Common Vulnerabilities and Exposures.
- 3:01Speaker 2: It's at CVET minor dot org. Basically the public library
- 3:07Speaker 2: of known security flaws, central reading.
- 3:10Speaker 1: Really okay, updates covered next up firewalls building those digital walls.
- 3:15Speaker 2: Yes, the bouncers for your network traffic, deciding who gets
- 3:19Speaker 2: in who stays out.
- 3:20Speaker 1: And for Ubuntu, the go to seems to be uf
- 3:24Speaker 1: uncomplicated firewall.
- 3:26Speaker 2: That's the one. Don't let the name fool you though.
- 3:28Speaker 2: It's pretty capable for common tasks enabling it, disabling.
- 3:32Speaker 1: It, allowing specific things like SSH so you don't lock
- 3:35Speaker 1: yourself out crucial point.
- 3:36Speaker 2: Yeah yeah, oof to allows sefsh is probably one of
- 3:38Speaker 2: the first rules you'll set. It manages the underlying rules
- 3:41Speaker 2: for you.
- 3:41Speaker 1: So UFOs is like a front end for eptables or
- 3:44Speaker 1: NF tables exactly.
- 3:46Speaker 2: It simplifies managing them. On older systems, it was mainly iptables.
- 3:50Speaker 2: Newer Ubuntu uses NF tables by default. Now okay, but
- 3:53Speaker 2: oof is smart enough to translate your simple commands into
- 3:55Speaker 2: the right rules for whichever back end is running. So
- 3:58Speaker 2: even with NF tables handles the complexity.
- 4:01Speaker 1: But understanding the basics of how iptables or NF tables work,
- 4:04Speaker 1: chains rules matching packets is still useful.
- 4:07Speaker 2: Oh definitely. It helps understand why the rules work. And
- 4:10Speaker 2: modern firewalls like these are stateful stateful meaning meaning they
- 4:14Speaker 2: track active connections. So if you initiate a connection out,
- 4:18Speaker 2: the firewall knows to allow the return traffic for that
- 4:20Speaker 2: specific conversation. It's much smarter than just basic packet filtering.
- 4:24Speaker 2: Big security advantage.
- 4:25Speaker 1: Gotcha. Now shifting to red hat systems, firewalled is the
- 4:29Speaker 1: tool there, yep.
- 4:31Speaker 2: Firewalled similar goal to rent managing rules, but it works
- 4:34Speaker 2: a bit differently. You check its status, make sure it's.
- 4:36Speaker 1: Running, and it uses zones, right. What's that about?
- 4:38Speaker 2: Zones are a key concept like public home, internal DMZ.
- 4:44Speaker 2: Each zone has a default trust level and a set
- 4:46Speaker 2: of allowed services.
- 4:47Speaker 1: Or ports, So you assign network interfaces to zones precisely.
- 4:51Speaker 2: Your public facing web servers interface might be in the
- 4:53Speaker 2: public zone, which is typically quite restrictive, and internal database
- 4:57Speaker 2: server might be in a more trusted internal zone.
- 4:59Speaker 1: And you add services like sshhttp HTTPS to specific zone.
- 5:03Speaker 2: Exactly firewall CMD zone, public AD service permanent. That kind
- 5:07Speaker 2: of thing permanent makes the change stick after a reboot.
- 5:09Speaker 1: You can also add specific ports right like for DNS.
- 5:12Speaker 2: Yeah fort fifty three. For DNS, TCP and UDP, you
- 5:15Speaker 2: can specify the protocol firewall cmd ad port fifty three TCP.
- 5:19Speaker 1: Interesting point about blocking ICMP like pings is that generally
- 5:23Speaker 1: a good idea well, it.
- 5:24Speaker 2: Can reduce your system's visibility slightly, but blocking pings specifically
- 5:29Speaker 2: ICMP type eight echo requests and type zero echo replies
- 5:33Speaker 2: can sometimes make troubleshooting harder. Our sources suggests maybe blocking
- 5:37Speaker 2: redirect messages type five is more useful, but yeah, you
- 5:40Speaker 2: might allow pings temporarily if you're diagnosing network issues.
- 5:43Speaker 1: Okay. And firewalled has a panic mode. Sounds dramatic.
- 5:47Speaker 2: It is. It's like the big red button if you
- 5:49Speaker 2: think you're under active attack. Firewall cmd panic on. It
- 5:53Speaker 2: drops all network traffic in and out instantly isolates the system. Wow.
- 5:57Speaker 1: Okay, hopefully not need it often. And logging, can you
- 5:59Speaker 1: see it's being blocked?
- 6:00Speaker 2: Yes, boken log drop packets with check varlog, curn dot
- 6:04Speaker 2: log usually okay. With firewalled on RHL type systems, it's
- 6:08Speaker 2: typically varlog messages really useful for seeing if your rules
- 6:11Speaker 2: are working as expected or something legitimate is being blocked.
- 6:14Speaker 1: The sources mentioned rich rules in Fireworld. What are those?
- 6:18Speaker 2: Ah? Rich rules give you much more fine grain control.
- 6:22Speaker 2: You can create rules based on source, IP destination, port
- 6:25Speaker 2: protocol specific actions.
- 6:29Speaker 1: Very powerful, more complex than just adding a service.
- 6:31Speaker 2: Way more flexible. Yeah, let's you build really specific policies.
- 6:35Speaker 1: And you can directly mess with iptables or NF tables
- 6:38Speaker 1: even when using Fireworld. But maybe shouldn't.
- 6:40Speaker 2: Generally Yeah, especially with the direct rules feature in firewalled. Yeah,
- 6:44Speaker 2: it's usually best to stick to the standard zone and
- 6:46Speaker 2: service commands or rich rules. Direct rules are powerful, but
- 6:50Speaker 2: easier to mess up and break your firewall. Last resort
- 6:53Speaker 2: really got it?
- 6:54Speaker 1: Okay, firewall's done. Let's talk encryption. Keeping secret secret absolutely.
- 6:58Speaker 2: Essential scrambling data to only the right people or systems
- 7:02Speaker 2: with a key can read.
- 7:03Speaker 1: It, and Linux has quite a few tools for this.
- 7:05Speaker 2: It does for individual files, GPGG and U. Privacy Guard
- 7:08Speaker 2: is a classic.
- 7:09Speaker 1: Very romantic, symmetric and asymmetric YEP.
- 7:12Speaker 2: Symmetric uses one secret key for both locking and unlocking.
- 7:17Speaker 2: Asymmetric uses a key pair public key to encrypt, private
- 7:20Speaker 2: key to decrypt. The sources touch on creating keys, which
- 7:23Speaker 2: involves understanding randomness or entropy for strong.
- 7:27Speaker 1: Keys okay, and for whole discs or partitions.
- 7:30Speaker 2: LUKS is the standard Linux unified key setup. Great for
- 7:34Speaker 2: adding a new encrypted drive or encrypting a USB stick.
- 7:37Speaker 2: You set a passphrase to unlock it right. Usually happens
- 7:40Speaker 2: a boot time or when you plug the device.
- 7:42Speaker 1: In, and E crypts that was for encrypting directories exactly.
- 7:45Speaker 2: It encrypts just a specific folder within your file system
- 7:48Speaker 2: creates an encrypted layer.
- 7:49Speaker 1: How does that work in practice?
- 7:50Speaker 2: You use a moult command basically mountain x t crypt's
- 7:54Speaker 2: path do encrypted past to mount point. It asks for
- 7:56Speaker 2: a passphrase encryption settings. Then your files are purity ECRYPTI
- 8:00Speaker 2: in the mount point, but are stored encrypted underneath.
- 8:02Speaker 1: Clever. Okay, move into network encryption TLSSSL certificates. We have
- 8:06Speaker 1: to talk about Let's encrypt.
- 8:08Speaker 2: Oh yeah, Let's encrypt has been a massive game changer.
- 8:10Speaker 2: Free automated TLS certificates made HTTPS way more accessible compared to.
- 8:15Speaker 1: The traditional certificate authorities.
- 8:17Speaker 2: Right. Traditional cas often cost money, involve more manual validation,
- 8:22Speaker 2: but might offer different warranty levels or support options. Depends
- 8:25Speaker 2: on your needs.
- 8:26Speaker 1: And sometimes you need to create your own self signed SERTs.
- 8:30Speaker 2: Yeah, for internal testing maybe development. You use the open
- 8:33Speaker 2: as a cell toolkit for that.
- 8:34Speaker 1: The sources mentioned RSA and elliptic curve keys and NIST recommendations.
- 8:39Speaker 2: Yep OpenSL can create both. NIST is recommending stronger keys
- 8:43Speaker 2: now think three seventy two bit RSA or three hundred
- 8:47Speaker 2: four bit ecdsa minimum.
- 8:49Speaker 1: Why the push for stronger keys partly?
- 8:51Speaker 2: Faster computers but also looking ahead to quantum computing longer
- 8:55Speaker 2: RSA keys can have a slight performance hit, though elliptic
- 8:58Speaker 2: curve is often faster for the same secure level.
- 9:00Speaker 1: Interesting dog tag came up too.
- 9:02Speaker 2: What's that dog tag? Is more of an enterprise thing.
- 9:04Speaker 2: A full certificate system like running your own internal caa
- 9:07Speaker 2: much bigger scale than just making one offserts with open
- 9:10Speaker 2: SSL more complex.
- 9:11Speaker 1: Too, and red hat has system wide crypto policies.
- 9:14Speaker 2: Now yeah, RHL eight and later, let's use set a
- 9:17Speaker 2: policy like default or legacy or future future.
- 9:20Speaker 1: Being the strongest right.
- 9:22Speaker 2: Enforces stronger algorithms and protocols across the whole system. SSHTLS
- 9:26Speaker 2: everything helps keep things consistent. They also have fits mode
- 9:28Speaker 2: for government.
- 9:29Speaker 1: Compliance and even mentions of quantum resistant encryption.
- 9:32Speaker 2: Looking way ahead, it's on the horizon, something to keep
- 9:35Speaker 2: an eye on for long term data protection.
- 9:37Speaker 1: Okay, fascinating stuff. Let's pivot to who gets access to
- 9:40Speaker 1: what on this system. Discretionary access control or.
- 9:43Speaker 2: DS the absolute basics of Linux permissions, file ownership and
- 9:47Speaker 2: read write execute permissions.
- 9:49Speaker 1: So chound to change the owner or.
- 9:52Speaker 2: Group yep, chound user dot group file name. Pretty straightforward
- 9:55Speaker 2: and shod.
- 9:56Speaker 1: For the permissions themselves using letters or numbers.
- 9:58Speaker 2: Both work. Symbol mode uses r WX for read, write, execute,
- 10:03Speaker 2: and plus or to add or remove permissions for user, U, group,
- 10:07Speaker 2: G or others. Oh like chamaud U plus xscript, dot sh.
- 10:11Speaker 1: And the numbers octal mode.
- 10:13Speaker 2: Right each permission. R w X has a number four
- 10:16Speaker 2: two one you atom up for each category, user, group, other,
- 10:18Speaker 2: So r WX is four plus two plus one and
- 10:20Speaker 2: plus seven. R w is four plus two plus two
- 10:23Speaker 2: U plus.
- 10:23Speaker 1: Six R is four ah so six forty four. For
- 10:25Speaker 1: a file means owner gets read right, six, group gets
- 10:28Speaker 1: read four, others get read four.
- 10:29Speaker 2: Exactly and seven to fifty five. For a directory is common.
- 10:33Speaker 2: Owner gets read right, execute seven, group and others get
- 10:36Speaker 2: red execute five Xcute on a directory means you can
- 10:38Speaker 2: enter it.
- 10:39Speaker 1: What about permissions like six hundred or seven hundred. That's
- 10:41Speaker 1: a litt quiz you mentioned.
- 10:43Speaker 2: Yeah. Six hundred means only the owner can read and write.
- 10:45Speaker 2: Very common for private files like SSH keys. Seven hundred
- 10:49Speaker 2: means only the owner can read, write, and executor. Good
- 10:52Speaker 2: for private directories.
- 10:53Speaker 1: Okay, special permissions too. SUI D and sg D they
- 10:57Speaker 1: sound risky.
- 10:58Speaker 2: They can be sid set user ID on an executable
- 11:02Speaker 2: means it runs with the permissions of the file's owner,
- 11:05Speaker 2: not the person running it.
- 11:06Speaker 1: So if root owns a SUID file.
- 11:08Speaker 2: Anyone running it runs it as route. Big security risk
- 11:11Speaker 2: if that program has flaws. Privileged escalation waiting to happen.
- 11:14Speaker 1: And SGID is similar, but for the.
- 11:16Speaker 2: Group YEP runs with the file's group privileges necessary for
- 11:19Speaker 2: some things like the passode command needs SUID to modify
- 11:22Speaker 2: the shadow password file, but you need to be careful.
- 11:25Speaker 1: How do you find these files?
- 11:27Speaker 2: The fine command is great for that. Find it g
- 11:29Speaker 2: tite F SUID nactusq and R NASHU four thousand, NASHUR
- 11:32Speaker 2: two thousand ECGLS that searches for files with either the
- 11:36Speaker 2: SUISH four thousand or SGID Nashua two thousand bit set.
- 11:40Speaker 1: Good to know. Beyond standard permissions, there are extended attributes.
- 11:44Speaker 2: Yeah check command. Let's use set extra flags like chat
- 11:47Speaker 2: plus I file name.
- 11:49Speaker 1: What does plus I do?
- 11:50Speaker 2: Makes the file immutable? Can't be changed, deleted, renamed anything,
- 11:55Speaker 2: even by route until you remove the flag with chat
- 11:58Speaker 2: R great for protecting credit config files.
- 12:01Speaker 1: And access control lists ACLS for more specific permissions.
- 12:04Speaker 2: Right standard permissions are just owner, group others. ACLS let
- 12:09Speaker 2: you give permissions to specific additional users or groups.
- 12:11Speaker 1: How do you manage those?
- 12:13Speaker 2: Set faclmu dot username dot rw filename to give a
- 12:17Speaker 2: specific user ReadWrite get facul file name to see the ACLS.
- 12:21Speaker 1: There's a mask too.
- 12:22Speaker 2: Yeah, the mask can limit the effective permissions for named
- 12:24Speaker 2: users and groups added via ACLS. It's an extra layer
- 12:27Speaker 2: of control. You can remove ACLS with set facul maxx.
- 12:30Speaker 1: Okay lots control. Air Let's shift to managing user accounts themselves.
- 12:34Speaker 1: Account security using pseudo instead of root login seems key.
- 12:39Speaker 2: Absolutely fundamental. Logging in is route all the time is
- 12:41Speaker 2: just too risky. Pseudo let's specific users run specific commands
- 12:44Speaker 2: as route or another user using their own passwords. And
- 12:47Speaker 2: if it's better auditing for one pseudologs who ran what? Plus,
- 12:51Speaker 2: you don't need to share the actual root password less.
- 12:54Speaker 1: Exposure and you can figure it with the pseudo editing
- 12:58Speaker 1: at serdalos of suters.
- 12:59Speaker 2: Correct the pseudo locks the file and check syntax before saving,
- 13:03Speaker 2: which is fafor. You can define rules there grant permissions
- 13:07Speaker 2: to users or better yet.
- 13:08Speaker 1: Groups like the wheel group. On some systems, exactly.
- 13:11Speaker 2: Add users to the wheel group, then give that group
- 13:14Speaker 2: pseudo rights and asceted to suitors. You can also set
- 13:17Speaker 2: things like requiring a password every time defaults, time stamp
- 13:20Speaker 2: timeout zero.
- 13:21Speaker 1: You can get really specific with command aliases too, right,
- 13:24Speaker 1: but be careful.
- 13:25Speaker 2: You can create aliases for groups of users or commands,
- 13:28Speaker 2: but broad command aliases like allowing all commands and users
- 13:32Speaker 2: men can accidentally grant way more power than you intended.
- 13:35Speaker 2: Be specific.
- 13:36Speaker 1: Can you allow users to run commands as other users,
- 13:38Speaker 1: not just route?
- 13:39Speaker 2: Yes, other user command The tuterit does file lets you
- 13:42Speaker 2: specify which users a user can run commands as, and.
- 13:45Speaker 1: No pass WD entries avoid those generally.
- 13:48Speaker 2: Yes, very risky. It lets users run pseudo commands without
- 13:53Speaker 2: any password. Prompt only use it if absolutely necessary and
- 13:57Speaker 2: for very specific limited commands.
- 13:59Speaker 1: Good warning and a reminder about default accounts passwords on
- 14:02Speaker 1: IoT devices, change them immediately critical.
- 14:06Speaker 2: That's often the first thing attackers try publicly known defaults
- 14:09Speaker 2: are a huge vulnerability.
- 14:11Speaker 1: The source is also compared to aducer and user ad
- 14:14Speaker 1: What's the difference?
- 14:15Speaker 2: Aducer is usually more interactive, friendlier prompts you for info,
- 14:18Speaker 2: creates the home directory, copy skeleton files.
- 14:21Speaker 1: Can even encrypt the home directory.
- 14:23Speaker 2: Yeah, if you have ecris utils installed aducer can set
- 14:25Speaker 2: that up automatically. User ad is lower level, less interactive,
- 14:29Speaker 2: more script friendly maybe, but you have to do more
- 14:31Speaker 2: set up manually.
- 14:32Speaker 1: Okay, let's talk passwords. Enforcing strong ones with PAM.
- 14:36Speaker 2: PAM pluggable Authentication modules is the framework Linux uses for authentication.
- 14:40Speaker 2: The punked hamduck You'll quality dot so module checks password strength.
- 14:44Speaker 1: How do you configure it?
- 14:45Speaker 2: In files? Under it set a channel d usually in
- 14:48Speaker 2: system auth or password oth or similar common files. You
- 14:51Speaker 2: can set minimum length, require different character types upper case, lowercase, digits,
- 14:56Speaker 2: symbols prevent dictionary words, yep it checks again dictionaries and
- 15:00Speaker 2: common patterns helps prevent really weak passwords.
- 15:04Speaker 1: There's a debate about password expiration versus long pass phrases.
- 15:07Speaker 2: There is Forcing frequent changes often leads people to pick simpler,
- 15:11Speaker 2: guessable passwords or reuse patterns. The current thinking often leans
- 15:15Speaker 2: towards using longer, complex but memorable passphrases and not forcing
- 15:19Speaker 2: expiration unless there's a suspected compromise.
- 15:22Speaker 1: Makes sense, and the peel and Quality package helps On Debiandubuntu.
- 15:26Speaker 2: Yes provides tools in the library for this.
- 15:28Speaker 1: What about checking if passwords have been leaked in breaches
- 15:31Speaker 1: a good proactive step.
- 15:32Speaker 2: You can use APIs like the have a Been Pound
- 15:35Speaker 2: Passwords API. There are command line tools like using curl
- 15:39Speaker 2: to check a hash of your password against the database.
- 15:41Speaker 1: You check the hash, not the password itself.
- 15:43Speaker 2: Crucially, yes, you don't send your actual password. You send
- 15:46Speaker 2: a hash of it, and the service tells you if
- 15:48Speaker 2: that hash exists in the breach data. Much safer, okay.
- 15:52Speaker 1: And ensuring accounts don't stay active forever expiration policies.
- 15:56Speaker 2: The change command is for that changeyyyy mmddd. Username sets
- 16:00Speaker 2: an account expiration date.
- 16:02Speaker 1: Can you force a password change on next log in?
- 16:05Speaker 2: Yep change DoD zero username sets the last change date
- 16:08Speaker 2: to epoc zero forcing a change immediately.
- 16:11Speaker 1: What about locking accounts after too many failed logins? Route
- 16:14Speaker 1: force prevention.
- 16:14Speaker 2: Also done with PAM modules okay, pantally two. On older systems,
- 16:18Speaker 2: PAM faylock is more common now.
- 16:19Speaker 1: Can figure those in et cetera bat D as well.
- 16:21Speaker 2: Yes, typically in files like log ner slide. You said
- 16:24Speaker 2: how many failures trigger a lockout and for how long?
- 16:27Speaker 2: Critical defense?
- 16:28Speaker 1: Can you manually lock accounts too?
- 16:29Speaker 2: Sure? User modeage to L username locks it, user motag
- 16:33Speaker 2: to U unlocks or password to l and passwood you.
- 16:36Speaker 2: The output might differ slightly between distros, but they do
- 16:39Speaker 2: the job.
- 16:39Speaker 1: And finally, BIOCEUEFI security and using a checklist important basics.
- 16:43Speaker 2: Definitely secure boat firmwore passwords. Don't forget the physical or
- 16:48Speaker 2: firmware level, and a checklist helps ensure you cover all
- 16:50Speaker 2: the bases during setup.
- 16:52Speaker 1: Right, let's secure remote access SSH is king.
- 16:54Speaker 2: Here absolutely and securing SSH properly is paramount. First rule,
- 16:59Speaker 2: Use SAH keys, not just passwords.
- 17:02Speaker 1: Why are keys so much better?
- 17:04Speaker 2: They're way harder to root force. A strong key is
- 17:06Speaker 2: cryptographically secure, unlike potentially weak password. You generate a pair.
- 17:11Speaker 2: Private key stays with you. Public key goes on the server.
- 17:13Speaker 1: Generate with skegen recommendations on type and.
- 17:16Speaker 2: Size Yes, cheek and following this guidance, aim for at
- 17:19Speaker 2: least three seventy two bit RSA keys or maybe even
- 17:22Speaker 2: better three hundred and eighty four bit ECDSA keys, stronger
- 17:25Speaker 2: crypto okay.
- 17:26Speaker 1: Then get the public key onto the server's dotch authorized
- 17:29Speaker 1: keys file.
- 17:29Speaker 2: Right this chash copy aid user at host is the
- 17:31Speaker 2: easiest way, or just paste it in manually if you
- 17:33Speaker 2: have to.
- 17:34Speaker 1: Then crucially disabled password log in in et cetera. Strident
- 17:37Speaker 1: fig yes.
- 17:38Speaker 2: Set password authentication no, and also permit root log in no.
- 17:42Speaker 1: Permit root log in no is vital. Don't log in
- 17:44Speaker 1: directly as rootover SSH.
- 17:46Speaker 2: Best practice absolutely log in as a regular user, then
- 17:51Speaker 2: use pseudo. Some distros might default permit rootleg in differently,
- 17:54Speaker 2: so always check and set it to know.
- 17:56Speaker 1: What about two factor authentication for SSH, AD's another layer.
- 18:01Speaker 2: You can use things like Google Authenticator with PAM. Install
- 18:04Speaker 2: the PAM module them PAM Google Authenticator, configure it.
- 18:07Speaker 1: And then you need your key and a code from
- 18:09Speaker 1: your phone exactly.
- 18:11Speaker 2: Time based code makes it much harder for someone even
- 18:13Speaker 2: if they somehow get your private key.
- 18:15Speaker 1: Understanding the SSH encryption algorithms themselves seems important to disabling
- 18:19Speaker 1: weak ones definitely.
- 18:21Speaker 2: SSH uses symmetric ciphers for the main data key exchange
- 18:25Speaker 2: algorithms kex and max for integrity. You should disable older
- 18:29Speaker 2: weaker ones.
- 18:30Speaker 1: And should configure how do you know what you're weak?
- 18:32Speaker 2: Check currentness recommendations, security advisories. Tools like nmap with the
- 18:36Speaker 2: sish to enam algos script can show you what your
- 18:39Speaker 2: server offers. Then you can figure cipher's m max kex algorithms,
- 18:42Speaker 2: directives and should config to only allow strong ones.
- 18:45Speaker 1: And on Alma Linix nine. Those crypto policies help here too.
- 18:49Speaker 2: Yes, update crypto policies can manage the allowed SSH algorithms
- 18:52Speaker 2: based on the policy level, Default, future, et cetera.
- 18:55Speaker 1: Simplifies things, okay, beyond authentication controlling who can connect.
- 19:00Speaker 2: Several ways in should config allow users and allow groups,
- 19:03Speaker 2: let you white list specific users or groups. Host based
- 19:06Speaker 2: authentication that checks the client's host key requires careful setup
- 19:10Speaker 2: less common now TCP wrappers at costs, dot allow at coast,
- 19:14Speaker 2: dot deny are another layer based on client IP and firewalls.
- 19:18Speaker 2: Of course, In firewalls, as we discussed, limit access to
- 19:20Speaker 2: Port twenty two from trusted sources.
- 19:22Speaker 1: Automatic logout for idle SSH sessions good idea.
- 19:25Speaker 2: Yeah, prevents abandoned sessions being potentially hijacked. Set the tmout
- 19:29Speaker 2: environment variable. You can put it in a script and
- 19:31Speaker 2: etcetera profile dot D like export tmout six hundred for
- 19:34Speaker 2: ten minutes, make the script executable.
- 19:36Speaker 1: Disable x eleven forwarding.
- 19:38Speaker 2: Two if you don't need it, Yes, x eleven forwarding
- 19:40Speaker 2: no in should config. The x eleven protocol has some
- 19:43Speaker 2: known weaknesses.
- 19:44Speaker 1: Managing authorized keys files centrally. How does that work?
- 19:48Speaker 2: Instead of each user having their own YATCH authorized keys,
- 19:51Speaker 2: you can tell sig via authorized keysfile, and you you
- 19:54Speaker 2: canfig to look somewhere else like ETCeteras authorized keys percent,
- 19:58Speaker 2: where percent is.
- 19:59Speaker 1: The username and permissions are key.
- 20:01Speaker 2: There Absolutely that central directory and the key files should
- 20:04Speaker 2: typically be owned by root read only for root, keeps
- 20:07Speaker 2: users for modifying others. Keys for large scale commercial tools
- 20:11Speaker 2: exist too.
- 20:12Speaker 1: Okay. Last sshpoint SFTP only access, no shell.
- 20:16Speaker 2: Very common requirement. Create a dedicated group, say sitchpitzers, add
- 20:20Speaker 2: users to it, set their shell to something non interactive
- 20:23Speaker 2: that handles s FTP like this, her lives FTP server.
- 20:26Speaker 1: And configures didn't contact ye.
- 20:28Speaker 2: Use subsystem SFTP internal as FTP. Then add a match group,
- 20:32Speaker 2: press pussers block inside that block. Set crute directory path
- 20:35Speaker 2: the their data to lock them into a specific directory.
- 20:38Speaker 2: Set force command internal SFTP and allow TZP forwarding no
- 20:42Speaker 2: s eleven forwarding no, so.
- 20:43Speaker 1: They can only transfer files within their cruit jail exactly.
- 20:46Speaker 2: No shell access just SFTP and putty is a common
- 20:49Speaker 2: Windows client for SSHSFTP.
- 20:51Speaker 1: Great, okay, let's shift to intrusion detection and prevention spotting
- 20:55Speaker 1: the bad guys.
- 20:56Speaker 2: Right, we've talked prevention with firewalls, iptables and of tables.
- 20:59Speaker 2: Detect involves monitoring.
- 21:01Speaker 1: Snort came up as a network IDs and IDs.
- 21:04Speaker 2: Yes, snortwatches network traffic. Compares it to rules looking for
- 21:07Speaker 2: attack patterns. Running it in Docker or Podman can simplify setup.
- 21:12Speaker 2: Keeping its rules updated is critical.
- 21:14Speaker 1: Security Onion is more comprehensive, much more.
- 21:16Speaker 2: It's a whole platform, bundles idsps like Snortseracata, forensic tools,
- 21:22Speaker 2: log management, ELK stack. It's now often installed on Cento
- 21:26Speaker 2: seven text mode. Powerful, but more complex.
- 21:29Speaker 1: What about tools running on the Linux host itself for auditing?
- 21:32Speaker 2: Linus Linus is great scans your system, checks configuration against
- 21:36Speaker 2: security best practices, looks for hardening opportunities, gives detailed reports.
- 21:41Speaker 1: Free version available yep.
- 21:42Speaker 2: Open source version is very capable. Commercial versions add more features.
- 21:46Speaker 2: You can often find it in the EPO repo for
- 21:47Speaker 2: red hat systems. It checks kernel hardening too.
- 21:50Speaker 1: Kylie Linux is mentioned too.
- 21:52Speaker 2: Collie is more for penetration testing the athensive side, but
- 21:55Speaker 2: it contains tons of auditing tools you could use defensively too.
- 21:58Speaker 1: The sources were cautious about root kit scanners like rootkit
- 22:01Speaker 1: Hunter or screwtkit.
- 22:03Speaker 2: Yeah. The problem is advanced rootkits are designed to hide
- 22:05Speaker 2: from these tools. They might catch older or simpler ones,
- 22:08Speaker 2: but don't rely on them exclusively. Even appromore celenicx won't
- 22:12Speaker 2: stop the installation of rootkit, though they might limit what
- 22:14Speaker 2: it can do afterwards. Defense in depth is key.
- 22:17Speaker 1: Any quick malware analysis tips.
- 22:19Speaker 2: If you have a suspicious file, the strings command can
- 22:22Speaker 2: be useful. It just prints readable text found inside the file.
- 22:25Speaker 2: Might reveal URLs commands clues. Might need the by Noodle's
- 22:29Speaker 2: package for it.
- 22:30Speaker 1: And checking file hashes online.
- 22:32Speaker 2: Yeah, calculate the SAHA two five six hash of the file,
- 22:35Speaker 2: then search for that hash on virus total or similar sites.
- 22:38Speaker 2: See if it's known malware safer than running the file.
- 22:41Speaker 2: Don't upload sensitive files though, just check the hash.
- 22:44Speaker 1: Good advice. Final section general system hardening techniques, extra fortifications.
- 22:49Speaker 2: Right the finishing touches, secure boot, disabling unneeded services. Those
- 22:53Speaker 2: are basics. Then kernel hordening via systeale.
- 22:56Speaker 1: Tuning parameters in proxis yeah, and making them stick in
- 22:59Speaker 1: at stale dot com.
- 23:01Speaker 2: Exactly or files in at center STLDT lots of parameters
- 23:04Speaker 2: you can tweak.
- 23:05Speaker 1: For security examples like disabling ting responses.
- 23:08Speaker 2: Net dot IPv four dot icmpico an oreo one does that.
- 23:11Speaker 2: NED dot IPv four dot com dost sender cendris directs
- 23:14Speaker 2: zero disables sending ICMP.
- 23:16Speaker 1: Redirects TCP s y and cookies.
- 23:17Speaker 2: NED dot IPv four dot pcpc and cookies one helps
- 23:20Speaker 2: mitigate s y n flood dose attacks. Link protection f
- 23:23Speaker 2: s DOT protected hard links one and f s DOT
- 23:25Speaker 2: protected simblinks one protects against certain attacks using links in
- 23:28Speaker 2: worldwritable directories.
- 23:29Speaker 1: S u ID dumpable f s DOT sue.
- 23:31Speaker 2: Dumpable zero prevents core dumps from s yz g i
- 23:34Speaker 2: D programs, which could leak memory contents.
- 23:36Speaker 1: Address space layout randomization kernel.
- 23:38Speaker 2: DOT randomides of VAS based two makes buffer overflow exploits
- 23:41Speaker 2: harder by randomizing memory locations.
- 23:43Speaker 1: Essential restricting kernel info colonel.
- 23:45Speaker 2: Dot dm s korrestrict one limits who can read kernel
- 23:48Speaker 2: logs via d sdi E dot colonel dot ap director
- 23:50Speaker 2: at one or two hides kernel pointer addresses in proc,
- 23:54Speaker 2: reduces info leaks.
- 23:55Speaker 1: Control groups and name spaces were mentioned too.
- 23:58Speaker 2: Yeah Kernel features for isolation c groups limit resource usage
- 24:02Speaker 2: CPU memory per process group helps prevent resource exhaustion. A
- 24:06Speaker 2: name spaces give processes isolated views of things like network PIDs, mounts,
- 24:11Speaker 2: foundation for containers.
- 24:12Speaker 1: Final Capabilities ss CAP more granular privileges capabilities that you
- 24:17Speaker 1: give specific root like powers to a process without making
- 24:20Speaker 1: it fully root.
- 24:21Speaker 2: Set cap lets you restrict which system calls a process
- 24:24Speaker 2: can even make drastically limits a tack surface.
- 24:27Speaker 1: Hand Boxing technology seem important for isolating apps. Fire Jail.
- 24:31Speaker 2: Fire Jail uses suid to sandbox applications, restricts filesystem access, network,
- 24:37Speaker 2: et cetera. Mostly for desktop apps. The suid bit makes
- 24:40Speaker 2: some admins nervous on servers, though.
- 24:41Speaker 1: Snaps and flat pass.
- 24:43Speaker 2: Yeah the package formats but also provide sand boxing. Snaps
- 24:46Speaker 2: ubintu have automatic updates. Ubuntu Core uses snaps for the
- 24:49Speaker 2: whole OS Good Fryot, flat Pack, Fedora others also sandboxes. Updates,
- 24:54Speaker 2: usually managed via the flatub repository or similar manual updates often.
- 24:58Speaker 1: What about anti malware clamavo good to have even on
- 25:02Speaker 1: Linux install clamavvy enable clam av fresh clam service for
- 25:06Speaker 1: auto updates.
- 25:07Speaker 2: Lm D Linux maor detect is another option. Run scans periodically.
- 25:11Speaker 1: CYLINICX might interfere.
- 25:12Speaker 2: Sometimes you might need to set SELINICX booleians like antivirus
- 25:16Speaker 2: scan scan System one to allow the scanner to read
- 25:18Speaker 2: all files.
- 25:19Speaker 1: System auditing with audit.
- 25:21Speaker 2: Very powerful logs detailed info about system events based on
- 25:25Speaker 2: rules you define file access commands, run system calls.
- 25:29Speaker 1: Configure rules with audittail or in it cotta trules dat.
- 25:33Speaker 2: YEP, then use a search to search logs or report
- 25:35Speaker 2: for summarys. Essential for forensics and compliance and notified. Weight
- 25:39Speaker 2: is simpler for just real time file change notifications, but less.
- 25:43Speaker 1: Comprehensive opensacky for compliance scanning.
- 25:46Speaker 2: Yes, scans against security basedlines like PCIDSS digs tells you
- 25:50Speaker 2: where you're non compliant. Red AD systems can even apply
- 25:52Speaker 2: profiles during install. Doesn't fix everything automatically like dispartitioning, but
- 25:56Speaker 2: great for checks.
- 25:57Speaker 1: Blog management arci's log log Watch.
- 26:00Speaker 2: Crucial know your key logs, varlogoth dot log messages, secure,
- 26:05Speaker 2: et cetera, configure RSISLOGBX or sizelog dot com for local storage,
- 26:10Speaker 2: maybe a remote log into a central server. Log Watch
- 26:13Speaker 2: analyzes logs, daily email summaries needs a mail server like
- 26:17Speaker 2: postfix setup.
- 26:18Speaker 1: And finally securing the bootloader GRUB.
- 26:22Speaker 2: Important physical security step set a Grub password to prevent
- 26:26Speaker 2: unauthorized kernel parameter changes or booting into recovery mode.
- 26:30Speaker 1: How different on RedHat versus UBUNTUU.
- 26:32Speaker 2: Yeah, Redhead uses Grub two, set password a Boontuo involves
- 26:36Speaker 2: editing files and etcagrub dot D and running update. Grub
- 26:39Speaker 2: protects against unauthorized boot time access.
- 26:41Speaker 1: USB guard was mentioned too.
- 26:43Speaker 2: Controls which USB devices can be used. Doesn't stop booting
- 26:46Speaker 2: from USB though, need BIOCEUFI password for that. Modern FPUs
- 26:50Speaker 2: also have security features built in.
- 26:52Speaker 1: Wow, Okay, that was a lot. A real deep dive
- 26:54Speaker 1: into Linux security.
- 26:55Speaker 2: It covers a huge amount of ground, doesn't It updates, firewalls, encryption,
- 26:58Speaker 2: access control, monitoring, hardening.
- 27:00Speaker 1: It really shows securing Linux isn't just one thing. It's
- 27:03Speaker 1: many layers working together, an ongoing process.
- 27:06Speaker 2: Absolutely, and for you listening, the key is don't feel overwhelmed.
- 27:10Speaker 2: You don't need to do everything.
- 27:11Speaker 1: Today right Pick a few things.
- 27:12Speaker 2: Yeah, identify what's most critical for your setup. Start with
- 27:16Speaker 2: the basic updates, firewall, strong passwords, SSH keys, pseudo. Then
- 27:21Speaker 2: build from there.
- 27:21Speaker 1: Explore the tools that sounded interesting, use the man pages,
- 27:24Speaker 1: the websites, exactly.
- 27:26Speaker 2: Use this as a starting point, dig deeper into OOH
- 27:30Speaker 2: or audit or kernel tuning, whatever fits your needs or
- 27:33Speaker 2: sparks your interest.
- 27:35Speaker 1: So a final thought, then, with threats always changing, new
- 27:38Speaker 1: vulnerabilities popping up, how do you build that mindset of
- 27:41Speaker 1: continuous improvement keeping security front of mind in your daily workflow.
- 27:46Speaker 1: It's not just set and forget, is it.
- 27:48Speaker 2: Not at all? It requires ongoing learning, staying informed, and
- 27:52Speaker 2: regularly reviewing your configurations. We really hope you continue exploring
- 27:55Speaker 2: these topics. If you try things out, run into issues,
- 27:58Speaker 2: have more questions, let us know your feedback helps everyone.
- 28:01Speaker 1: Definitely thanks for joining us on this deep dive into
- 28:04Speaker 1: Linux security