Security features in the OpenBSD operating system



Similar documents
Unix Security Technologies: Host Security Tools. Peter Markowsky <peterm[at]ccs.neu.edu>

Safety measures in Linux

Eugene Tsyrklevich. Ozone HIPS: Unbreakable Windows

Plan 9 Authentication in Linux

CS 356 Lecture 25 and 26 Operating System Security. Spring 2013

noway.toonux.com 09 January 2014

Defense in Depth: Protecting Against Zero-Day Attacks

Summary of the SEED Labs For Authors and Publishers

Linux Operating System Security

z/os Firewall Technology Overview

Software security. Buffer overflow attacks SQL injections. Lecture 11 EIT060 Computer Security

CMPT 471 Networking II

Oracle Solaris Security: Mitigate Risk by Isolating Users, Applications, and Data

Secure Software Programming and Vulnerability Analysis

OS/390 Firewall Technology Overview

Jonathan Worthington Scarborough Linux User Group

Exploiting nginx chunked overflow bug, the undisclosed attack vector

System Security Fundamentals

CSE 265: System and Network Administration

CSE331: Introduction to Networks and Security. Lecture 32 Fall 2004

OS/390 Firewall Technology Overview

REPORT ON AUDIT OF LOCAL AREA NETWORK OF C-STAR LAB

1 hours, 30 minutes, 38 seconds Heavy scan. All scanned network resources. Copyright 2001, FTP access obtained

Bypassing Firewalls: Tools and Techniques

I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation. Mathias Payer, ETH Zurich

Scan Report Executive Summary. Part 2. Component Compliance Summary IP Address :

Firewall Builder Architecture Overview

We will give some overview of firewalls. Figure 1 explains the position of a firewall. Figure 1: A Firewall

Security for Mac Computers in the Enterprise

Running a Default Vulnerability Scan SAINTcorporation.com

Do Containers fully 'contain' security issues? A closer look at Docker and Warden. By Farshad Abasi,

Windows Remote Access

Nessus. A short review of the Nessus computer network vulnerability analysing tool. Authors: Henrik Andersson Johannes Gumbel Martin Andersson

Time has something to tell us about Network Address Translation

Firewalls. Test your Firewall knowledge. Test your Firewall knowledge (cont) (March 4, 2015)

Host-based Intrusion Prevention on Windows and UNIX. Dr. Rich Murphey White Oak Labs

Running a Default Vulnerability Scan

Storm Worm & Botnet Analysis

Subverting the Xen hypervisor

OpenBSD in the wild...a personal journey

Port Scanning and Vulnerability Assessment. ECE4893 Internetwork Security Georgia Institute of Technology

How To Classify A Dnet Attack

A43. Modern Hacking Techniques and IP Security. By Shawn Mullen. Las Vegas, NV IBM TRAINING. IBM Corporation 2006

Linux Network Security

7. Firewall - Concept

Chapter 6 Configuring the SSL VPN Tunnel Client and Port Forwarding

Learn Ethical Hacking, Become a Pentester

HONEYD (OPEN SOURCE HONEYPOT SOFTWARE)

Internet Security and Acceleration Server 2000 with Service Pack 1 Audit. An analysis by Foundstone, Inc.

Firewalls. configuring a sophisticated GNU/Linux firewall involves understanding

Network Traffic Analysis

Firewalls. Pehr Söderman KTH-CSC

Firewalls. Chien-Chung Shen

Acano solution. Security Considerations. August E

CIT 380: Securing Computer Systems

Virtualization of Linux based computers: the Linux-VServer project

Modern Binary Exploitation Course Syllabus

Internet Protocol: IP packet headers. vendredi 18 octobre 13

DVR Network Security

Virtual Private Networks

Confining the Apache Web Server with Security-Enhanced Linux

static void insecure (localhost *unix)

VMware vcenter Log Insight Security Guide

Network Defense Tools

Virtual Private Systems for FreeBSD

SSL for VM: The Hard Way and the Easy Way

Evading Infrastructure Security Mohamed Bedewi Penetration Testing Consultant

Cloud Networking Disruption with Software Defined Network Virtualization. Ali Khayam

Cyber Security In High-Performance Computing Environment Prakashan Korambath Institute for Digital Research and Education, UCLA July 17, 2014

Open Source Enterprise VPN Solution with OpenVPN and OpenBSD

COS 318: Operating Systems

My FreeScan Vulnerabilities Report

Client Server Registration Protocol

Host Discovery with nmap

Project 4: IP over DNS Due: 11:59 PM, Dec 14, 2015

Chapter 11 Cloud Application Development

