gLExec and OS compatibility

Slides:



Advertisements
Similar presentations
Open Science Grid Discovering and understanding the site environment Or, yet another site test kit.
Advertisements

CERN LCG Overview & Scaling challenges David Smith For LCG Deployment Group CERN HEPiX 2003, Vancouver.
On Multi-User Pilot Jobs Recovering control in an obfuscated world.
OSG AuthZ Architecture AuthZ Components Legend VO Management Services Grid Site GUMS Site Services SAZ CE Gatekeeper Prima Is Auth? Yes / No SE SRM gPlazma.
OpenVMS System Management A different perspective by Andy Park TrueBit b.v.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
1 CSE 380 Computer Operating Systems Instructor: Insup Lee and Dianna Xu University of Pennsylvania Fall 2003 Lecture Note: Protection Mechanisms.
Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.
Process Description and Control A process is sometimes called a task, it is a program in execution.
INFSO-RI Enabling Grids for E-sciencE gLExec, SCAS and the paths forward Introduction to pilot jobs and gLExec and SCAS framework.
INFSO-RI Enabling Grids for E-sciencE gLExec and OS compatibility David Groep Nikhef.
Chapter 4 UNIX Common Shells Commands By C. Shing ITEC Dept Radford University.
Grid job submission using HTCondor Andrew Lahiff.
Hands On UNIX II Dorcas Muthoni. Processes A running instance of a program is called a "process" Identified by a numeric process id (pid)‏  unique while.
Mine Altunay July 30, 2007 Security and Privacy in OSG.
Pilot Jobs John Gordon Management Board 23/10/2007.
EGI-InSPIRE RI EGI-InSPIRE EGI-InSPIRE RI Direct gLExec integration with PanDA Fernando H. Barreiro Megino CERN IT-ES-VOS.
INFSO-RI Enabling Grids for E-sciencE LCAS/LCMAPS and WSS Site Access Control boundary conditions David Groep NIKHEF.
Glexec, SCAS & CREAM. Milestones CREAM-CE capable of large-scale direct job submission Glexec & SCAS capable of large-scale use on WN in logging only.
Role Based VO Authorization Services Ian Fisk Gabriele Carcassi July 20, 2005.
CSI3131 – Lab 1 Observing Process Behaviour. Running Linux under Virtual PC  Start Virtual PC  This Windows program provides a virtual machine to run.
INFSO-RI Enabling Grids for E-sciencE glexec deployment models local credentials and grid identity mapping in the presence of complex.
OSG Site Admin Workshop - Mar 2008Using gLExec to improve security1 OSG Site Administrators Workshop Using gLExec to improve security of Grid jobs by Alain.
INFSO-RI Enabling Grids for E-sciencE glexec deployment models local credentials and grid identity mapping in the presence of complex.
INFSO-RI Enabling Grids for E-sciencE glexec on worker nodes David Groep NIKHEF.
Portable Batch System – Definition and 3 Primary Roles Definition: PBS is a distributed workload management system. It handles the management and monitoring.
Open Science Grid Build a Grid Session Siddhartha E.S University of Florida.
Proxy management mechanism and gLExec integration with the PanDA pilot Status and perspectives.
CSC414 “Introduction to UNIX/ Linux” Lecture 3
Unix System Administration Controlling Processes Chapter 5.
Security and VO management enhancements in Panda Workload Management System Jose Caballero Maxim Potekhin Torre Wenaus Presented by Maxim Potekhin at HPDC08.
HTCondor Security Basics HTCondor Week, Madison 2016 Zach Miller Center for High Throughput Computing Department of Computer Sciences.
EGEE-II INFSO-RI Enabling Grids for E-sciencE EGEE and gLite are registered trademarks Job Management Claudio Grandi.
Why you should care about glexec OSG Site Administrator’s Meeting Written by Igor Sfiligoi Presented by Alain Roy Hint: It’s about security.
Company LOGO Security in Linux PhiHDN - VuongNQ. Contents Introduction 1 Fundamental Concepts 2 Security System Calls in Linux 3 Implementation of Security.
Lecture 14 Page 1 CS 236 Online Secure Programming CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Condor Week Apr 30, 2008Pseudo Interactive monitoring - I. Sfiligoi1 Condor Week 2008 Pseudo-interactive monitoring in Condor by Igor Sfiligoi.
...looking a bit closer under the hood
SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz
OpenPBS – Distributed Workload Management System
Multi User Pilot Jobs update
HTCondor Security Basics
...looking a bit closer under the hood
Workload Management System
Glexec deployment models local credentials and grid identity mapping in the presence of complex schedulers David Groep NIKHEF.
Avani R.Vasant V.V.P. Engineering College
Chapter 6 Integrity Policies
John Gordon, STFC-RAL GDB 10 October 2007
Hands On UNIX AfNOG 2010 Kigali, Rwanda
glexec/SCAS pilot service
Grid Deployment Board meeting, 8 November 2006, CERN
Short update on the latest gLite status
Hands On UNIX AfNOG X Cairo, Egypt
Stephen Burke, PPARC/RAL Jeff Templon, NIKHEF
System Structure B. Ramamurthy.
A Real-time Intrusion Detection System for UNIX
Privilege Separation in Condor
HTCondor Security Basics HTCondor Week, Madison 2016
...looking a bit closer under the hood
CHAPTER 13 Processes.
Process Description and Control
Chapter 2: Operating-System Structures
Controlling Processes
Grid Management Challenge - M. Jouvin
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
CSE 153 Design of Operating Systems Winter 2019
Chapter 2: Operating-System Structures
Preventing Privilege Escalation
Least-Privilege Isolation: The OKWS Web Server
Presentation transcript:

