Docsity

Programming Assignment 1 - Secure Computer Systems - Fall 2005 | CS 6238, Assignments of Computer Science

Toggle sidebar
bg1
CS6238 Secure Computer Systems
Programming Assignment 1
Due Date: 11:59pm March 20, 2005
Traditional UNIX security model allows users to set different levels of access to a file based on
three basic permissions modes (read/write/execute) and three classes of users (owner/group/other).
You can use this model to grant any combination of the three permissions to any class of users. In
this programming assignment, you will be asked to augment this coarse grain access control model
to allow finer file access control.
To complete the project, you will have to implement the following subsystems:
1. The reference monitor. This is implemented by a parent process which makes use of a call like
ptrace() to intercept all the system calls requested by the child processes that have to do with
file access (at least, you need to intercept open(), close(), read() and write()). This way, there is
no way to bypass the access check (complete mediation property of reference monitor). The
reference monitor implements Windows 2000 like access control list for each file with access
control entries. The ACLs include user and group identifiers and access rights that can be
positive or negative. It accesses the user’s credential record to determine if a file access
request should be granted. If yes, the execution of the system call could resume; otherwise, the
original system call should be nullified (say to getpid()). You can assume a flat name space for
the files (we only work with files under the current directory) and hence do not worry about the
pathnames and directories.
2. Two user-level utilities: setfacl & getfacl. The setfacl utility is used to set an access control list
with a given file. It takes in two parameters, acl-entries and file. The first parameter represents a
list of ACL entries separated by comma, and the second is the pathname of the file. The
following ACL entry formats should be recognized.
u:username:([-]perm)*
g:groupname:([-]perm)*
o::([-]perm)*
The perm can be either r, or w, or x, which represents the read/write/execute permission mode
respectively. The ‘-‘ symbol indicates whether the access right is positive or negative.
The getfacl utility takes exactly one parameter, file. It should display the filename, user, group,
and the ACL in readable format.
Here are some examples to use these two commands:
setfacl u::rwx,g::r-x,o::,u:alice:r-w-x,u:bob:rwx foo
getfacl foo
3. A terminal shell program. When started, it should initiate the reference monitor to mediate all the
file access system calls. Then, it will wait for the user keyboard input, and use fork()/exec() to
run the user command (say ls, cat, setfacl, getfacl, etc.) in a child process. You will need to use
this shell program to demonstrate the functionality of your system.
pf2

Partial preview of the text

Download Programming Assignment 1 - Secure Computer Systems - Fall 2005 | CS 6238 and more Assignments Computer Science in PDF only on Docsity!

CS6238 Secure Computer Systems

Programming Assignment 1

Due Date: 11:59pm March 20, 2005

Traditional UNIX security model allows users to set different levels of access to a file based on three basic permissions modes (read/write/execute) and three classes of users (owner/group/other). You can use this model to grant any combination of the three permissions to any class of users. In this programming assignment, you will be asked to augment this coarse grain access control model to allow finer file access control.

To complete the project, you will have to implement the following subsystems:

  1. The reference monitor. This is implemented by a parent process which makes use of a call like ptrace() to intercept all the system calls requested by the child processes that have to do with file access (at least, you need to intercept open() , close() , read() and write() ). This way, there is no way to bypass the access check (complete mediation property of reference monitor). The reference monitor implements Windows 2000 like access control list for each file with access control entries. The ACLs include user and group identifiers and access rights that can be positive or negative. It accesses the user’s credential record to determine if a file access request should be granted. If yes, the execution of the system call could resume; otherwise, the original system call should be nullified (say to getpid() ). You can assume a flat name space for the files (we only work with files under the current directory) and hence do not worry about the pathnames and directories.
  2. Two user-level utilities: setfacl & getfacl. The setfacl utility is used to set an access control list with a given file. It takes in two parameters, acl-entries and file. The first parameter represents a list of ACL entries separated by comma , and the second is the pathname of the file. The following ACL entry formats should be recognized. u: username : ([-]perm)* g: groupname : ([-]perm)* o:: ([-]perm)* The perm can be either r, or w, or x, which represents the read/write/execute permission mode respectively. The ‘-‘ symbol indicates whether the access right is positive or negative. The getfacl utility takes exactly one parameter, file. It should display the filename, user, group, and the ACL in readable format. Here are some examples to use these two commands: setfacl u::rwx,g::r-x,o::,u:alice:r-w-x,u:bob:rwx foo getfacl foo
  3. A terminal shell program. When started, it should initiate the reference monitor to mediate all the file access system calls. Then, it will wait for the user keyboard input, and use fork()/exec() to run the user command (say ls, cat, setfacl, getfacl, etc.) in a child process. You will need to use this shell program to demonstrate the functionality of your system.

You can use the user account information (after successfully login onto a Linux/Unix machine) as a credential record rather than implement your own authentication module.

During the demo, you will need to demonstrate your system is working. Minimally, you should demonstrate the following:

  1. An authorized user is allowed to read and write file data.
  2. A member of an authorized group is able to access the file data even when the user does not have direct access.
  3. Unauthorized user is not able to access the file data.
  4. Negative access rights prevent a user from accessing file data when a group to which it belongs does have access to the file data.

Notes

 You could work on teams of up to two members for this project.  Project 1 is due before the midnight of March 15th, 2005.  Before the due date, you should turn in: (1) a report in PDF format about your design decisions and some design & implementation details; (2) all the relevant source codes; (3) a short MANIFEST describing each file and directory and a README file which includes the instructions to compile and run the codes. All the turn-in materials should be compressed as a tarball. The turn-in tarball should be named like “cs6238__.tar.gz”.  Close to the due date, the TA will post a number of “demo” slots on either the class homepage or some wiki page. Please select a time that all team members can be present and look for the TA in the Intel lab. During the demo, each team member will be asked a few questions related to the project material. You should also expect to demonstrate that the augmented access control model is working. The team will be issued a grade based on your overall performance.

Resources

See man page ptrace(2) for more information about the ptrace() system call. You may also want to take a look at the following two links to learn how to play with ptrace(). Playing with ptrace, Part I http://www.linuxjournal.com/article/ Playing with ptrace, Part II http://www.linuxjournal.com/article/