Skip to content

Instantly share code, notes, and snippets.

@lrvick
Created January 25, 2019 10:33
Show Gist options
  • Save lrvick/d9c2b30d7e40824d3831a4564127b377 to your computer and use it in GitHub Desktop.
Save lrvick/d9c2b30d7e40824d3831a4564127b377 to your computer and use it in GitHub Desktop.
Hardening Playbook: My dumping ground for my system hardening research, mostly focusing on Linux but paying attention to other systems.

Hardening Playbook

Threat profile

  • Attacker has unlimited funding
  • Attacker has decades of patience
  • Attacker knows everything you do and more
  • Attacker has no morals and can break any law
  • Attacker can compromise any single system
  • Attacker can compromise any single individual

Assumptions

  • Human lives depend on Linux system hardening
    • Self driving cars
    • Trains
    • Prison security systems
    • Nuclear Power Plants
    • Heavy equipment firmware
    • Medical implant firmware
    • Political dissonants and Journalists
    • War-starting levels of digital assets in both fiat and cryptocurrency
  • Anything that can't be verified is backdoored. Trust, but verify.
  • At least one engineer with push access to every codebase is compromised
  • Any one of every system in a given deployment can be compromised
  • Always fail safe: uptime and stability be damned
  • Favor security over speed and compatibility always

Implementation

Hardware

Recommendations

Background

RNG

Recommendations

Background

BIOS

Recommendations

Background

Bootloader

Recommendations

Background

Kernel

Recommendations

Enable: STACKLEAK (Formerly PaX)

Background

Userspace

Recommendations

Apparmor

SeLinux

Seccomp

Compiler

Recommendations

Background

Application

Recommendations

Release Management

Memory Management

  • Favor memory safe languages designed for security (Go, Rust, Zig)
  • Hardened Memory allocator (hardened_malloc)

Third Party Dependencies

Background

  • OpenBSD coding practices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment