Case Study: Access control 1 / 39



Similar documents
Case Studies. Joint software development Mail 1 / 38. Case Studies Joint Software Development. Mailers

Network Security - ISA 656 Intro to Firewalls

SSL Tunnels. Introduction

User Authentication Job Tracking Fax Transmission via RightFax Server Secure Printing Functions HDD/Memory Security Fax to Ethernet Connection

CSE 374 Programming Concepts & Tools. Laura Campbell (Thanks to Hal Perkins) Winter 2014 Lecture 16 Version control and svn

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

User Authentication Job Tracking Fax Transmission via RightFax Server Secure Printing Functions HDD/Memory Security Fax to Ethernet Connection Data

The Bazaar Version Control System. Michael Hudson, Canonical Ltd

Directory and File Transfer Services. Chapter 7

SMTP Servers. Determine if an message should be sent to another machine and automatically send it to that machine using SMTP.

IBM WebSphere Application Server Version 7.0

CEN 559 Selected Topics in Computer Engineering. Dr. Mostafa H. Dahshan KSU CCIS

Data Stored on a Windows Computer Connected to a Network

Pragmatic Version Control

Secure Shell Demon setup under Windows XP / Windows Server 2003

05.0 Application Development

Local File Sharing in Linux

Likewise Security Benefits

FINAL DoIT v.8 APPLICATION SECURITY PROCEDURE

RemotelyAnywhere. Security Considerations

Version control. HEAD is the name of the latest revision in the repository. It can be used in subversion rather than the latest revision number.

System Security Fundamentals

Security Advice for Instances in the HP Cloud

Firewalls 1 / 43. Firewalls

Git Basics. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 22

Data Stored on a Windows Server Connected to a Network

2 Installing Privileged User Manager 2.3

Managing your accounts

Virtualization Case Study

Auditing and Hardening Unix Systems Using CIS benchmarks on SUSE Linux

Data Stored on a Windows Computer Connected to a Network

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

2- Electronic Mail (SMTP), File Transfer (FTP), & Remote Logging (TELNET)

Written by: Johan Strand, Reviewed by: Chafic Nassif, Date: Getting an ipath server running on Linux

Basic Requirements...2. Software Requirements...2. Mailbox...2. Gatekeeper...3. Plan Your Setup...3. Meet Extreme Processing...3. Script Editor...

Continuous Integration. CSC 440: Software Engineering Slide #1

White Paper BMC Remedy Action Request System Security

CloudPassage Halo Technical Overview

Version Control. Luka Milovanov

Using Likewise Enterprise to Boost Compliance with Sarbanes-Oxley

CloudPassage Halo Technical Overview

Distributed File Systems Part I. Issues in Centralized File Systems

CIS 551 / TCOM 401 Computer and Network Security

XGENPLUS SECURITY FEATURES...

Configuring Your Client: Outlook Express

SYSTEM ADMINISTRATION MTAT LECTURE 8 SECURITY

Server Security. Contents. Is Rumpus Secure? 2. Use Care When Creating User Accounts 2. Managing Passwords 3. Watch Out For Aliases 4

IT Support Tracking with Request Tracker (RT)

Desktop : Ubuntu Desktop, Ubuntu Desktop Server : RedHat EL 5, RedHat EL 6, Ubuntu Server, Ubuntu Server, CentOS 5, CentOS 6

Linux Network Administration

Introduction. Friday, June 21, 2002

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

Talk Internet User Guides Controlgate Administrative User Guide

CMSC 421, Operating Systems. Fall Security. URL: Dr. Kalpakis

Google Apps and Open Directory. Randy Saeks

Configuration Task 3: (Optional) As part of configuration, you can deploy rules. For more information, see "Deploy Inbox Rules" below.

Practical Mac OS X Insecurity. Security Concepts, Problems and Exploits on your Mac

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

Before starting to use the new system you will need to know the password to your e-wire account.

APPENDIX 4 GREATER LONDON AUTHORITY SUN ACCOUNTS UNIX REVIEW FINAL AUDIT REPORT. Auditor: Chris Power & Michael Lacey Date: April 2003 Reference: 320

View access control as a matrix Subjects (processes/users) access objects (e.g., files) Each cell of matrix has allowed permissions

Using LDAP Authentication in a PowerCenter Domain

QMAIL & SMTP: A Secure Application for an Unsecure Protocol. Orr Dunkelman. orrd@vipe.technion.ac.il. January 27, 2004 SMTP and QMAIL Slide 1

Thick Client Application Security

Operating System Security

Nixu SNS Security White Paper May 2007 Version 1.2

Enabling Active Directory Authentication with ESX Server 1

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

How To Manage Web Content Management System (Wcm)

Remote Administration

Quick Scan Features Setup Guide

Setup Guide. Archiving for Microsoft Exchange Server 2007

