Security: CS403/534 Distributed Systems Erkay Savas Sabanci University
Security: CS403/534 Distributed Systems Erkay Savas Sabanci University
Part II
CS403/534
Distributed Systems
Erkay Savas
Sabanci University
1
Access Control
• Authorization: granting access rights
• Access control: verifying the access rights
• General Issues
• Firewalls
• Secure mobile code
– Protecting mobile code
– Protecting the host against mobile code
2
Access Control: a Model
• General model of controlling access to objects.
Reference
Subject Object
Monitor
Request for Authorized
operation Request
5
Access Control Mechanisms (3)
• Alternatives
2. Capabilities: Each subject is given a list of capability
it has for each object.
– Not having a capability for a specific object means
the subject has no access rights for the object.
– Capability can be compared to a ticket giving its
holder certain rights
O1 O 2 l O j l Om
[
S i 0 e i2 l e ij l e im ]
⇓
[
S i e i2 l e ij l e im ]
– Capability must be protected against modifications
by the holder 6
ACL vs. Capabilities
Client Server
ACL Object
Create access request
R as subject S. (S, R)
If(S appears in ACL)
if ( R appears in ACL[S])
grant access;
Client Server
C
Object
Create access request
R for object O. (O, R), C
Pass capability C if ( R appears in C)
grant access;
7
Protection Domains
• Issue: ACL or a capability list can still become
quite large. Reduce ACLs by means of protection
domains.
– A protection domain is an execution environment
shared by a collection of processes (subjects).
– It contains a set of (object, access rights) pairs,
listing the object than can be accessed by all
processes executing within the domain and specifying
the operations permitted on each resource.
– For example, in UNIX, the protection domain of a
process is determined by the group identifier attached
to the process at login time.
• Implementation types
– Groups: users belongs to a specific group that has
associated access rights 8
Protection Domains: Groups of Users
World
Sabanci Anonymous
… …
Erkay Ahmet Mehmet
11
Firewalls (1)
• As long as an isolated distributed system is
concerned, the techniques we have seen so far
protect the system.
• But, what happens when outsiders are allowed to
access the resources controlled by the
distributed system?
• External accesses are controlled by a special
type of reference monitor known as a Firewall.
• Basically two types:
1. Packet Filtering Gateway (router): It operates as a
router and makes decisions as to whether or not to
pass a network packet based on the source and
destination address contained in the packet’s header.
12
Firewalls (2)
• A common implementation of a firewall.
20
Protection in Java
• It implements sandbox model.
– It is easy to implement sandbox model with
interpreted code.
• Overview:
– Each Java code consists of a number of classes from
which objects are created.
– No global variables, and functions; everything is part
of a class.
– Program execution starts at a method called main.
– A Java program is compiled into a set of instructions
(so called bytecode) interpreted by JVM.
– JVM executes the bytecode by interpreting each of
its instructions.
21
Class Loaders
1. Class Loader:
– is responsible for downloading a specified class from a
location and installing it in the client’s address space at
run time.
– JVM can create objects by instantiating the
downloaded classes.
– A Class loader is just another Java class.
– Java uses only trusted class loaders.
– A developer can write his own class loader for
specialized purposes such as carrying out special
security check before passing the bytecodes to the
JVM.
– A Java program can install a class loader; but it cannot
change its own class loader by which it could
circumvent the way the class loading is normally
handled. 22
Bytecode Verifier
2. Bytecode Verifier:
• The second component in the sandbox model which
checks whether a downloaded class obeys the security
rules.
• No illegal instructions, instructions that could corrupt
the stack and memory, uninitialized variables, etc.
• Only classes downloaded from external servers are
checked.
• Classes located on client’s machine are generally
trusted.
• Question: A class file generated by a compiler for the
Java programming language always passes bytecode
verification. Why is it necessary then to check the
bytecode with the verifier?
23
Protection in Java: Overview
• The organization of a Java sandbox.
Loaded
class Class
Class Class
object verifier
repository repository
Java program
Request
class
Loader Loader
for local for remote
Java Interpreter
classes classes
creates
An object that
encapsulates both
Class Protection the code source and
Domain the collection of
permission of the class
CodeSource
URL Permissions
…
Certificate 29
RMI Security Manager
• In a RMI application, the client program must install a
new security manager.
• System.setProperty("java.security.policy", "client.policy");
System.setSecurityManager(new RMISecurityManager());
31
How Security Manager Works - 2
• Call stack during permission checking
32