FreeBSD Developer Summit TrustedBSD: Audit + priv(9)



Similar documents
CAPP-Compliant Security Event Audit System for Mac OS X and FreeBSD

Practical Security Event Auditing with FreeBSD

Auditing NFS Events. Efstratios Karatzas

Audit Trail Administration

Computer Security: Principles and Practice

Secure computing: SELinux

Toasterkit - A NetBSD Rootkit. Anthony Martinez Thomas Bowen

Capability-Based Access Control

Summary. How-To: Active Directory Integration. April, 2006

Linux Audit Quick Start SUSE Linux Enterprise 10 SP1

CAPSICUM. Practical capabilities for UNIX. 19 th USENIX Security Symposium 11 August Washington, DC. Robert N. M. Watson

TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control

Access Control Lists in Linux & Windows

Information Security Measures and Monitoring System at BARC. - R.S.Mundada Computer Division B.A.R.C., Mumbai-85

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Managing Access Control in PresSTORE

ESM s management across multi-platforms eliminates the need for various account managers.

Linux Kernel Architecture

Features. The Samhain HIDS. Overview of available features. Rainer Wichmann

IHS USER SECURITY AUDIT

Reports. Quick Reference Card. Option Group. Date Settings. Time Options. Agent and Queue Selection. Call Types

24x7 Scheduler Multi-platform Edition 5.2

What is Auditing? Auditing. Problems. Uses. Audit System Structure. Logger. Reading: Chapter 24. Logging. Slides by M. Bishop are used.

How To Configure the Oracle ZFS Storage Appliance for Quest Authentication for Oracle Solaris

Secure Messaging Server Console... 2

Configuring the Active Directory Plug-in

Moving to Plesk Automation 11.5

A COMPARISON BETWEEN THE SAMBA3 AND LIKEWISE LWIOD FILE SERVERS

Windows Security. CSE497b - Spring 2007 Introduction Computer and Network Security Professor Jaeger.

Operating System Structure

Tunnel Client FAQ. Table of Contents. Version 0v5, November 2014 Revised: Kate Lance Author: Karl Auer

Exchange 2013 mailbox setup guide

vtiger CRM 4.2 Installation Guide for Linux OS

TECHNICAL NOTE TNOI27

Project No. 2: Process Scheduling in Linux Submission due: April 28, 2014, 11:59pm

Authentication in a Heterogeneous Environment

Snare System Version Release Notes

Operating Systems Design 16. Networking: Sockets

FREQUENTLY ASKED QUESTIONS

Example of Standard API

Ahsay Replication Server v5.5. Administrator s Guide. Ahsay TM Online Backup - Development Department

MONIT. UNIX Systems Management

Operating System Structures

Installation and Configuration Manual

Version 1.0 Revision MODBUS/TCP Ethernet Communication Interface API for the Intelligent Instrumentation WinCE Platform SETUP MANUAL

Virtual Private Systems for FreeBSD

System Calls and Standard I/O

Computer Security DD2395

Nixu SNS Security White Paper May 2007 Version 1.2

RTI Database Integration Service. Getting Started Guide

CIS 551 / TCOM 401 Computer and Network Security

Deploying Intellicus Portal on IBM WebSphere

How To Harden Ancient Mac Xp On Mac Moonlight (Mac) On A Macbook V.Xo (Apple) With A Hardening Mode On A Windows Xp On A

Security Provider Integration RADIUS Server

Active Directory Integration for Greentree

<COMPANY> PR11 - Log Review Procedure. Document Reference Date 30th September 2014 Document Status. Final Version 3.

Lieberman Software. RSA SecurID Ready Implementation Guide. Account Reset Console. Partner Information. Last Modified: March 20 th, 2012

Integrated Migration Tool

The Win32 Network Management APIs

Mapping EventTracker Reports and Alerts To FISMA Requirements NIST SP Revision 3 Prism Microsystems, August 2009

EMC ApplicationXtender Server

EMC ApplicationXtender Server

Incremental Backup Script. Jason Healy, Director of Networks and Systems

Writing a C-based Client/Server

SSH and Basic Commands

CRYPTOCard Authentication. Using PAM for Linux and Solaris. Quick Start Guide. Copyright CRYPTOCard Corporation All Rights Reserved

What s New in MySQL 5.7 Security Georgi Joro Kodinov Team Lead MySQL Server General Team

SSSD Active Directory Improvements

Performance Monitor. Intellicus Web-based Reporting Suite Version 4.5. Enterprise Professional Smart Developer Smart Viewer

