Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Linux Security and Hardening

You're reading from  Mastering Linux Security and Hardening

Product type Book
Published in Jan 2018
Publisher
ISBN-13 9781788620307
Pages 376 pages
Edition 1st Edition
Languages
Author (1):
Donald A. Tevault Donald A. Tevault
Profile icon Donald A. Tevault

Table of Contents (15) Chapters

Title Page
Packt Upsell
Contributors
Preface
1. Running Linux in a Virtual Environment 2. Securing User Accounts 3. Securing Your Server with a Firewall 4. Encrypting and SSH Hardening 5. Mastering Discretionary Access Control 6. Access Control Lists and Shared Directory Management 7. Implementing Mandatory Access Control with SELinux and AppArmor 8. Scanning, Auditing, and Hardening 9. Vulnerability Scanning and Intrusion Detection 10. Security Tips and Tricks for the Busy Bee 1. Other Books You May Enjoy

Chapter 10. Security Tips and Tricks for the Busy Bee

In this, our final chapter, I'd like to do a round-up of quick tips and tricks that don't necessarily fit in with the previous chapters. Think of these tips as time savers for the busy administrator.

We'll cover the following topics:

  • Quick ways to audit which system services are running
  • Password-protecting the GRUB2 configuration
  • Securely configuring and then password-protecting UEFI/BIOS
  • Use a security checklist when setting up your system

Auditing system services


A basic tenet of server administration, regardless of which operating system we're talking about, is to never have anything that you don't absolutely need installed on a server. You especially don't want any unnecessary network services running because that would give the bad guys extra ways to get into your system. And, there's always a chance that some evil hacker might have planted something that acts as a network service, and you'd definitely want to know about that. In this chapter, we'll look at a few different ways to audit your system to ensure that no unnecessary network services are running on it.

Auditing system services with systemctl

On Linux systems that come with systemd, the systemctl command is pretty much a universal command that does many things for you. In addition to controlling your system's services, it can also show you the status of those services. We have the following code:

donnie@linux-0ro8:~> sudo systemctl -t service --state=active

Here...

Password-protecting the GRUB 2 bootloader


People sometimes forget passwords, even if they're administrators. And sometimes, people buy used computers but forget to ask the seller what the password is. (Yes, I've done that.) That's okay, though, because all of the major operating systems have ways to let you either reset or recover a lost administrator password. That's handy, except that it does kind of make the whole idea of having login passwords a rather moot point when someone has physical access to the machine. Let's say that your laptop has just been stolen. If you haven't encrypted the hard drive, it would only take a few minutes for the thief to reset the password and to steal your data. If you have encrypted the drive, the level of protection would depend on which operating system you're running. With standard Windows folder encryption, the thief would be able to access the encrypted folders just by resetting the password. With LUKS whole-disk encryption on a Linux machine, the thief...

Securely configuring BIOS/UEFI


This topic is different from anything we've looked at thus far because it has nothing to do with the operating system. Rather, we're now going to talk about the computer hardware.

Every computer motherboard has either a BIOS or a UEFI chip, which stores both the hardware configuration for the computer, and the bootstrap instructions that are needed to start the boot process after the power is turned on. UEFI has replaced the old-style BIOS on newer motherboards, and it has more security features than what the old BIOS had.

I can't give you any specific information about BIOS/UEFI setup because every model of the motherboard has a different way of doing things. What I can give you is some more generalized information.

When you think about BIOS/UEFI security, you might be thinking about disabling the ability to boot from anything other than the normal system drive. In the following screenshot, you can see that I've disabled all SATA drive ports except for the one...

Using a security checklist for system setup


I've previously told you about OpenSCAP, which is a really useful tool to lock down your system with just a minimum amount of effort. OpenSCAP comes with various profiles that you can apply to help bring your systems into compliance with the standards of different regulatory agencies. However, there are certain things that OpenSCAP can't do for you. For example, certain regulatory agencies require that your server's hard drive be partitioned in a certain way, with certain directories separated out into their own partitions. If you've already set up your server with everything under one big partition, you can't fix that just by doing a remediation procedure with OpenSCAP. The process of locking down your server to ensure that it's compliant with any applicable security regulations has to begin before you even install the operating system. For this, you need the appropriate checklist.

There are a few different places where you can obtain a generic...

Summary


Once again, we've come to the conclusion of another chapter, and we covered a lot of cool topics. We started by looking at various ways to audit which services are running on your systems, and we saw some examples of what you probably don't want to see. We then saw how to use the password-protection features of GRUB 2, and we saw the little quirks that we have to deal with when using those features. Next, we had a change of pace by looking at how to further lock down a system by properly setting up a system's BIOS/UEFI. Finally, we looked at why we need to properly begin preparations to set up a hardened system by obtaining and following the proper checklist.

Not only does this conclude another chapter, it also concludes the book. But, it doesn't conclude your journey into the land of Mastering Linux Security and Hardening. Oh, no. As you continue this journey, you'll find that there's still more to learn, and still more that won't fit into the confines of a 300-page book. Where you...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Mastering Linux Security and Hardening
Published in: Jan 2018 Publisher: ISBN-13: 9781788620307
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}