Unix Security Issues Process Creation/Space Users and Groups File Permissions Relationship of Program and File Security.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

1 CS345 Operating Systems Φροντιστήριο Άσκησης 1.
CSCC69: Operating Systems
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX – The Process The Process A process is.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Processes CSCI 444/544 Operating Systems Fall 2008.
CS 311 – Lecture 14 Outline Process management system calls Introduction System calls  fork()  getpid()  getppid()  wait()  exit() Orphan process.
Process Process: the UNIX abstraction of a stand-along computer that manages resources (memory, CPU, I/O resources) comprising a running program. Processes.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Process in Unix, Linux and Windows CS-3013 C-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
Unix & Windows Processes 1 CS502 Spring 2006 Unix/Windows Processes.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Description and Control A process is sometimes called a task, it is a program in execution.
University of Pennsylvania 9/12/00CSE 3801 Multiprogramming CSE 380 Lecture Note 3.
Phones OFF Please Processes Parminder Singh Kang Home:
Process. Process Concept Process – a program in execution Textbook uses the terms job and process almost interchangeably A process includes: – program.
UNIX Processes. The UNIX Process A process is an instance of a program in execution. Created by another parent process as its child. One process can be.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
Process in Unix, Linux, and Windows CS-3013 A-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
Introduction to Processes CS Intoduction to Operating Systems.
Today’s Topics Introducing process: the basic mechanism for concurrent programming –Process management related system calls Process creation Process termination.
The process concept (section 3.1, 3.3 and demos)  Process: An entity capable of requesting and using computer resources (memory, CPU cycles, files, etc).
Day 11 SAMBA NFS Logs Managing Users. SAMBA Implements the ability for a Linux machine to communicate with and act like a Windows file server. –Implements.
The Structure of Processes. What is a Process? an instance of running program Program vs process(task) Program : just a passive collection of instructions.
Module 4 - File Security. Security Overview File Ownership Access to Files and Dircetories Changing File and Directory Ownership Changing File and Directory.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Creating and Executing Processes
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Users Greg Porter V1.0, 26 Jan 09. What is a user? Users “own” files and directories Permission based on “ownership” Every user has a User ID (UID) 
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.
8-Sep Operating Systems Yasir Kiani. 8-Sep Agenda for Today Review of previous lecture Process scheduling concepts Process creation and termination.
Agenda  Working with Processes: Purpose Running Programs within same process (execl, execlp, execle, execv, execvp, execve) “Spawning” other process (fork,
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
System calls for Process management
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
Λειτουργικά Συστήματα - Lab1 Γιάννης Πετράκης. The Operating System  Unix is a layered operating system  The innermost layer is the hardware that provides.
Concurrency & Context Switching Process Control Block What's in it and why? How is it used? Who sees it? 5 State Process Model State Labels. Causes of.
Operating Systems Process Creation
CS4315A. Berrached:CMS:UHD1 Process Management Chapter 6.
What is a Process? u A process is an executable “cradle” in which a program may run u This “cradle” provides an environment in which the program can run,
4300 Lines Added 1800 Lines Removed 1500 Lines Modified PER DAY DURING SUSE Lab.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Unix System Calls and Posix Threads.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
CSCI 330 The UNIX System Unit V Permissions. all access to directories and files is controlled UNIX uses discretionary access control (DAC) model each.
SUSE Linux Enterprise Desktop Administration Chapter 9 Manage Users, Groups, and Permissions.
System calls for Process management Process creation, termination, waiting.
Agenda Managing Processes (Jobs) Command Grouping Running jobs in background (bg) Bringing jobs to foreground (fg), Background job status (jobs) Suspending.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
1 Unix system calls fork( ) wait( ) exit( ). 2 How To Create New Processes? n Underlying mechanism -A process runs fork to create a child process -Parent.
Company LOGO Security in Linux PhiHDN - VuongNQ. Contents Introduction 1 Fundamental Concepts 2 Security System Calls in Linux 3 Implementation of Security.
Unix Process Management
UNIX System Overview.
Processes in Unix, Linux, and Windows
Unix Access Control Basic CE 2
Structure of Processes
Processes in Unix, Linux, and Windows
Processes in Unix, Linux, and Windows
Operating Systems Lecture 6.
Security and File Permission
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
CSE 451: Operating Systems Winter 2003 Lecture 4 Processes
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Processes in Unix, Linux, and Windows
Processes in Unix and Windows
CS510 Operating System Foundations
Process Description and Control in Unix
Process Description and Control in Unix
Presentation transcript:

Unix Security Issues Process Creation/Space Users and Groups File Permissions Relationship of Program and File Security

Process Concepts How they are created and managed

Programs & Processes Program : an executable Process(task) : an instance of a program. There can be many! Multi-tasking os : simultaneous execution of many tasks. –Some preemptive(process gives up CPU cyclically) –Others non-preemptive (process doesn’t give up CPU). Examples : –In unix when you are running x-terminal windows, you can start a program in one window and go to work on another application in another window. Preemptive because all processes appear busy. –In windows, when an application goes off to do a job, it will not return control to the keyboard (process messages) until the job finishes UNLESS the app is programmed to spawn threads. App must do it explicitly in windows.

Processes and IDs Processes have id numbers assigned by unix These numbers are for the purpose of communicating between processes, “kill”ing processes etc. These numbers are reused by the O.S. as new process numbers are required. These numbers (group and process) have NOTHING to do with user ids.

Process IDs Numbers –0 swapper/scheduler –1 init –2 pagedaemon Assigned by the kernel (not a process) ID, ParentID, GroupID for each process. Other ids associated with permissions.

Process Creation Kernel swapper PID0 pagedaemon PID2 init PID1 Child Parent

Creation of Child Processes Created with fork () Child has own process id. Different from parent. getpid() returns your own process id getppid() returns parent’s process id Parent can not find child processes as easily fork () returns child PID to parent if parent dies, init process becomes parent

Signals Communicate between processes –process to process –kernel to process Signals are simple integer messages Process can define its own handler Process can choose to ignore a Signal

Controlling Signal handling signal ( signame, your function to handle) or signal(signame, SIG_IGN); to ignore the signal altogether returns a function result which is the OLD handler. save the old handler and restore when done.

Critical Regions can’t be interrupted in between statements datebase updating and inserting into lists int oldmask; oldmask = sigblock(mask of signals to block); /* critical region */ sigsetmask(oldmask);

kill( pid, sig#) Does NOT kill. Sends a signal to a process. pid special values (examples) – 0 all in sending process group – -1 all processes whose real id = effective user of the sending process. AND OTHERS

Process Groups Processes are a member of a process group Process group is a process and all siblings Process group number is that of oldest (highest) PID New numbering (re)set by setgpid() Group id found by getpgid() Groups for the purpose of signalling all group members

Users and Groups Determining what you can access

Users Users are defined by two steps –making an entry in the password file –setting up a directory for the user file space jsmith:4r556$5t$:3032:120:John Smith:/home/jsmith:/bin/csh user encrypted password userid groupid real name home account shell

Passwords Passwords are stored encrypted Encryption process is not reversible –can’t determine password from encryption –at least not very easily –sys admin can’t tell you, must reset if lost When user logs in password is put through a standard encryption routine and result is compared with password file file is typically /etc/password –exhaustive search used to crack

Shadow Password stores passwords other than in /etc/passwd /etc/passwd still has general read permissions to associate owners w/ids etc stores actual encrypted password in a file only readable by root allows for password aging requiring users to change passwords within a predetermined time frame

Groups Groups are a mechanism to share files Users are in a single group by default –/etc/passwd Users can be members of many groups Owners can change the group designation of a file A file can only be in ONE group Groups (as users) are administered by root

File Ownership

Files and Ownership Access to files allows for degrees of use Three categories of ownership –owner –group –world Access is defined by the UNION of these three permission sets depending on the user. Each file is owned by ONE user and participates in ONE group –more on users and groups later

File Permissions : example ownergroupworld rwxrwx rwx = = = 1 = 761 -rwx rw- --x root other Jan thisfile owner group size filename

Directories r means the directory can be read/displayed w means files can be created/deleted x means you can traverse the directory –if not set the directory can be part of a path name but not examined directly All users have world permissions Users can get additional permissions by owing or being part of the assigned group

umask system has a default users can set their own default shows permissions NOT allowed e.g. umask = –file would be created 766

Processes and Users How do they relate?

Processes and Users When a process is run, it runs with permissions of the user who launches It can create files if the person who runs it can (not the owner of the process) The program can be written to use setuid to change the userid of the person running the program to someone else as indicated previously.

Real & Effective User/Group ID real user and group id from /etc/passwd effective initialized as same but can be changed real user/group is who is actually running effective is for determining permission –owner of the file, not the user running it Why would you want them to be different? non-privileged users accessing privlg. info

How does this suid work? -rwsr-xr-x …. root …. passwd program owned by root but run by someone else program runs as though owned by root root wrote the program so allow root to do what it wants on your behalf (change your password) chmod +s routine in program can now make suid call