15 AFS File Sharing. Client/Server Computing. Distributed File Systems

Unifying Information Security. Implementing TLS on the CLEARSWIFT SECURE Gateway

Module 7 Security CS655! 7-1!

enicq 5 System Administrator s Guide

Lab 0: Version control

Version Control with. Ben Morgan

Configuring Your Client: Outlook Express. Quick Reference

StarterPlus Mailbox Software Setup Guide

Last Updated: July STATISTICA Enterprise Server Security

Workflow Templates Library

CIS 551 / TCOM 401 Computer and Network Security. Spring 2005 Lecture 4

Access Control Lists in Linux & Windows

USERS MANUAL FOR OWL A DOCUMENT REPOSITORY SYSTEM

Scheduling in SAS 9.3

Dell KACE K1000 System Management Appliance Version 5.4. Service Desk Administrator Guide

Overview of Network Security The need for network security Desirable security properties Common vulnerabilities Security policy designs

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

Active Directory Self-Service FAQ

Architecture and Mode of Operation

Snare System Version Release Notes

TFS UnixControl White Paper

Snare System Version Release Notes

Linux VPS with cpanel. Getting Started Guide

CISC 275: Introduction to Software Engineering. Lab 5: Introduction to Revision Control with. Charlie Greenbacker University of Delaware Fall 2011

APPLICATION LAYER: TELNET, . By Nidhi Jindal

Git - Working with Remote Repositories

Deciphering the Safe Harbor on Breach Notification: The Data Encryption Story

Transcription:

Case Study: Access control 1 / 39

Joint software development Mail 2 / 39

Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications 3 / 39

Situations Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Small team on a single machine Medium-to-large team on a LAN Large, distributed team, spread among several organizations 4 / 39

Roles Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Developer (i.e., can commit changes) Tester Code reviewer 5 / 39

Permissions Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications We want the technical mechanisms to reflect the organizational roles The real challenge: mapping the organizational structure to OS primitives Why? 6 / 39

Why Enforce s? Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Protect software from outsiders reading/stealing it Protect against unauthorized changes That can include internal rivalries Know who made certain changes? 7 / 39

Classic Unix Setup Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Assume you just have user/group/other permissions, with no ACLs. How would you set things up? Put all developers in a certain group Make files and directories group readable/writable Decision to turn off other read access is site-dependent 8 / 39

ACL Setup Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Could add each developer individually Bad idea if a developer leaves or joins the group, many ACLs must be updated Still want to use groups; vary group membership instead Advantage: can have multiple sets of group permissions why? 9 / 39

Reviewer/Tester Access Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Reviewers and testers need read access They do not need write access No good, built-in solution on classic Unix With ACLs, one group can have r/w permissions; another can have r permissions 10 / 39

Medium-Size Group Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications No longer on single machine with simple file permissions More need for change-tracking More formal organizational structure 11 / 39

Basic Structure Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Basic permission structure should be the same Again: use group permissions as the fundamental permission unit Limits of non-acl systems become more critical 12 / 39

Version Control Systems Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications For medium-size projects, use of a version control system (i.e., CVS, Subversion, Mercurial, RCS, etc.) is mandatory (Why?) What are the permission implications of a version control system? 13 / 39

Why use a VCS? Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Auditability who made which change? When was a given change made? Can you roll back to a known-clean version of the codebase? What patches have been applied to which versions of the system? 14 / 39

Note Well Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications All of those features are important just for manageability Security needs are strictly greater we have to deal with active malfeasance as well as ordinary bugs and failures 15 / 39

Structure of a VCS Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Repository Master copy; records all changes, versions, etc. Working copies Zero or more working copies. Developers check out a version from the repository, make changes, and commit the changes 16 / 39

Permission Structure Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Here are the Unix client commands for RCS, CVS, Mercurial, and Subversion. What are the security implications? $ ls -l /usr/bin/ci /usr/bin/cvs \ /usr/pkg/bin/hg /usr/pkg/bin/svn -r-xr-xr-x 1 root wheel /usr/bin/ci -r-xr-xr-x 1 root wheel /usr/bin/cvs -rwxr-xr-x 1 root wheel /usr/pkg/bin/hg -rwxr-xr-x 1 root wheel /usr/pkg/bin/svn 17 / 39

They re Not SetUID! Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications They execute with the permissions of the invoker They could try to do access control, but it s meaningless anyone else could write code to do the same things The permission structure of the repository is what s important 18 / 39

The Repository Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Essential feature: developers must have write permission on the directories File permissions are irrelevant; old files can be renamed and unlinked instead of being overwritten (Potential for annoyance if new directories are created with the wrong permission must set umask properly) But what prevents a developer with write permission on the respository from doing nasty things? Nothing... 19 / 39

