Practical Linux Security Cookbook - Second Edition

Book description

Enhance file system security and learn about network attack, security tools and different versions of Linux build.

Key Features

  • Hands-on recipes to create and administer a secure Linux system
  • Enhance file system security and local and remote user authentication
  • Use various security tools and different versions of Linux for different tasks

Book Description

Over the last few years, system security has gained a lot of momentum and software professionals are focusing heavily on it. Linux is often treated as a highly secure operating system. However, the reality is that Linux has its share of security ?aws, and these security ?aws allow attackers to get into your system and modify or even destroy your important data. But there's no need to panic, since there are various mechanisms by which these ?aws can be removed, and this book will help you learn about different types of Linux security to create a more secure Linux system.

With a step-by-step recipe approach, the book starts by introducing you to various threats to Linux systems. Then, this book will walk you through customizing the Linux kernel and securing local files. Next, you will move on to managing user authentication both locally and remotely and mitigating network attacks. Later, you will learn about application security and kernel vulnerabilities. You will also learn about patching Bash vulnerability, packet filtering, handling incidents, and monitoring system logs. Finally, you will learn about auditing using system services and performing vulnerability scanning on Linux.

By the end of this book, you will be able to secure your Linux systems and create a robust environment.

What you will learn

  • Learn about vulnerabilities and exploits in relation to Linux systems
  • Configure and build a secure kernel and test it
  • Learn about file permissions and how to securely modify files
  • Authenticate users remotely and securely copy files on remote systems
  • Review different network security methods and tools
  • Perform vulnerability scanning on Linux machines using tools
  • Learn about malware scanning and read through logs

Who this book is for