gLExec and OS compatibility David Groep Nikhef

Outline What is glExec-on-WN (again) OS and Batch System Interoperability Starting and killing jobs Cleaning up files Pruning stray processes gLExec and OS integration – JRA1 All Hands February 2008 2

Use Case for ‘gLExec on the WN’ Make pilot job subject to normal site policies for jobs VO submits a pilot job to the batch system the VO ‘pilot job’ submitter is responsible for the pilot behaviour this might be a specific role in the VO, or a locally registered ‘special’ user at each site Pilot job obtains the true user job, and presents the user credentials and the job (executable name) to the site (gLExec) to request a decision on a cooperative basis Preventing ‘back-manipulation’ of the pilot job make sure user workload cannot manipulate the pilot project sensitive data in the pilot environment (proxy!) by changing uid for target workload away from the pilot gLExec and OS integration – JRA1 All Hands February 2008 3

Pilot Jobs and gLExec On success: the site will set the uid/gid to the new user’s job On failure gLExec will return with an error, and pilot job can terminate or obtain other user’s job gLExec and OS integration – JRA1 All Hands February 2008 4

gLExec deployment modes Identity Mapping Mode – ‘just like on the CE’ have the VO query (and by policy honour) all site policies actually change uid based on the true user’s grid identity enforce per-user isolation and auditing using uids and gids requires gLExec to have setuid capability Non-Privileged Mode – declare only do not actually change uid: no isolation or auditing per user the gLExec invocation will be logged, with the user identity does not require setuid powers – job keeps running in pilot space ‘Empty Shell’ – do nothing but execute the command… gLExec and OS integration – JRA1 All Hands February 2008 5

Identity change Let’s assume you make it setuid. Fine. Where to map to: To a shared set of common pool accounts Uid and gid mapping on CE corresponds to the WN Requires SCAS or shared state (gridmapdir) directory Clear view on who-does-what To a per-WN set of pool accounts No site-wide configuration needed Only limited (and generic) set of pool uids on the WN Need only as many pool accounts as you have job slots Makes cleanup easier, ‘local’ to the node Or something in between ... e.g. 1 pool for CE other for WN gLExec and OS integration – JRA1 All Hands February 2008 6

Starting and Killing Jobs The batch system performs the following basic functions Job Submission Job Suspend/Resume Job Kill CPU time accounting does not yet address enforcing sanity and user compliance from the test description of Ulrich Schwickerath gLExec and OS integration – JRA1 All Hands February 2008 7

Starting and Killing Jobs gLExec and OS integration – JRA1 All Hands February 2008 8

Testing it Can batch system suspend/kill the gLExec’ed processes? Test using gLExec itself Most ‘true’ tests Requires installation of gLExec and all dependencies Test using the sutest mini programme Same logic, but a stand-alone small (50-line) C programme No dependencies A few hard-coded constants to be set before compilation Trivial to test gLExec and OS integration – JRA1 All Hands February 2008 9