Large Organization Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications Use client/server model for repository access Most users (including developers) have no direct access to the VCS repository Either build access control into VCS server or layer on top of underlying OS permissions But must restrict what commands can be executed on repository by developers 20 / 39

Complications Situations Roles Permissions Why Enforce Access Controls? Classic Unix Setup ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Why use a VCS? Note Well Structure of a VCS Permission Structure They re Not SetUID! The Repository Large Organization Complications If you rely on OS permissions, something has to have root privileges, to let the repository part of the process run as that user If the VCS itself has a root component, is it trustable? If you use, say, ssh, is the command restriction mechanism trustable? If you rely on VCS permissions, you need to implement a reliable authentication and ACL mechanism All of this is possible but is it secure? 21 / 39

Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? 22 / 39

Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Issue of interest: local mail delivery and retrieval Surprisingly enough, network email doesn t add (too much) security complexity 23 / 39

Issues Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Email must be reliable Users must be able to send email to any other users The system should reliably identify the sender of each message All emails should be logged Locking is often necessary to prevent race conditions when reading and writing a mailbox Authentication 24 / 39

Accepting Mail Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Must accept mail from users Copy it, either to protected spool directory for network delivery or directly to recipient s mailbox 25 / 39

Spool Directory Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? If the mailer is setuid, it can copy the email to a protected directory with no trouble If the directory is world-writable but not world-readable, you don t even need setuid add a random component to the filenames to prevent overwriting (Homework submission script does this) File owner is automatically set correctly, for use in generating From: line 26 / 39

However... Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Cannot securely write metadata for such directories others could overwrite the metadata file Cannot prevent users from overwriting their own pending email Listing the mail queue still requires privilege 27 / 39

Local Access or Client/Server? Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? For client/server, issues are similar to VCS: authentication, root programs, restricting actions, etc For local access, must confront permission issues This is complicated by the many different versions of Unix over the years 28 / 39

Client/Server Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Standardized, (relatively) simple access protocols, POP and IMAP For ISP or large enterprise, neither need nor want general shell-type access to mail server Large system mailers have their own authentication database Does not rely on OS permissions But a mail server bug exposes the entire mail repository Also how do users change their passwords? 29 / 39

Bug Containment Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Separate programs into two sections: Small, simple section that does authentication and changes uid (must run as root) Large section that runs as that user Major advantage: security holes in large section don t matter, since it has no special privileges Much more on program structure later in the semester 30 / 39

Local Mail Storage Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Where is mail stored? Central mailbox directory or user s home directory? Note that mail delivery program must be able to (a) create, and (b) write to mailboxes If mailbox is in the user s directory, mail delivery program must have root permissions 31 / 39

Central Mail Directory Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? We can put all mailboxes in, say, /var/mail What are the permissions on it? If it s writable by group mail, delivery daemon can create new mailboxes Make mailboxes writable by group mail, and owned by the recipient? Permits non-root delivery but how do new mailboxes get created and owned by the user? 32 / 39

Dangers of User-Writable Mailbox Directories Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Permission escalation Vandalism Denial of service ln -s /etc/passwd /var/mail/me rm /var/mail/you touch /var/mail/does-not-exist-yet 33 / 39

Defending Against These Attacks Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Escalation Check mailbox permissions and ownership before writing (note: watch for race conditions) Vandalism Set sticky bit on directory DoS Remove (or change ownership of) mailboxes with wrong ownership Note well: most of these are trickier than they seem 34 / 39

Delivering Mail to a Program Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Most mail systems permit delivery of email to a program Must execute that program as the appropriate user (Who is the appropriate user? Note that on Solaris, you may (depending on system configuration) be able to give away files) Implies the need for root privileges by the local delivery program 35 / 39

Privileged Programs Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? What must be privileged? What privileges? Local delivery needs some privileges, frequently root Delivery to a program always requires root The mail reader? 36 / 39

Privileged Mail Readers Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? The System V mail reader was setgid to group mail Could delete empty mailboxes More importantly, could create lock files by linking in the mailbox directory But note the danger if the mailer was buggy You don t give privileges to a whale (about 21K lines of code... ) 37 / 39

Many More Subtleties Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? Writing a mailer is hard I ve barely scratched the surface of the design decisions, even the permission-related ones Complicated by varying system semantics 38 / 39

Why is it Hard? Issues Accepting Mail Spool Directory However... Local Access or Client/Server? Client/Server Bug Containment Local Mail Storage Central Mail Directory Dangers of User-Writable Mailbox Directories Defending Against These Attacks Delivering Mail to a Program Privileged Programs Privileged Mail Readers Many More Subtleties Why is it Hard? cross protection boundaries That is, they copy data from one permission context to another Both can be arbitrary userids Simply importing data to a userid is a lot easier In addition, a lot of functionality is needed Not surprisingly, mailers have a very poor security record 39 / 39