IPv6 Security Best Practices. Eric Vyncke Distinguished System Engineer

CSE331: Introduction to Networks and Security. Lecture 15 Fall 2006

Virtual Private Networks

Chapter 3 Operating-System Structures

Chapter 14 Virtual Machines

Firewalls 1 / 43. Firewalls

Fine-Grained User-Space Security Through Virtualization. Mathias Payer and Thomas R. Gross ETH Zurich

What is Web Security? Motivation

accf_smtp: FreeBSD kernel protection measures against SMTP DDoS and DoS attacks

SCP - Strategic Infrastructure Security

MINI-FAQ: OpenBSD 2.4 IPSEC VPN Configuration

iscsi Security (Insecure SCSI) Presenter: Himanshu Dwivedi

Removing The Linux Routing Cache

Secure computing: SELinux

Transcription:

Security features in the OpenBSD operating system Matthieu Herrb & other OpenBSD developers INSA/LAAS-CNRS, 22 janvier 2015

Agenda 1 Introduction 2 Random numbers 3 Increasing resilience 4 Network level protection 5 LibreSSL 6 Conclusion

Agenda 1 Introduction 2 Random numbers 3 Increasing resilience 4 Network level protection 5 LibreSSL 6 Conclusion

About myself PhD in Robotics, Toulouse University, 1991 Research Engineer at CNRS/LAAS System software system administration and security officer for LAAS robots systems software integration OpenBSD and X.Org contributor Member of the tetaneutral.net associcative local ISP

OpenBSD... Unix-like, multi-platform operating system Derived from BSD 4.4 Kernel + userland + documentation maintained together 3rd party applications available via the ports system One release every 6 months Hardware architectures: i386, amd64, alpha, arm, macppc, sparc, sparc64, sgi, vax...

Secure by default Leitmotiv since 1996 Adopted since by most OS Non required services are not activated in a default installation. Default configuration of services providing security Activating services require a manual action of the administrator Keep a working (functional, useful) system only a few remote vulnerabilities in more than 15 years.

Objectives Provide free code (BSD license...) Quality Correctness Adhering to standards (POSIX, ANSI) Providing good crypto tools (SSH, SSL, IPSEC,...) better security.

Current version OpenBSD 5.6 released Nov. 1, 2014. New stuff : LibreSSL, OpenSSL fork New getentropy(2) system call PIE by default on more architectures OpenSMTPd, a new privilege separated SMTP daemon is now the default removed unsafe algorithms from OpenSSH protocol negociation lots of unsafe code removal (Kerberos, sendmail,...)...

Increasing resilience to attacks Provide an unpredictable resource base with minimum permissions Random stack gap Program segments mappings randomization > shared libraries ASLR, random ordering > PIE > mmap ASLR increased use of the ELF.rodata section malloc randomizations Where it is possible to spot damage, fail hard stack protector stack ghost atexit/ctor protection

Agenda 1 Introduction 2 Random numbers 3 Increasing resilience 4 Network level protection 5 LibreSSL 6 Conclusion

Random numbers in OpenBSD libc needs high quality random numbers available under any circumstances Theo de Raadt in the kernel in threads in chroots in ENFILE/EMFILE situations in performance critical code Most important characteristic : Ease of use

Random numbers in OpenBSD: kernel

Use of random numbers in the kernel random PIDs VM mappings (including userland malloc/free requests) network packets creation (sequence numbers) pf NAT and other operations port allocation scheduler decisions userland arc4random() reseeding via getentropy(2) Slicing the random stream between many users: resistance to backtracking and prediction.

Random numbers in userland Per-process stream, with re-seeding: too much volume of data has moved too much time elapsed when a fork() is detected Slicing between several users occurs too : malloc(3) DNS ld.so crypto More than 1000 call points in the libraries and system utilities.

Agenda 1 Introduction 2 Random numbers 3 Increasing resilience 4 Network level protection 5 LibreSSL 6 Conclusion

ASLR stackgap: random offset in stack placement mmap() shared libraries PIE executables by default, including static binaries on most architectures

Randomness in mmap() Address returned by mmap(): If MAP_FIXED is not specified: returns a random address. (traditional behaviour: 1st free page after a base starting address)

Randomness in malloc() 1 page allocations: mmap() random addresses. < 1 page allocations: classical fixed block allocator, but random selection of the block in the free list. heap attacks more difficult.

Protecting dynamically allocated memory [Moerbeek 2009] Activated by /etc/malloc.conf G Each bigger than one page allocation is followed by a guard page segmentation fault if overflow. Smaller allocations are randomly placed inside one page.