SnapLogic Salesforce Snap Reference

Contents III: Contents II: Contents: Rule Set Based Access Control (RSBAC) 4.2 Model Specifics 5.2 AUTH

IDENTITIES, ACCESS TOKENS, AND THE ISILON ONEFS USER MAPPING SERVICE

Installing QuickBooks Enterprise Solutions Database Manager On Different Linux Servers

MatrixSSL Developer s Guide

Using Symantec NetBackup with Symantec Security Information Manager 4.5

How To Set Up A Macintosh With A Cds And Cds On A Pc Or Macbook With A Domain Name On A Macbook (For A Pc) For A Domain Account (For An Ipad) For Free

NSA Security-Enhanced Linux (SELinux)

How To Fix A Snare Server On A Linux Server On An Ubuntu (Amd64) (Amd86) (For Ubuntu) (Orchestra) (Uniden) (Powerpoint) (Networking

Snare System Version Release Notes

Access Control. ITS335: IT Security. Sirindhorn International Institute of Technology Thammasat University ITS335. Access Control.

Wolfr am Lightweight Grid M TM anager USER GUIDE

Linux OS-Level Security Nikitas Angelinas MSST 2015

Monitor Print Popup for Mac. Product Manual.

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

Windows XP Exchange Client Installation Instructions

Unix::Statgrab - System Monitoring

Best Practices, Procedures and Methods for Access Control Management. Michael Haythorn

owncloud Configuration and Usage Guide

PRINT CONFIGURATION. 1. Printer Configuration

Siteminder Integration Guide

ELEN 602: Computer Communications and Networking. Socket Programming Basics

Transcription:

FreeBSD Developer Summit TrustedBSD: Audit + priv(9) Robert Watson FreeBSD Project Computer Laboratory University of Cambridge

TrustedBSD Audit Quick audit tutorial Adding audit support to new kernel features Userland audit work Privileges Priv(9) API

Introduction to Audit Log of security-relevant events Secure Reliable Fine-grained Configurable A variety of uses including Post-mortem analysis Intrusion detection Live system monitoring, debugging

Audit Basics Audit records describe individual events Attributable (to an authenticated user) Non-attributable (no authenticated user) Selected (configured to be audited) Most audit events fall into three classes Access control Authentication Security management Audit log files are called trails

Auditable Events Access control System calls checking for super user privilege System calls with file system access control checks Including path name lookup! Login access control decisions Authentication, Account Management Password changes, successful authentication, failed authentication, user administration Audit related events

Audit Software Components Kernel audit event engine Event allocation, preselection, argument gathering, event commit, queuing, worker thread, pipe system Kernel event gathering System calls, argument gathering OpenBSM Userland tools, library, configuration files Userland integration Login(1), su(1), sshd(8),...

BSM API and File Format Sun's Basic Security Module (BSM) de facto industry standard File formats APIs Token-oriented audit trail format (almost TLV) Audit configuration and databases Construct, parse, process audit record streams Manage audit state, pre-selection model Compatibility with many existing libraries and tools for free

Record Format Record header 0 or more variable argument tokens... (paths, ports,...) Subject token header,129,1,aue_open_r,0,tue Feb 21 00:12:23 2006, + 253 msec argument,2,0,flags path,/lib/libc.so.6 attribute,444,root,wheel,16842497,11663267,46706288 subject,-1,root,wheel,root,wheel,319,0,0,0.0.0.0 return,success,6 trailer,129 header,108,1,aue_close,0,tue Feb 21 00:12:23 2006, + 255 msec argument,2,0x6,fd attribute,444,root,wheel,16842497,11663267,46706288 subject,-1,root,wheel,root,wheel,319,0,0,0.0.0.0 return,success,0 trailer,108 Return token Trailer token

Audit Configuration: Pre-Selection Over 350 event types Most of them meaningless individually Each event assigned to one or more classes Class masks assigned to users 0:AUE_NULL:indir system call:no 1:AUE_EXIT:exit(2):pc 2:AUE_FORK:fork(2):pc 3:AUE_OPEN:open(2) - attr only:fa 4:AUE_CREAT:creat(2):fc 5:AUE_LINK:link(2):fc 6:AUE_UNLINK:unlink(2):fd 7:AUE_EXEC:exec(2):pc,ex 8:AUE_CHDIR:chdir(2):pc... 0x00000000:no:invalid class 0x00000001:fr:file read 0x00000002:fw:file write 0x00000004:fa:file attribute access 0x00000008:fm:file attribute modify 0x00000010:fc:file create 0x00000020:fd:file delete 0x00000040:cl:file close 0x00000080:pc:process 0x00000100:nt:network... root:lo:no audit:lo:no test:all:no www:fr,nt,ip:no...

Sample Audit Control Flow access() Audit permission argument Audit result, preselect, commit to record queue, wake up worker access() returns login uthread login kthread audit_worker kthread Audit preselect, possibly assign record to thread, possibly wait for queue space Audit pathname argument Dequeue audit record Convert record to BSM Commit to disk

Audit Queuing User processes Kernel Stable store Perthread queue Audit subsystem queue File system, Buffer cache

Audit Pipes Historically, audit for post-mortem analysis Today, for intrusion detection / monitoring Live record feed Lossy queue Audit subsystem queue File system, Buffer cache Audit pipe queue(s) process Discrete audit records process Independent streams Interest model

Tools, Setup, Etc Setup Compile in options AUDIT Set auditd_enable= YES in rc.conf Global settings: /etc/security/audit_control Per-user settings: /etc/security/audit_user Management Print audit trails: praudit Redice audit trails: auditreduce See handbook chapter, man pages for details

Some Kernel Details Global kernel queue, worker thread System call code allocates, commits record System calls capture arguments New system calls New proc/thread state struct thread {... struct kaudit_record *td_ar;... } struct proc {... struct auditinfo p_au;... }

Sample System Call: chmod(2) 14 AUE_MKNOD STD { int mknod(char *path, int mode, int dev); } 15 AUE_CHMOD STD { int chmod(char *path, int mode); } 16 AUE_CHOWN STD { int chown(char *path, int uid, int gid); } int kern_chmod(struct thread *td, char *path, enum uio_seg pathseg, int mode) { int error; struct nameidata nd; int vfslocked; } AUDIT_ARG(mode, mode); NDINIT(&nd, LOOKUP, FOLLOW MPSAFE AUDITVNODE1, pathseg, path, td); if ((error = namei(&nd))!= 0) return (error); vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); error = setfmode(td, nd.ni_vp, mode); vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return (error);

