smack security modules are filling needs that selinux isn...

32
Rejoice, for the days when your only choice for enhanced security in the Linux kernel was SELinux are coming to an end. Learn how the AppArmor and Smack security modules are filling needs that SELinux isn't so well suited for. Learn about new security modules like Landlock that are taking 21st century approaches to modern security concerns. Find out about a set of smaller security modules that do all sorts of interesting things, from general process tags to strengthening changing chroot. With all that to think about, you'll be exposed to the efforts to combine and composer security modules. The talk wouldn't be complete without relating all this to containers and virtualization. Nor would it be fair to leave out advances in the Audit and Capabilities features. Finally no discussion of Linux kernel security would be complete without something about efforts to harden it and fix exploitable flaws.

Upload: others

Post on 23-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Rejoice, for the days when your only choice for enhanced security in the Linux kernel was SELinux are coming to an end. Learn how the AppArmor and

Smack security modules are filling needs that SELinux isn't so well suited for. Learn about new security modules like Landlock that are taking 21st

century approaches to modern security concerns. Find out about a set of smaller security modules that do all sorts of interesting things, from general

process tags to strengthening changing chroot. With all that to think about, you'll be exposed to the efforts to combine and composer security modules.

The talk wouldn't be complete without relating all this to containers and virtualization. Nor would it be fair to leave out advances in the Audit and

Capabilities features. Finally no discussion of Linux kernel security would be complete without something about efforts to harden it and fix exploitable

flaws.

Page 2: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Look Out For What’s In the Linux Security Pipeline

Casey Schaufler

Page 3: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Look Out For What’s In the Linux Security Pipeline

Casey Schaufler

Page 4: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Notice:There have been two high profile

security issues in the news recently.

I regret that I am not at liberty to make comment or answer questions regarding either.

Page 5: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Casey Schaufler

• Unix in the 1970’s

• Security in the 1980’s

• Linux in the 21st century

Page 6: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Old Security Modules

Page 7: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

SELinux

• New network protocols

• Easier to understand policy

Page 8: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Smack

• Network configuration

Page 9: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

AppArmor

• Labeled objects

• Networking

• Policy stacking

Page 10: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

New Security Modules

Page 11: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Landlock

• eBPF extension to SECMARK

Page 12: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

PTAGS

• General process tags

• For application use

Process

Name=Value

Betty=RubbleGeorge=Jetson

Fred=Flintstone

Page 13: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

HardChroot

• Limits in a chroot jail

• Mount restrictions

• Limits on fd based system calls

Page 14: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Safename

• Prevents creation of unsafe file names

• Start characters

• Middle characters

• End characters

Page 15: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

SimpleFlow

• Tracks tainted data

Page 16: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Security Infrastructure

Page 17: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Security Module Stacking

• Security blob management

• Netfilter• AppArmor

• Smack

• Network labeling agreement

Security Module Infrastructure

SELinux

Blob

Managment

Smack

Blob

Managment

AppArmor

Blob

Managment

Security Module Infrastructure

SELinux

Blob

Managment

SmackAppArmor

Page 18: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

SELinux Base Policy

Security Module Namespaces

• Module A in the base system

• Module B in a container

• Module A with different policy in a container

SELinux Container Policy AppArmor Container Policy

Page 19: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Namespacing In SELinux

• James Morris

• Today at 14:05

Page 20: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Encrypted Keys

• Locks on your keys

Page 21: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Containers

Page 22: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

What is a container?

• Your guess is as good as mine

Page 23: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Capabilities

• File capability extensions

Page 24: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Identification For Audit

• Which container was the event from?

• New 64 bit ID

• PTAGS

Page 25: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Virtualized Containers

• Lightweight machines

Page 26: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Hardening

Page 27: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Printing Pointers

• %p

Page 28: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Usercopy

• The exploitable “where”User Space

Kernel Space

Page 29: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

The State of Kernel Self-Protection

• Kees Cook

• Friday, 11:40

• Green Theatre

Page 30: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Be sure to attend …

Page 31: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

The Twisting, Turning, Narrow Road That Is Security

• Wednesday, 11:40am

• Green Theatre

Page 32: Smack security modules are filling needs that SELinux isn ...lca-kernel.ozlabs.org/2018-Schaufler-Look-Out-For... · George=Jetson Betty=Rubble Fred=Flintstone. HardChroot • Limits

Thank You