UP | HOME
../../ | NoSlides

Hardening A Linux Kernel

1 Background

  1. ../BuildKernel Overview of Kernel Source and How to Build a Kernel, Deploying the Kernel.

2 Overview

  1. This article is about: Kernel bugs, and Applying patches.

2.1 Scope of Kernel Hardening in this Course

  1. We should be able to apply the tools of Development of Software without Security Holes.
  2. We should be able to gather the patches delivered by experts since the last such harvest.
  3. We should be able to patch the publicly released kernel, and build a new hardened kernel. We select the patches from the above harvest. We may omit some. The reasons for both select/ omit are documented.
  4. We are not expecting to discover new bugs that are worthy of being flashed across the world tech news sites.
  5. Limited by the time and lectures we can devote to this topic.

3 Kernel Security Modules

  1. The Linux Kernel Security Module (LKSM) mechanism permits new kernel extensions.
  2. These extensions are not actually loadable kernel modules. Instead, they are selectable at build-time via CONFIGDEFAULTSECURITY and can be overridden at boot-time via the "security=…" kernel command line argument
  3. The primary users of the LSM interface are Mandatory Access Control (MAC) extensions.
  4. cat /sys/kernel/security/lsm A list of the active security modules
  5. The following grep results are from a build of Ubuntu standard kernel:
    # grep CONFIG_DEFAULT_SECURITY /boot/config-4.18.0-10-generic 
    # CONFIG_DEFAULT_SECURITY_SELINUX is not set
    # CONFIG_DEFAULT_SECURITY_SMACK is not set
    # CONFIG_DEFAULT_SECURITY_TOMOYO is not set
    CONFIG_DEFAULT_SECURITY_APPARMOR=y
    # CONFIG_DEFAULT_SECURITY_DAC is not set
    CONFIG_DEFAULT_SECURITY="apparmor"
    

4 Add/ Delete/ Freeze System Calls

  1. It is not difficult to add system calls to the kernel.
  2. Using the Linux Kernel Modules mechanisms, Add/ Delete/ Freeze System Calls can be done while the kernel is running.
  3. The Lab Lx TBD link gives you practical experience of doing this.

4.1 Why?

4.2 Kernel without Modules

4.3 Security Implications

5 References

6 End


Copyright © 2018 www.wright.edu/~pmateti • 2018-10-10