System Call Audit Principles Assign audit event type in syscalls.master (etc) Argument data stored in thread's kaudit_record AUDIT_ARG(type/entry, value) NDINIT() flags kaudit_record has storage for various types Bitmask flags for each entry New types may have to be added Converted to BSM in audit worker thread

Coordinating OpenBSM/Solaris/... Desirable to remain compatible with Solaris, Mac OS X if possible OpenBSM in contrib, maintained in p4 Event number allocation Selection of arguments to audit Changes in token stream format New user space APIs

Userland Auditing if (audit_submit(aue_su, auid, 1, EPERM, "bad su %s to %s on %s", username, user, mytty)) errx(1, "Permission denied"); Security-relevant tools should audit Currently, login, su, sshd, and some others do Requires root privilege Two API choices Constructed audit records using audit_open(3) Use audit_submit(3) to generate a generically structured audit record

TODO Finish syscall assignments, especially for ABIs Flesh out arguments Audit + NSS Userland sweep Ports/packages Enhance pipe preselection Multiple pipelines IDS/monitoring Distributed audit New parsing API Language bindings

Kernel Privilege API priv(9) Decompose UNIX security model UNIX process model Mandatory inter-user protections Discretionary access control Privilege model User model layered over kernel protections Privilege is the right to violate other policies Historically granted to processes with effective uid 0 Scoped by secureleval, jail, MAC, etc.

Replacing the Privilege API Existing privilege checks in the kernel error = suser(td) error = suser_cred(cred, flags) Reasons to replace suser(9) Offer finer granularity to decision code Allow auditing of privilege by type Virtual image privilege masks Centralize jail, securelevel policies Allow flexibility to configure, extend

priv(9) Replace all instances of suser(9) with priv(9) priv_check(td, priv) priv_check_cred(cred, priv, flags) Priv is a named privilege PRIV_VFS_READ, PRIV_NETINET_RESERVEDPORT,... Long list of named privileges by subsystem Eventual goal of removing jail privilege flag MAC can now instrument privilege decision

Where Do We Go From Here? Do not add new calls to suser(9) or suser_cred(9) Where it makes sense, use an existing privilege Where it doesn't, add a new privilege When allowing or disallowing in jail, for now use both SUSER_ALLOWJAIL and add to the kern_jail.c:prison_priv_check() switch Help sweep up remaining calls to suser(), look at the XXX comments first