Propolice / SSP gcc patches initially developped by IBM Tokyo Research Labs (2002). Principle : put a canary on the stack, in front of local variables check it before return. if still alive: no overflow if dead (overwritten): overflow abort() Only when there are arrays in local variables Adopted by gcc since version 4.1. Enabled by default in OpenBSD..

W^X Principle of least privilege. Write exclusive or execution right granted on a page.. easy on some architectures (x86_64, sparc, alpha): per page X bit harder or others (x86, powerpc): per memory segment X bit impossible in some cases (vax, m68k, mips) In OpenBSD 5.7: WˆX inside the kernel for x86_64 (PaX on Linux...)

Privileges reduction Completely revoke privileges from privileged (setuid) commands, or commands launched with privileges, once every operation requiring a privilege are done. Group those operations as early as possible after start-up. Examples: ping named

Privileges separation [Provos 2003] Run system daemons: with an uid 0 in a chroot(2) jail additional helper process keeps the privileges but do paranoid checks on all his actions. A dozen of daemons are protected this way.

Example: X server

Example: OpenSMTPd

Securelevels No fine grained policy: too complex, thus potentially dangerous. Three levels of privileges kernel root user Default securelevel = 1: File system flags (immutable, append-only) to limit root access. Some settings cannot be changed (even by root). Restrict access to /dev/mem and raw devices.

Agenda 1 Introduction 2 Random numbers 3 Increasing resilience 4 Network level protection 5 LibreSSL 6 Conclusion

Threats on protocols Internet: favours working stuff over security. easy to guess values forged packets accepted as valid information leaks use of time as a secret??

Protection Principle Use data that are impossible (hard) to guess wherever arbitrary data are allowed, even if no known attack exists. counters timestamps packet, session, host... identifiers But respect constraints and avoid breaking protocols: non repetition minimal interval between 2 values avoid magic numbers

Randomness in the network stack Use: IPID (16 bits, no repetition) DNS Queries (16 bits, no repetition) TCP ISN (32 bits, no repetition, steps of 2 15 between 2 values) Source ports (don t re-use a still active port) TCP timestamps (random initial value, then increasing at constant rate) Id NTPd (64 bits, random) instead of current time RIPd MD5 auth...

PF: more than one trick in its bag Packet Filter Stateful filtering and rewriting (NAT) engine Scrub to add randomness to packets: TCP ISN IP ID TCP timestamp NAT : rewriting of source ports (and possibly addresses) Also protects non-openbsd machines behind a pf firewall.

Agenda 1 Introduction 2 Random numbers 3 Increasing resilience 4 Network level protection 5 LibreSSL 6 Conclusion

OpenSSL & Heartbleed for years no one really looked at the OpenSSL code those who had a glance ran away (too horrible) so everyone blindly trusted the OpenSSL project then came Heartbleed, made people look again OpenBSD decided that the only way out was to fork

LibreSSL - goals Keep the OpenSSL API Important : remove layers of wrappers around system primitives malloc wrappers where hiding bugs from valgrind/openbsd s malloc Printf-like wrappers may have hidden format string bugs Review the public OpenSSL bug database : dozen of valid bug reports sitting for years Fix random number generator getentropy() Fix many (potential) interger overflows reallocarray() Portable version for Linux, MacOSX, Windows,... http://www.libressl.org/

libtls new API hides implementation details (no ASN.1, x509,... structures) safe default behaviour (hostnames/certificates verification,...) privilege separation friendly (committed today) example use in OpenSMTPd, relayd, httpd... still under active development

Agenda 1 Introduction 2 Random numbers 3 Increasing resilience 4 Network level protection 5 LibreSSL 6 Conclusion

Conclusion Lots of progress since the beginning. Contributed to fix bugs in many 3rd party applications. Often Copied (good). Still lots of issues to address...

Bibliography http://www.openbsd.org/papers/index.html arc4random - randomization for all occasions, Theo de Raadt, Hackfest 2014, Quebec City. LibreSSL - An OpenSSL replacement, the first 30 days and where we go from here, Bob Beck, BSDCan 2014. Exploit mitigation techniques - An update after 10 years, Theo de Raadt, rubsd 2013, Moscow. OpenSMTPD: We deliver!, Eric Faurot, AsiaBSDCon 2013. Time is not a secret: Network Randomness in OpenBSD, Ryan McBride Asia BSD Conference 2007 Security issues related to Pentium System Management Mode, Loïc Duflot, CansecWest 2006. Preventing Privilege Escalation, Niels Provos, Markus Friedl and Peter Honeyman, 12th USENIX Security Symposium, Washington, DC, August 2003. Enhancing XFree86 security, Matthieu Herrb LSM, Metz 2003.

Questions?