对 James Morris 的 PPT 做了一些简单的翻译,后面还没翻完,先扔上来了。
PPT 地址:Linux Kernel Security - James Morris 2016
Linux 内核安全
LinuxCon Europe
Berlin, 2016
James Morris
james.l.morris@oracle.com
纲要
- Linux 内核安全概览
- 4.x 内核的开发
- 当下与未来的挑战
Linux 内核安全概览
- Linux 内核的核心安全模块是 DAC(自主访问控制)
- DAC 是从 Unix 中继承而来,是在 19 世纪 60 年代后期设计的。
- “记住,在任何现实意义上,首先需要面对的事实是 UNIX 不是为了安全而开发的,这一事实本身导致了它会有大量的漏洞。” —— Dennis Ritchie, "On the Security of UNIX", 1979
- DAC 面对现代的安全威胁是不足够的
- DAC 不能防止有缺陷的或恶意的代码
- DAC 并没有覆盖所有的安全关键功能
- DAC 中的超级用户违反了用户安全策略
- “通常来说,超级用户的概念是任何保护方案的理论上的缺陷” —— Ritchie 1979
Linux 内核安全扩展
- Posix ACLs
- Capabilities(privileges)
- Audit
- seccomp
- Namespace
- Netfilter
- IPTables
- Cryptography API
- 磁盘加密
- IPSec
- 密钥管理("keys")
- Linux 安全模块(LSM)
- SELinux
- Smack
- AppArmor
- SELinux, Smack, AppArmor 提供了 MAC(强制访问控制)
- 平台安全
- TPM, NX, SMEP, SGX, TrustZone 等
- 完整性管理
- IMA (完整性度量体系)
- EVM (扩展验证模块)
- KSP (Kernel Self Protection, 内核自防护)
- Harden kernel against attack(怎么翻译?)
- KSP 项目:
- 解决一类 bug 和单个 bug
- 当前的重点是 upstreaming grsec/pax features
- 网站:https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
最近的改变
- Linux v4.0(2015年4月) 到 v4.8 (2016年10月)
- 能力
- Ambient capabilities (v4.3)
环境能力- 允许从非特权父进程继承能力
- … instead of assigning fs capabilities to binary, which will always run with them.
- 不需要给脚本翻译器所有的能力
- 允许从非特权父进程继承能力
- Ambient capabilities (v4.3)
- LSM API
- Generalized security module stacking (v4.2)
普遍的安全模块 "stacking"(叠加,即多个 LSM 同时使能)- 之前允许简单的手动 stacking
- 现在:任意数量的娇小的 LSM 能被叠加在一个主要的 ("monolithic", 整体的) LSM 之上
- 例如,SELinux + YAMA + Capabilities, 但 SELinux + TOMOYO + Apparmor 不行
- 新的 LoadPin 模块,能确保内核模块和固件是从可信设备(dm-verity)中被加载的 (v4.7)
- Generalized security module stacking (v4.2)
- 网络
- CALIPSO IPv6 Labeling (v4.8)
- RFC 5570
- 安全标签在 IP 选项中
- CIPSO 的 IPv6 版本
- 标签 MAC (SELinux, Smack) 可用
- 和 Solaris TX 的验证互操作
- CALIPSO IPv6 Labeling (v4.8)
- AppArmor
- 内核工作聚焦于 AA 3.0 cycle
- 即将来临 (v4.10-v4.11)
- Policy namespaces 策略命名空间
- Policy stacking 策略堆叠
- 与容器相集成
- See JJ’s talk video from LSS 2016!
- SELinux
- 安卓 Binder IPC 的支持 (v4.0)
- 完整的 Netlink 覆盖 (v4.1)
- 性能提升 (v4.1)
- 细粒度的 ioctl 覆盖 (v4.3)
- Export validatetrans decisions to userspace (v4.6)
- 限制内核模块加载 (v4.7)
- CALIPSO 的支持 (v4.8)
- 即将来临: overlayfs 的支持 (v4.9)
- Smack
- Netfilter secmark 的支持 (v4.0)
- Allow unconfined label in bringup mode (v4.1)
- 获得密钥的安全上下文 (v4.1)
- Multiple label MAC bypass via onlycap (v4.2)
- IPv6 host labeling (v4.3)
- 有限制的动态进程标签 (v4.4)
- 对套接字的基于进程的权限检查 (v4.5)
- 完整性子系统
- Integration of TPM 2.0 authorization policies with kernel keys, allow hash algorithm selection (v4.5)
- EVM support for x.509 kernel certificates (v4.5)
- Measurement & appraisal of IMA policy (v4.6)
- Support for kernexec image & initramfs (v4.6)
- Support for mknotat syscall (v4.7)
- Per-rule specification of PCRs (v4.8)
- Upcoming: extend measurment to command line, BPF etc., fine grained signatures, directory measurement, namespacing.
- Platform Security
- TPM 2.0 chip support (v4.0)
- Intel Memory Protection Keys (v4.6)
- Upcoming:
- Sparc: SSM (Silicon Secured Memory)
- AMD: SME, SEV (memory encryption)
- Intel: CET (Control-flow Enforcement Technology)
- Audit
- Add support for auditing by executable file, rather than just PID (v4.3)
- Add ioctl device and command info to LSM audit data (v4.3)
- Add tty field to Login event (v4.7)
- Seccomp
- ptrace options for suspend/resume (v4.3)
- powerpc and tile support (v4.3)
- Dump seccomp filters via ptrace (v4.4)
- um and parisc support (v4.5)
- Remove 2-phase API (v4.8)
- ptrace before seccomp (v4.8)
- Maybe upcoming: deep argument inspection
- Keys
- Support for kernel module signing (v4.3)
- Explicit file for x.509 trusted keys
- Sign modules with external key
- Support for TPM 2.0 (v4.5)
- Userspace access to DH computation using stored keys (v4.7)
- Encrypt big keys saved to shm (v4.7)
- Key blacklisting and rejection (v4.7)
- Runtime addition of secondary system key (v4.7)
- Upcoming: key revocation
- Support for kernel module signing (v4.3)
- Crypto API Users
- ext4 filesystem encryption (v4.1)
- Kernel module signing (v4.3)
- MACsec/IEEE 802.1AE (v4.6)
- Migrate ext4 to vfs crypto API (v4.8)
- Upcoming: btrfs encryption
- Kernel Self Protection
- Kernel Address Sanitizer (KASan) (v4.0)
- SLAB support (v4.6)
- Always enable RODATA checking (v4.6)
- KASLR for ARM64 (v4.6), MIPS (v4.7)
- Page zero-poisoning (v4.6)
- X86 execute-only memory (v4.6)
- SLAB freelist randomization (v4.7)
- BPF JIT constant blinding (v4.7)
- Kernel Address Sanitizer (KASan) (v4.0)
- KSP (cont.)
-
Freelist randomization for SLUB (v4.8)
-
KASLR:
- Full physical memory on x86_64 (v4.8)
- Kernel memory base on x86_64 (v4.8)
-
gcc plugin infrastructure (v4.8)
-
Hardened usercopy (v4.8)
-
Predictions for v4.9 from Kees Cook
- latent_entropy gcc plugin
- vmalloc stack on x86
- List hardening
- PAN emulation for arm64
-
For more detail:
- https://outflux.net/blog/ (Kees’ blog)
-
未来的挑战
- IoT
- KSP arms race
- Need more original research in mainline!
- Evolving threat models
- Security architecture vs. features
- Resources
- Linux Security Module mailing list
- Linux Security Summit (Aug 2016, Toronto)
- Kernel Self Protection Project
- LWN Security
网友评论