This book is intended for all those Linux users who already have knowledge of Linux file systems and administration. You should be familiar with basic Linux commands. Understanding information security and its risks to a Linux system is also helpful in understanding the recipes more easily.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Practical Linux Security Cookbook Second Edition
  3. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  4. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Conventions used
    4. Sections
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Get in touch
      1. Reviews
  6. Linux Security Problem
    1. Security policy
      1. Developing a security policy
      2. Linux security myths
        1. Myth – as Linux is open source, it is considered to be insecure
        2. Myth – Linux is an experts-only system, and only they know how to configure their systems in terms of security
        3. Myth – Linux is virus free
    2. Configuring server security
      1. How to do it...
        1. User management
        2. Password policy
        3. Configuration policy
        4. Monitoring policy
      2. How it works...
    3. Security policy – server security
      1. How to do it…
        1. General policy
        2. Configuration policy
        3. Monitoring policy
      2. How it works…
    4. Defining security controls
      1. How to do it...
        1. Installation
        2. Boot and disk
        3. Network and services
        4. Intrusion detection and Denial of Service (DoS)
        5. Auditing and availability
      2. How it works...
    5. Checking the integrity of installation medium by using checksum
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    6. Using LUKS disk encryption
      1. Getting ready
      2. How to do it...
      3. There's more...
    7. Make use of sudoers – configuring sudo access
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There’s more…
        1. Vulnerability assessment
    8. Scanning hosts with Nmap
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    9. Gaining root on a vulnerable Linux system
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    10. Missing backup plans
      1. Getting ready
      2. How to do it...
        1. fwbackups
        2. rsync
        3. Amanda (Advanced Maryland Automatic Network Disk Archiver)
        4. Simple Backup Solution (SBS)
        5. Bacula
      3. How it works...
  7. Configuring a Secure and Optimized Kernel
    1. Creating USB boot media
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Retrieving the kernel source
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Configuring and building kernel
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Installing and booting from a kernel
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Kernel testing and debugging
      1. Configuring console for debugging using netconsole
      2. Getting ready
      3. How to do it...
      4. How it works...
      5. There's more...
    6. Debugging kernel boot
      1. How to do it...
    7. Kernel errors
      1. Causes of kernel errors
    8. Checking kernel parameters using Lynis
      1. Getting ready
      2. How to do it...
  8. Local Filesystem Security
    1. Viewing files and directory details using ls
      1. Getting ready
      2. How to do it…
      3. How it works…
    2. Using chmod to set permissions on files and directories
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Using chown to change ownership of files and directories
      1. How to do it...
      2. There's more...
    4. Using ACLs to access files
      1. Getting ready
      2. How to do it...
      3. There's more...
    5. File handling using the mv command (moving and renaming)
      1. Getting ready
      2. How it works...
    6. Implementing Mandatory Access Control with SELinux
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Using extended file attributes to protect sensitive files
      1. Getting ready
      2. How to do it...
    8. Installing and configuring a basic LDAP server on Ubuntu
      1. Getting ready
      2. How to do it...
      3. How it works...
  9. Local Authentication in Linux
    1. User authentication and logging
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Limiting login capabilities of users
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Disabling username/password logins
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Monitoring user activity using acct
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Login authentication using a USB device and PAM
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Defining user authorization controls
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Access Management using IDAM
      1. Getting ready
      2. How to do it...
      3. How it works...
  10. Remote Authentication
    1. Remote server/host access using SSH
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Enabling and disabling root login over SSH
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Key-based login into SSH for restricting remote access
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Copying files remotely
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Setting up a Kerberos server with Ubuntu
      1. Getting started
      2. How to do it...
      3. How it works...
    6. Using LDAP for user authentication and management
      1. Getting started
      2. How to do it...
  11. Network Security
    1. Managing TCP/IP networks
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Using a packet sniffer to monitor network traffic
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Using IP tables for configuring a firewall
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Blocking spoofed addresses
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Blocking incoming traffic
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Configuring and using TCP Wrappers
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Blocking country-specific traffic using mod_security
      1. Getting ready
      2. How to do it...
    8. Securing network traffic using SSL
      1. Getting ready
      2. How to do it...
      3. How it works...
  12. Security Tools
    1. Linux sXID
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Port Sentry
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Using Squid proxy
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Open SSL server
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Tripwire
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Shorewall
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. OSSEC
      1. Getting ready
      2. How to do it...
      3. How it works...
    8. Snort
      1. Getting ready
      2. How to do it...
      3. How it works...
    9. Rsync and Grsync – backup tool
      1. Getting ready
      2. How to do it...
      3. How it works...
  13. Linux Security Distros
    1. Kali Linux
    2. pfSense
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Digital Evidence and Forensic Toolkit  (DEFT)
    4. Network Security Toolkit (NST)
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Security Onion
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Tails OS
      1. Getting ready
      2. How to do it...
    7. Qubes OS
      1. Getting ready
      2. How to do it...
      3. How it works...
  14. Bash Vulnerability Patching
    1. Understanding the Bash vulnerability – Shellshock
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Security issues – Shellshock
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Linux patch management system
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Applying patches in Linux
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Other well-known Linux vulnerabilities
      1. How to do it...
      2. How it works...
  15. Security Monitoring and Logging
    1. Viewing and managing log files using Logcheck
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Monitoring the network using Nmap
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Using Glances for system monitoring
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Monitoring logs using MultiTail
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Using system tools – whowatch
      1. Getting ready
      2. How to do it...
      3. How it works
    6. Using system tools – stat
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Using System tools – lsof
      1. Getting ready
      2. How to do it...
      3. How it works...
    8. Using System tools – strace
      1. Getting ready
      2. How to do it...
      3. How it works
    9. Real time IP LAN monitoring using IPTraf
      1. Getting ready
      2. How to do it...
      3. How it works...
    10. Network security monitoring using Suricata
      1. Getting ready
      2. How to do it...
    11. Network monitoring using OpenNMS
      1. Getting ready
      2. How to do it...
      3. How it works
  16. Understanding Linux Service Security
    1. Web server – HTTPD
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Remote service login – Telnet
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Secure remote login – SSH
      1. Getting ready
      2. How to do it...
    4. File transfer security – FTP
    5. Securing Mail Transfer – SMTP
      1. Getting ready
      2. How to do it...
      3. How it works...
  17. Scanning and Auditing Linux
    1. Installing an antivirus on Linux
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Scanning with ClamAV
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Finding rootkits
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Using the auditd daemon
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Using ausearch and aureport to read logs
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Auditing system services with systemctl
      1. Getting ready
      2. How to do it...
      3. How it works...
  18. Vulnerability Scanning and Intrusion Detection
    1. Network security monitoring using Security Onion
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Finding vulnerabilities with OpenVAS
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Using Nikto for web server scanning
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Hardening using Lynis
      1. Getting ready
      2. How to do it...
      3. How it works...
  19. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Practical Linux Security Cookbook - Second Edition
  • Author(s): Tajinder Kalsi
  • Release date: August 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781789138399