Session Preservation $ date && ps --forest -eo pid,ppid,sess,user,uid,euid,cmd Fri Feb 8 14:02:41 CET 2008 PID PPID SESS USER UID UID CMD 3294 1 3294 root 0 0 /usr/sbin/pbs_mom 18668 3294 18668 davidg 502 502 \_ -bash 18713 18668 18668 davidg 502 502 \_ /bin/sh …/jobs/33.tbn05.ni.SC 18715 18713 18668 nobody 99 99 \_ /project/sutest /bin/sleep 120 18716 18715 18668 nobody 99 99 \_ /bin/sleep 120 ... ... and Torque will kill all processes in the tree: $ date && qsub -q test tmp/tt.pbs Fri Feb 8 14:02:21 CET 2008 33.tbn05.nikhef.nl tbn05:~:1018$ cat tmp/tt.pbs #! /bin/sh date /project/sutest /bin/sleep 120 gLExec and OS integration – JRA1 All Hands February 2008 10

CPU accounting No change with respect to current behaviour of jobs Times are accumulated on wait and collated with the gLExec usage gLExec and OS integration – JRA1 All Hands February 2008 11

Forcing havoc on yourself $ ( date && ./sutest /bin/sleep 60 && date ) Fri Feb 8 16:41:24 CET 2008 Notice: identity changed to uid 99 ... 7508 1 7508 root 0 /usr/sbin/sshd 32122 7508 32122 root 0 \_ sshd: davidg [priv] 32124 32122 32122 davidg 502 | \_ sshd: davidg@pts/0 32126 32124 32126 davidg 502 | \_ -bash 17001 32126 32126 davidg 502 | \_ -bash 17003 17001 32126 nobody 99 | \_ ./sutest /bin/sleep 60 17004 17003 32126 nobody 99 | \_ /bin/sleep 60 # kill -9 17001 Killed 17003 1 32126 nobody 99 99 ./sutest /bin/sleep 60 17004 17003 32126 nobody 99 99 \_ /bin/sleep 60 gLExec and OS integration – JRA1 All Hands February 2008 12

Cleaning up files File cleanup: what do sites use today? Check for files owner by users not currently running a job? Who ‘is running’ becomes ill defined Need a ‘back-mapping’ tool that can trawl log files or a state dir tmpwatch(8) for old files? Change of uid does in influence this solution Transient TMPDIR facilities (PBSPro, Torque 2+)? Runs with root privileges anyway TMPDIR is inherited by the gLExec’ed child And is thus unaffected by gLExec gLExec and OS integration – JRA1 All Hands February 2008 13

Pruning stray processes Killing stray user processes ‘not owned by a user with a currently running process’ E.g. used at CERN/LSF Need a ‘back-mapping’ tool that can trawl log files or a state dir But: is not trustworthy to begin with on multi-job-slot machines! Kill processes that are ‘too old’ Will run as root anyway Unaffected, but is not trustworthy either Kill processes not ‘parented’ in a batch job gLExec will preserve the process tree, and thus this will work Will also slaughter daemonizing jobs today … which is a Good Thing™ gLExec and OS integration – JRA1 All Hands February 2008 14

Pruning User Processes https://www.nikhef.nl/grid/sysutils/prune_users/ For Torque in perl (simple migration to other systems) Kill processes that are not a child of a registered pbs_mom Uses the momctl command on the node Caveats Will usually not kill processes with a uid < 99 May optionally preserve top-level sshd sessions (beware of MPI) Does not protect against fork bombs gLExec and OS integration – JRA1 All Hands February 2008 15

Where are we now? You can deploy today if You run LSF or Torque and don’t manage disk or processes You run LSF or Torque and use TMPDIR and prone_userproc style job slaughtering You should wait for back-mapping tool (+update your script) if You use LSF or Torque and use uid recognition for pruning stray processes (but you ought to change this anyway) You use uid recognition for file cleaning Back-mapping tool is expected to be out of development in XXX weeks gLExec and OS integration – JRA1 All Hands February 2008 16

Summary and References https://www.nikhef.nl/grid/lcaslcmaps/glexec sutest program: https://www.nikhef.nl/grid/lcaslcmaps/glexec/osinterop https://twiki.cern.ch/twiki/bin/view/FIOgroup/FsLSFGridglExec gLExec and OS integration – JRA1 All Hands February 2008 17