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



Similar documents
Case Study: Access control 1 / 39

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

FINAL DoIT v.8 APPLICATION SECURITY PROCEDURE

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

Pragmatic Version Control

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

Managing your accounts

Secure Shell Demon setup under Windows XP / Windows Server 2003

05.0 Application Development

CloudPassage Halo Technical Overview

Local File Sharing in Linux

CIS 551 / TCOM 401 Computer and Network Security

Likewise Security Benefits

CloudPassage Halo Technical Overview

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.

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

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

White Paper BMC Remedy Action Request System Security

Security Advice for Instances in the HP Cloud

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

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

Distributed File Systems Part I. Issues in Centralized File Systems

2 Installing Privileged User Manager 2.3

Virtualization Case Study

System Security Fundamentals

Auditing and Hardening Unix Systems Using CIS benchmarks on SUSE Linux

Linux Network Administration

Enabling Active Directory Authentication with ESX Server 1

Using LDAP Authentication in a PowerCenter Domain

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

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

Data Stored on a Windows Computer Connected to a Network

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

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

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

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

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

Module 7 Security CS655! 7-1!

TFS UnixControl White Paper

Continuous Integration. CSC 440: Software Engineering Slide #1

Columbia University Web Security Standards and Practices. Objective and Scope

Version Control with. Ben Morgan

Version Control. Luka Milovanov

Workflow Templates Library

enicq 5 System Administrator s Guide

Using Likewise Enterprise to Boost Compliance with Sarbanes-Oxley

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

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

Snare System Version Release Notes

Active Directory Self-Service FAQ

XGENPLUS SECURITY FEATURES...

Configuring Your Client: Outlook Express

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)

Snare System Version Release Notes

How To Secure An Rsa Authentication Agent

on the RaQ 3. General. server. Services

Talk Internet User Guides Controlgate Administrative User Guide

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.

without the fixed perimeters of legacy security.

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

Using Network Attached Storage with Linux. by Andy Pepperdine

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

Thick Client Application Security

CUIT UNIX Standard Operating Environment and Security Best Practices

Operating System Security

Nixu SNS Security White Paper May 2007 Version 1.2

TELE 301 Lecture 7: Linux/Unix file

Web application security

Remote Administration

Quick Scan Features Setup Guide

LiteCommerce Advanced Security Module. Version 2.8

Technical White Paper BlackBerry Enterprise Server

Setup Guide. Archiving for Microsoft Exchange Server 2007

Unifying Information Security. Implementing TLS on the CLEARSWIFT SECURE Gateway

Transcription:

Joint software development Mail 1 / 38

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

Situations Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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 3 / 38

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

Permissions Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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? 5 / 38

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

Unix Setup Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well Permission Structure They re Not SetUID! The Repository Large Organization Complications Put all developers in a certain group Make files and directories group readable/writable Decision to turn off other read access is site-dependent 7 / 38

Windows ACL Setup Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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? 8 / 38

Reviewer/Tester Access Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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 9 / 38

Medium-Size Group Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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 10 / 38

Basic Structure Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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 11 / 38

Version Control Systems Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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? 12 / 38

Structure of a VCS Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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 13 / 38

Why use a VCS? Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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 / 38

Note Well Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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 / 38

Permission Structure Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well Permission Structure They re Not SetUID! The Repository Large Organization Complications Here are the Unix commands for RCS, CVS, Mercurial, and Subversion. What are the 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 16 / 38

They re Not SetUID! Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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 17 / 38

The Repository Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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... 18 / 38

Large Organization Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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 19 / 38

Complications Situations Roles Permissions Why Enforce Access Controls? Unix Setup Windows ACL Setup Reviewer/Tester Access Medium-Size Group Basic Structure Version Control Systems Structure of a VCS Why use a VCS? Note Well 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? 20 / 38

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? 21 / 38

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 22 / 38

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 note All emails should be logged Locking is often necessary to prevent race conditions when reading and writing a mailbox Authentication 23 / 38

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 24 / 38

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 25 / 38

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 (But if the spooler is executable but not readable, can it have a secret string to add to the filename? No figure out why!) Cannot prevent users from overwriting their own pending email Listing the mail queue still requires privilege 26 / 38

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 27 / 38

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? 28 / 38

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 29 / 38

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 30 / 38

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? 31 / 38

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 32 / 38

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 33 / 38

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 34 / 38

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? 35 / 38

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... ) 36 / 38

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 37 / 38

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 38 / 38