CS865 – Distributed
Software Development
|
Lecture 9 |
Tannenbaum and Van Steen – Chapter 9
Security
Strategies for securing Distributed Systems
· Generally very similar to techniques used in a non-distributed system, only much more difficult to implement …
· Difficult to get right, impossible to get perfect!
Security Topics
1. Providing a secure communications channel – authentication, confidentiality and integrity.
2. Handling authorization – who is entitled to use what in the system?
3. Providing effective Security Management.
4. Example systems: SESAME and e-payment systems.
Types of Threats
Security Mechanisms
Key Point
Matching security mechanisms to threats is only possible when a Policy on security and security issues exists.
Example: The Globus Security Architecture (Chervenak et al., 2000).
Globus Security Policy (Foster et al., 1998):
· The Globus security architecture:
o consists of entities such as: users, user proxies, resource proxies, and general processes.
· Entities are located in domains and interact with each other.
· Security architecture defines four different protocols
· The Globus security architecture. (See diagram)
Design Issues
Three design issues when considering security:
Design Issue: Focus of Control
Three approaches for protection against security threats.
(a) Protection against invalid operations
(b) Protection against unauthorized invocations.
(c)
Protection against unauthorized users.
Design Issue: Layering of Security Mechanisms
Decision required as to where the security mechanism is to be placed.
Trust and Security
·
A system is either secure or it is not.
· Whether a client considers a system to be secure is a matter of trust.
· Layer in which security mechanisms are placed depends on the trust a client has in how secure the services are in any particular layer.
Example
Several sites connected through a wide-area backbone service.
Switched Multi-megabit Data Service (SMDS)
· If the encryption mechanisms cannot be trusted, additional mechanisms can be employed by clients to provide the level of trust required (e.g., using SSL (Secure Sockets Layer).
· Secure Sockets Layer and can be used to securely send messages across a TCP connection.
Distribution of Security Mechanisms
The Trusted Computing Base (TCB) is the set of services/mechanisms within a distributed system required to support a security policy.
Reduced Interfaces for Secure System Components (RISSC)
· Prevents clients and their applications from direct access to critical services. (Neumann 1995)
· Any security-critical server is placed on a separate machine isolated from end-user systems using low-level secure network interfaces.
· Clients and their applications run on different machines and can access the secured server only through these network interfaces.
The principle of RISSC as applied to secure distributed systems.
Design Issue: Simplicity
· Designing a secure computer system is difficult, regardless of whether it is also a DS.
· Using a few simple mechanisms that are easily understood and trusted to work is the ideal situation.
o Real world - introducing security mechanisms to an already complex system can make matters worse.
o However, this is still a design goal to aim for!
Security Mechanisms
Fundamental technique within any distributed systems security environment: Cryptography.
· A sender S wanting to transmit message m to a receiver R.
· The sender encrypts its message into an unintelligible message m', and sends m' to R.
· R must decrypt the received message into its original form m.
Three kinds of Intruders and eavesdroppers in communication.
· Original form of the message that is sent is called the plaintext, P
· Encrypted form is referred to as the ciphertext, illustrated as C.
Notation to relate plaintext, ciphertext, and keys.
C = EK(P) denotes that the ciphertext C is obtained by encrypting the plaintext P using key K.
P = DK(C) is used to express the decryption of the ciphertext C using key K, resulting in the plaintext P.
Types
of Cryptosystems:
Symmetric: often
referred to as conventional cryptography,
defined as:
o Symmetric cryptosystems => referred to as secret-key or shared-key systems
1. because the sender and receiver are required to share the same key,
2.
this shared key must be kept secret; no one else is allowed to see the key.
3.
Use the notation KA,B to denote a key shared by A and
B.
Asymmetric: often referred to as public-key
cryptography, defined as:
·
The
keys for encryption and decryption are different, but together form a unique
pair.
·
There
is a separate key KE for encryption and one for
decryption, KD , such that
Notation used in cryptography
Introducing Alice, Bob & Co.
·
Alice and Bob are the good guys.
·
Chuck and Eve are usually the bad guys.
Example 1: Bob and Alice
Example 2: Bob and Alice Redux
Hash (One-Way) Functions
A hash function H takes
a message m of arbitrary length as input and
produces a bit string h having a
fixed length as output:
h = H( m )
·
Given H and m, h is easy to compute.
·
However, given H and h, it is
computationally infeasible to compute m.
·
That is, the function only works One-Way.
Weak Collision Resistence: given m and h = H( m ), it is hard to find another m, say, m2, such that m and m2 produce the same h.
Strong Collision Resistence: Given H, it is infeasible
to find an m and an m2 such that H( m ) and H( m2 ) produce the same
value.
Similarly:
Symmetric Cryptosystems: DES
Example of a cryptographic algorithm: Data Encryption Standard (DES) (detailed example)
(a) The principle of DES. (b) Outline of one encryption round.
Work is done in the mangler function f.
o (XOR is an abbreviation for the exclusive or operation.)
The 48-bit key Ki for round i is derived from the 56-bit master key as follows
Details of per-round key generation in DES.
Principle of DES is quite simple:
Public-Key Cryptosystems: RSA
2100 = 2 x 2 x 3 x 5 x 5 x 7
making 2, 3, 5, and 7 the prime factors in 2100.
Generating the private and public key requires four steps:
1. Choose two very large prime numbers, p and q.
2. Compute n = p x q and z = (p – 1) x (q – 1).
3. Choose a number d that is relatively prime to z.
4. Compute the number e such that e x d = 1 mod z.
Example 3: Bob and Alice
Hash Functions: MD5 (Rivest, 1992)
The structure of MD5 algorithm.
A phase in MD5 consists of four rounds of computations, where each round uses one of the following four functions:
F (x,y,z) = (x AND y) OR ((NOT x) AND z)
G (x,y,z) = (x AND z) OR (y AND (NOT z))
H (x,y,z) = x XOR y XOR z
I (x,y,z) = y XOR (x OR (NOT z))
The 16 iterations during the first round in a phase in MD5.
Secure Channels
DS Security: Two Major Issues
1.Secure communications between parties.
2.Authorization.
Secure channels protect against (protected by): (Voydock and
Kent, 1983)
Interception (confidentiality).
Modification (auth. and integrity).
Fabrication (auth. and integrity).
Note that authentication and message integrity as technologies rely on each other
A detailed description of the logics underlying authentication can be found in Lampson et al. (1992).
Applications of Cryptography
·
Common
practice to use secret-key cryptography by means of session keys.
·
A
session key is a shared (secret) key that is used to encrypt messages for
integrity and possibly also confidentiality.
·
This
key is used only for as long as the channel exists.
·
When
the channel is closed, its associated session key is securely destroyed.
Authentication Based on a Shared Secret Key
· Ensure data message integrity exchanged after authentication use secret-key cryptography with session keys.
· Session key - is a shared (secret) key that is used to encrypt messages for integrity
· Generally used only for as long as the channel exists.
Example: Bob and Alice Again
· Such a challenge could take the form of a random number.
·
Authentication based on a shared secret key, using a ‘challenge response’ protocol.
Note: R is a random number.
·
If
so, he then knows that
· She sends a challenge RA (message 4), which Bob responds to by returning KA,B.(RA), shown as message 5.
Things
can go wrong:
·
Consider
an "optimization" of the authentication protocol in which the number
of messages has been reduced from five to three, as shown below.
·
If
· Likewise, Bob returns his response to that challenge, along with his own challenge in a single message.
Example: Bob and Alice – Taking Shortcuts
Optimization of
the Authentication based on a shared secret key, but using three instead of
five messages.
Idea:
This protocol can easily be defeated by a reflection attack.
The general attack outline is as follows:
1. The attacker initiates a connection to a target.
2. The target attempts to authenticate the attacker by sending it a challenge.
3. The attacker opens another connection to the target, and sends the target this challenge as its own.
4. The target responds to that challenge.
5. The attacker sends that response back to the target ("reflects" it) on the first connection.
NOTE: If the authentication protocol is not carefully designed, the target will accept that response as valid, thereby leaving the attacker with one fully-authenticated channel connection (the other one is simply abandoned).
Example: Bob and Chuck – When Things Go Wrong
The ‘reflection attack’. - Chuck wants Bob to think he is
o e.g, by returning the encrypted version of a number that Bob sent.
1.
Chuck
starts out by sending a message containing
2. Bob returns his challenge RB and the response KA,B(RC) in a single message.
3. Chuck needs to prove he knows the secret key by returning KA,B(RB) to Bob.
o He does not have KA,B.
o He attempts to set up a second channel to let Bob do the encryption for him.
4. Chuck sends A and RB in a single message as before, but now pretends that he wants a second channel. This is shown as message 3
The reflection attack.
5. Bob not recognizing that he, himself, had used RB before as a challenge, responds with KA,B(RB) and another challenge RB2, shown as message 4.
6. At that point, Chuck has KA,B(RB) and finishes setting up the first session by returning message 5 containing the response KA,B(RB), which was originally requested from the challenge sent in message 2.
Mistake 1: the two parties in the new version of the protocol were using the same challenge in two different runs of the protocol.
Better Design: always use different challenges for the initiator and for the responder.
Mistake 2: Bob gave away valuable information in the form of the response KA,B(RC) without knowing for sure to whom he was giving it.
More on design principles for protocols can be found in Abadi and Needham (1996).
Authentication Using a
Problem with a shared secret key for authentication: scalability.
Alternative: use a centralized approach by means of a Key Distribution Center (KDC).
Principle of using a KDC.
Drawbacks :
Solution: ticket
Using a
ticket and letting
The Needham-Schroeder protocol is a multiway challenge-response protocol and works as follows.
·
The
challenge RA1 that
· A nonce is a random number that is used only once, such as one chosen from a very large set.
· Purpose of a nonce is to uniquely relate two messages to each other
· e.g. message 1 and message 2.
·
by including RA1 again in message 2,
· Message 2 also contains B, the identity of Bob.
·
By
including B, the KDC protects
·
NOTE: by returning RA2 - 1 and not just RA2, Bob not only proves he knows the shared secret key, but also that he has actually decrypted the challenge.
· This ties message 4 to message 3 in the same way that the nonce RA tied message 2 to message 1.
Weak Point:
Protection against malicious reuse of a previously generated session key in the Needham-Schroeder protocol.
Solution: incorporate a nonce in the request sent by
Authentication Using Public-Key Cryptography
Mutual authentication in a public-key cryptosystem.
Example: Bob and Alice
Mutual authentication in a public-key cryptosystem.
More on Secure Channels
In addition to authentication, a secure channel also requires that messages are confidential, and that they maintain their integrity.
For example:
·
·
Bob needs to be sure that he can
prove the message was sent by/from
Solution: Digital Signing
Digital Signatures
· This is implemented in the RSA technology.
· Note: the entire document is encrypted/signed - this can sometimes be a costly overkill.
Example:
o
Bob
has sold
o
The
whole deal was done through e-mail.
o
Issues:
o
o Bob needs to be assured that
Solution:
o
o
Association
between a message and its signature prevents that modifications to the message
will go unnoticed.
o
Ways to place digital signatures:
1. Use a public-key cryptosystem such
as RSA
o
When
,
and sends it off to Bob.
o If she wants to keep the message
content a secret, she can use Bob's public key and send , which combines m and the version signed by
Digital signing a message using public-key cryptography.
o Message arrives at Bob => he can
decrypt it using
o If the public key is owned by
o
Problems
with scheme:
1. Validity of
2.
o Once
3.
o Such an encryption may be costly in terms of processing requirements
o A cheaper more elegant scheme is to use a message digest.
Message
digest => is a
fixed-length bit string h that has been computed from an arbitrary-length
message m by means of a cryptographic hash function H.
o If m is changed to m', its hash H (m') will be different from h = H (m) so that it can easily be detected that a modification has taken place.
To
digitally sign a message:
1.
2. The encrypted digest is sent along
with the message to Bob.
Note that the message itself is sent as
plaintext: everyone is allowed to read it.
o If confidentiality is required, then the message should also be encrypted with Bob's public key.
Digitally signing a message using a message digest.
o If the digest calculated from the
received message and the decrypted digest match, Bob knows the message has been
signed by
Session Keys
·
A
session key is a key used for encrypting one message or a group of messages in
a communication session.
· During the establishment of a secure channel, after the authentication phase has completed, the communicating parties generally use a unique shared session key for confidentiality.
· The session key is safely discarded when the channel is no longer used.
Secure Group
Communication
Design issue: How can you share secret information
between multiple members without losing everything when one member turns bad.
Confidentiality: Follow a simple (hard-to-scale)
approach by maintaining a separate secret key between each pair of members.
Replication: You also want to provide replication
transparency.
Apply secret sharing:
·
No
process knows the entire secret; it can be revealed only through joint
cooperation
·
Assumption:
at most k
out of N processes can produce an incorrect answer
·
At
most c <=
k processes have been corrupted
Note: We are dealing with a k fault tolerant process group.
Secure Replicated Servers
Secure and Transparent Replicated Servers
(Reiter et al. 1994)
Example:
·
Given
a securely replicated group of servers
·
Each
server accompanies its response with a digital signature.
·
If
ri is the response from
server Si, let md (ri)
denote the message digest computed by server Si.
Want
to protect the client against at most c corrupted servers => the server group should be
able to tolerate corruption by at most c servers, and still be capable of
producing a response that the client can put its trust in.
· Let the replicated servers generate a secret valid signature with the property that c corrupted servers alone are not enough to produce that signature.
·
Consider
a group of five replicated servers that should be able to tolerate two corrupted
servers, and still produce a response that a client can trust.
Sharing
a secret signature in a group of replicated servers.
· Let N = 5, c = 2
·
Each
server Si gets to see each request and responds
with ri
· Client uses special decryption function D that
computes a single digest d from three signatures:
d = D(sig(S,r), sig(S’,r’), sig(S”,r”))
· If d = md(ri) for
some ri,
ri is
considered correct
Also known as (m,n)-threshold
scheme.
(with
m = c + 1, n = N)
·
There
are 5!/(3!2!)=10 possible combinations of three
signatures that the client can use as input for D.
·
If
one of these combinations produces a correct digest md
(ri) for some response ri, then the client can consider ri
as being correct.
Example: Kerberos (Steiner et al., 1988)
·
Kerberos
is a network authentication protocol.
·
It
is designed to provide strong authentication for client/server applications by
using secret-key cryptography.
Two different components:
Authentication Server (AS) - responsible for handling a login request from a user.
Ticket
Granting Service (TGS) -
sets up secure channels.
Example:
For
The ticket
that is returned by the AS contains the identity of
Authentication in Kerberos.
Message 1 -
Message 2 -
contains login name and is sent to the AS.
Message 3 -
contains the session key KA,TGS and the ticket
KAS,TGS(A,KA,TGS).
Message 4 -
workstation prompts
Message 5 –
PWD returned to workstation which generates shared key KA,AS
and find session key KA,TGS.
Message 6 –to talk to Bob, she requests the TGS to generate a session key for Bob.
Setting
up a secure channel with Bob
1.
2. When Bob decrypts the ticket, he
notices that
·
He
also finds the secret key KA,B, allowing him to verify
the timestamp.
·
At
that point, Bob knows he is talking to Alice and not someone maliciously
replaying message 1.
·
By
responding with KA,B(t + 1), Bob proves to
Access Control
Access rights is referred to as access control, whereas authorization is about granting access rights
Authorization
versus Authentication
Authentication: Verify the claim that a subject says it is S: verifying the identity of a subject
Authorization: Determining whether a subject is permitted certain services from an
object
Note: authorization
makes sense only if the requesting subject has been authenticated
Simple
model of access control:
Subjects issue a request to access an
object.
·
Processes
acting on behalf of users, but can also be objects that need the services of
other objects in order to carry out their work.
An object encapsulates its own state and implements the operations on that state.
·
Operations
of an object that subjects can request to be carried out are made available
through interfaces.
General model of controlling access to objects.
Reference Monitor records which subject may do what,
and decides whether a subject is allowed to have a specific operation carried
out.
Access
Control Matrix
Essence: Maintain
an access
control matrix ACM
in which entry ACM[S,O] contains the permissible
operations that subject S can perform on object O
Issues:
·
System
may need to support thousands of users and millions of objects that require
protection
Solutions:
Implementation (a): Each object O maintains an access control list (ACL): ACM[*,O]
describing the permissible operations per subject (or group of subjects)
Implementation (b): Each subject S has a capability: ACM[S,*] describing the permissible operations per object
(or category of objects)
Comparison between ACLs and
capabilities for protecting objects.
(a)
Using an ACL. (b) Using capabilities.
Protection
Domains
Issue: ACLs or capability lists can be very large.
Reduce information by means of protection domains: (Saltzer
and Schroeder, 1975)
·
Set
of (object, access rights) pairs
·
Each
pair is associated with a protection domain
·
For
each incoming request the reference monitor first looks up the appropriate
protection domain
Common implementation of protection domains:
Groups:
Users belong to
a specific group; each group has associated access rights
Roles:
Don't
differentiate between users, but only the roles they can play.
·
Your
role is determined at login time. Role changes are allowed.
Firewalls
Essence: Sometimes
it's better to select service requests at the lowest level: network packets.
·
Packets
that do not fit certain requirements are simply removed from the channel
Solution: Protect
your company by a firewall: it implements access control
A
common implementation of a firewall
Two Types pf Firewalls:
Packet-filtering
gateway - operates as a
router and makes decisions as to whether or not to pass a network packet based
on the source and destination address as contained in the packet's header.
Application-level
gateway - this type of
firewall inspects the content of an incoming or outgoing message.
Secure
Problem:
·
Mobile
code is great for balancing communication and computation, but is hard to
implement a general-purpose mechanism that allows different security policies
for local-resource access.
·
Also,
we may need
to protect the mobile code (e.g., agents)
against malicious hosts.
Protecting an Agent
Most
important: append-only logs:
·
Data
can only be appended to the log; there is no way that data can be removed or
modified without the owner being able to detect this
·
There
is always an associated checksum. Initially,
Cinit = K+owner(N), with N a nonce.
·
Adding
data X by server S:
Cnew = K+owner(Cold, sig(S,X),S)
·
Removing
data from the log:
K-owner(C) -> Cprev, sig(S,X),S
allowing the owner to check integrity of X
Protecting a Host
Simple solution: Enforce a (very strict) single policy, and implement that by
means of a few simple mechanisms
Sandbox model: Policy:
Remote code is allowed access to only a pre-defined collection of resources and
services.
·
Mechanism:
Check instructions for illegal memory access and service access
Playground model: Same
policy, but mechanism is to run code on separate unprotected machine.
Observation: We need to be able to distinguish local from remote code before being
able to do anything
Refinement 1: We need to be able to assign a set of permissions to mobile code before
its execution and check operations against those permissions at all times
Refinement 2: We need to be able to assign different sets of permissions to different
units of mobile code => authenticate mobile code (e.g. through signatures)
(a)
A sandbox. (b) A playground.
Maliciously
preventing authorized processes from accessing resources.
Issue: Distributed denial of service (DDoS)
·
Huge
collection of processes jointly attempt to bring down a networked service.
·
Attackers
succeed in hijacking a large group of machines which unknowingly participate in
the attack.
·
Specht and Lee
(2004) distinguish two types of attacks:
1. those aimed at bandwidth depletion
2. those aimed at resource depletion.
Solutions:
No single
method to protect against DDoS attacks. BUT…
Continuously
monitor network traffic
Security Management
·
Key establishment and distribution
·
Secure group management
·
Authorization management
Key Establishment: Diffie-Hellman
(Diffie and
Hellman, 1976)
Observation: We can construct secret keys in
a safe way without having to trust a third party (i.e. a key distribution center (KDC)):
·
Alice
and Bob have to agree on two large numbers, n and g. Both numbers may be public.
·
1:
2: Bob sends (gy
mod n) to
3:
4: Bob computes KA,B = (gx mod n)y
= gxy mod n
The principle of Diffie-Hellman key exchange
Key Distribution
Essence: If
authentication is based on cryptographic protocols, and we need session keys to
establish secure channels, who's responsible for handing out keys?
Secret keys:
Alice and Bob will have to get a
shared key.
·
They
can invent their own and use it for data exchange.
·
Alternatively,
they can trust a key distribution center (KDC) and ask it for a key.
Public keys:
·
·
But
she'll have to be sure about actually having Bob's public key, or she may be in
big trouble.
·
Use
a trusted certification
authority (CA) to
hand out public keys.
·
A
public key is put in a certificate, signed by a CA.
Another problem: How do we get the secret keys to
their new owners?
(a)
Secret-key distribution.
(b)
Public-key distribution.
Public-key
cryptosystem (b), need
to distribute the public key in such a way that the receivers can be sure that
the key is paired to a claimed private key.
Secure Group Management
Structure: Group uses a key pair (K+G, K-G) for communication with nongroup members.
·
There
is a separate shared secret key CKG for internal
communication.
·
Assume
process P wants to join the group and contacts Q.
1: P generates a one-time reply pad RP, and a secret key KP,G. It sends a join request to Q,
signed by itself (notation: [JR]P),
along with a certificate containing its public key K+P
.
Securely admitting a new group member.
2: Q authenticates P, checks
whether it can be allowed as member.
It returns the group key CKG,
encrypted with the one-time pad, as well as the group's private key, encrypted
as CKG(K-G).
3: Q authenticates P and
sends back K P,G(N)
letting Q know that it has all the necessary keys.
Authorization Management
Issue: To avoid that each machine needs to
know about all users, use capabilities and attribute certificates to express
the access rights that the holder has.
·
In
Amoeba, restricted access rights are
encoded in a capability, along with data for an integrity
check to protect against tampering:
A capability in Amoeba.
·
Next 24 bits
are used to identify the object at the given server.
o
Note
that the server port, along with the object identifier, form
a 72-bit system wide unique identifier for every object in Amoeba.
·
Next 8 bits
are used to specify the access rights of the holder of the capability.
·
When
an object is created, its server picks a random check field and stores it both
in the capability as well as internally in its own tables.
·
All
the right bits in a new capability are initially on, and it is this owner
capability that is returned to the client.
· When the capability is sent back to the server in a request to perform an operation, the check field is verified.
·
To
create a restricted capability, a client can pass a capability back to the
server, along with a bit mask for the new rights.
o The server takes the original check field from its tables, XORs it with the new rights (which must be a subset of the rights in the capability), and then runs the result through a one-way function.
o The server then creates a new
capability, with the same value in the object field, but with the new rights
bits in the rights field and the output of the one-way function in the check
field. The new capability is then returned to the caller.
o The client may send this new capability to another process, if it wishes.
Generation
of a restricted capability from an owner capability
Delegation
Observation: A subject sometimes wants to delegate its privileges to an object O1, to
allow that object to request services from another object O2
Example: A
client tells the print server PS to fetch a file F from the file server FS to
make a hard copy => the client delegates its read privileges on F to PS
Nonsolution: Simply hand over your attribute
certificate to a delegate (which may pass it on to the next one, etc.)
Problem: To
what extent can the object trust a certificate to have originated at the
initiator of the service request, without forcing the initiator to sign every
certificate?
Solution: Ensure that delegation proceeds
through a secure channel, and let a delegate prove it got the certificate through
such a path of channels originating at the initiator.
General
approach to delegation (Neuman 1993) - make use of a proxy.
Neuman's scheme has two parts :
o
Let
A be the process that created the proxy.
The
general structure of a proxy as used for delegation
A
protocol for delegating and exercising rights:
Using
a proxy to delegate and prove ownership of access rights