Protection and Security
Protection and Security
Domain/ F1 F2 F3 printer
object
D1 read read
D2 print
D3 read execute
D4 read read
write write
(a)
Domain/ F1 F2 F3
object
D1 owner write
execute
D2 owner read
Read owner
write write
D3 write write
(b)
Figure 14.6 Access matrix with owner
right.
Domain F1 F2 F3 laser D1 D2 D3 D4
/ printer
object
D1 read read switch
D2 print switch switch
control
D3 read execut
e
D4 write write switc
Figure 14.7 Modified access matrix
h of figure 14.4.
Implementation of Access matrix
Global Table – the simplest implementation of the access matrix consisting of
a set of ordered triples < domain, object, rights-set >. Whenever an operation
M is executed on an object O within domain D, the global table is searched for
a triple < Di, Dj,Rk >, with M element of Rk. If triple is found, the operation is
allowed to continue; otherwise, an exception (or error) condition is raised.
Access lists for objects – the resulting list for each object consists of ordered
pairs
<domain, rights-set> , which define all domains with a non empty set of
access rights for the object. This approach can be extended easily to define a
list plus a default set of access rights.
Capability lists for domains – an alternative approach to access matrices for
implementing protection in operating systems. Instead of associating
columns with objects, capability lists associate each row with a domain,
representing the operations a process executing in that domain can perform
on objects. They are protected, never directly accessible to a process, and
can only be access indirectly by the user. Capability lists provide a foundation
for protection that can be extended up to the application level. Several
capability-based protection system was developed, including the Mach OS.
A Lock-key Mechanism – it is a compromise between
access lists and capability lists. Each object has a list of
unique bit patterns, called locks, similarly with domains.
Comparison of access lists and capabilities used in many
systems:
Global table are simple but inefficient, requiring large
memory and potentially causing performance issues.
Access lists are more efficient for localizing information
but can be time-consuming to search.
Capability lists are efficient for searching but do not
directly corresponds to the needs of a given process.
The lock-key mechanisms is a compromise between
access lists and capability lists, offering both
effectiveness and flexibility.
Access Control
Role-based Access Control (RBAC) is a method for managing access rights to resources
based on the roles assigned to users. It works in the Solaris 10 OS, where users are
assigned roles and privileges based on their responsibilities. This allows users to
execute programs with specific privileges, reducing the security risk associated with
superusers and setuid programs. RBAC is a more granular and flexible approach to
access control than traditional methods, as it allows for finer-grained control over
access rights and makes it easier to manage permission for large numbers of users
and resources.
USER 1
role 1
privileges
Figure 14.8 role based access control in Solaris 10
1
privileges
2
proces
s
Revocation of Access Rights
Various questions about revocation may arise:
Immediate vs. delayed. Does revocation occur
immediately, or is it delayed? If revocation is delayed,
can we found out when it will take place?
Selective vs. general. When an access right to an object
is revoked, does it affect all the users who have an
access right to that object, or can we specify a select
group of users whose access rights should be revoked?
Partial vs. total. Can a subset of the rights associated
with an objects be revoked, or must we revoke all
access rights for this object?
Temporary vs. permanent. Can access be revoked
permanently (that is, the revoke access right will never
again be available), or can access be revoked and later
be obtained again?
Schemas that implement revocation
for capabilities:
1. Reacquisition – capabilities are periodically deleted from each domain. If a process
wants to use a capability, it may find that capability has been deleted. The process
may then try to reacquire the capability. If access has been revoked, the process will
not be able to reacquire the capability.
2. Back pointers – are a list of pointers maintained with each object, pointing to all
capabilities associated with that object. When revocation is required, we can follow
these pointers, changing the capabilities as necessary. These scheme was adopted in
the MULTICS system. It is quite general, but its implementation is costly.
3. Indirection – is a technique for revoking capabilities in capability-based systems. It
involves pointing capabilities indirectly to objects through a global table. Each
capability points to a unique entry in the global table, which in turn points to the
objects. When revocation is required, the global table entry for the desired capability
is deleted.
Capability-based Systems
An example: Hydra
Hydra is a capability-based protection system that offers flexible and secure
access control. Hydra implements a fixed set of basic access rights, but users can
also declare additional rights. The interpretation of these user-defined rights is
handled solely by user’s program. The system provides access protection for both
user-defined and system-defined rights, contributing to significant advancement
in security technology. Operations of objects are defined procedurally. To access
these procedures indirectly, the protection system needs to identify them based
on user-defined type. When the definition of an object is made known to Hydra,
the names of operations become “auxiliary rights”.
Hydra relies on the concept of “trustworthy processes”, which can adhere to a
formal parameter and execute procedures within their defined rights. This
ensures that a process will not exceed its authorized access.
Hydra uses mechanism called “amplification” to allow indirect access to data
through another process. This is necessary when a process needs to access data
that is not directly accessible to it. Amplification ensures that access is controlled
and limited to specific purposes defined by the capability
Hydra’s procedure-call mechanism ensures that a process cannot
modify data passed as arguments to another process without explicit
permission. This prevents unintended modifications and maintains
data integrity.
Hydra addresses the problem of “mutually suspicious subsystems”,
where different programs may need to share data but cannot be fully
trusted. Hydra’s solution involves careful design of access rights and
procedures to ensure that data is used correctly and securely.
Hydra’s approach to subsystem involves a layered security model
where subsystems are built on top of the protection kernel and
interact with it through kernel-defined primitives. The capability
system enforces access control, and programmers can use system-
defined procedures to access resources securely. This allows for a
flexible and secure way to manage complex systems with multiple
subsystems.
An example: Cambridge CAP System
This system is a simpler and less powerful capability-based protection
system compared to Hydra. It utilizes two types of capabilities:
1. Data capabilities – interpreted by the microcode.
2. software capabilities – interpreted by protection procedures.
Data capabilities grant standard access to objects, while software
capabilities grant specific rights to a particular subsystem. The
interpretation of software capabilities left to subsystem, allowing for a
variety of protection policies. The CAP system prioritizes the security of
the overall system, ensuring that a single unprotected procedure
cannot compromise the entire system by restricting access to storage
segments and capabilities.
Language-based Protection
Language-based protection is a new approach in
operating system. It addresses the limitations of
traditional protection mechanism, which often rely on
OS kernels and acquire significant overhead for access
validation.
Language-based protection aims to integrate security
into the programming language itself, allowing for
more flexible and efficient protection. This approach
leverages concepts of abstract data types and objects
to define access rights and policies, ensuring that
resources are protected from unauthorized access and
tampering. It also enables the definition of user
defined functions and policies, making the system
more adaptable to different applications and needs.
Compiler-based management
This argues that specifying protection needs declaratively in in a
programming language offers several advantages over traditional methods
based on OS kernels:
1. Protection needs are simply declared, rather than programmed as a
sequence of calls on procedures of an OS.
2. Protection requirements can be stated independently of the facilities
provided by particular OS.
3. The means for enforcement need not be provided by the designer of
subsystem.
4. A declarative notation is natural because access privileges are closely
related to the linguistic concept of data type.
Integrate protection requirements directly into the language’s typing
system, allowing the designer to specify access rights and resource usage
within the program itself. This approach eliminates the need for separate
protection specifications and simplifies the enforcement process. While
compiler-based enforcement might not be as powerful as kernel-based
enforcement, it offers a more flexible and efficient way to ensure security
by relying on assumptions about the operational state of the system and
treating different protection mechanism =s differently.
Security. Kernel-based enforcement provides a greater degree of
security for the protection system itself compared to compiler-based
enforcement. The reason is that kernel-based enforcement relies on the
correctness of the translator, the underlying mechanism of storage
management, and ultimately, the security of files from which a program
is loaded. While these considerations also apply to software-supported
protection kernels, their impact is less significant because the kernel
typically resides in fixed physical storage segments and is loaded only
from a designated file.
Flexibility. Compiler-based enforcement offers greater flexibility than a
protection kernel. While a kernel may provide facilities for enforcing
user-defined policies, using a programming language allows for a more
adaptable approach. Protection policies can be declared and enforce as
needed with minimal disruption to the system.
Efficiency. The greatest efficiency in protection enforcement is achieved
when it’s directly supported by a hardware or microcode. When software
support is required, language-based enforcement offers advantages like
off-line verification at compile time and the ability for an intelligent
compiler to tailor the enforcement mechanism to specific needs,
reducing the overhead of kernel calls.
Protection in Java
Java’s protection mechanisms are designed to run in a distributed
environment. Java programs are composed of classes, each
containing data fields and functions. The JVM loads a class in
response to a request to create instances (or objects) of that class.
One of the most novel and useful features of Java is its support for
dynamically loading untrusted classes over a network and for
executing mutually distrusting classes within the name JVM.
Protection in Java is handled within the JVM. When the JVM loads a
class, it assigns the class to a protection domain that gives the
permissions of that class. The protection domain to which the class is
assigned depends on the URL from which the class was loaded and
any digital signatures on the class file. A configurable policy file
determines the permissions granted to the domain. Example: classes
loaded from a trusted server might be placed in a protection domain
that allows them to access files in the user’s home directory,
whereas classes loaded from an untrusted server might have no file
access permission at all.
It uses a stack inspection approach to determine if a
method is allowed to access a protected resource. This
inspection examines the stack frames of the calling thread,
starting from the most recently added frame and working
towards the oldest. If the stack frame is found that has the
doPrivileged() annotation, then the checkpermission()
method immediately and silently allows the access. If a
stack frame is found for which access is disallowed based
on the protection domain of the methods class, then
checkpermission() throws an AccessControlException. The
stack inspection exhausts the stack without finding either
type of frame, then whether access is allowed depends on
the implementation (for example some implementations of
the JVM may allow access, while other implementations may
disallow it).
protection
domain:
socket
permission:
Class:
System security
Chapter objectives:
To discuss security threats and attacks.
To explain the fundamentals of encryption,
authentication, and hasting.
To examine the uses of cryptography in
computing.
To describe various countermeasures to
security attacks.
The security problem
attacker
masquerading
sender receiver
cat i on
muni
co m
attacker
Man-in-the-middle
receiver
sender
comm i cat i on
unicat u n
ion comm
attacker
Figure 15.1 Standard security attack
To protect system, we must take security measures at for
levels:
1. Physical. The site or sites containing the computer systems must be
physically secured against armed or surreptitious entry by intruders. Both the
machine rooms and the terminals or workstations that have access to the
machine must be secured.
2. Human. Authorization must be done carefully to assure that only appropriate
users have access to the system. Even authorized users may be tricked into
granting access to others, either through bribery or social engineering
techniques like phishing or dumpster diving.
3. Operating system. The system must protect itself from accidental or
purposeful security breaches. A runaway process could constitute an
accidental denial-of-service attack. A query to a service could reveal
password. A stack overflow could allow the launching of an unauthorized
process. The list of possible breaches is almost endless.
4. Network. Much computer data in modern systems travel over private leased
lines, shared lines like the Internet, wireless connection, or dial-up lines.
Intercepting these data could be just a harmful as breaking into a computer;
and interruption of communications could constitute a remote denial-of-
Program Threats
Program threats arise from the fact that
processes, along with the kernel, are the only
means of accomplishing work on a computer.
Therefore, writing a program that creates a
breach of security or causing a normal process
to change its behavior and create a breach, is a
common goal of crackers. Even most
nonprogram security events have as their goal
causing a program threat. For example, while it
is useful to log in to a system without
authorization, it is quite a lot more useful to
leave behind a backdoor that provides
Trojan horse
Trojan horse is a type of malware that is used to gain unauthorized access to a
system or steal sensitive information.
The trojan horse works by exploiting the trust that users place in programs. For
example, a user might download a program that they believed is a game or a utility,
but the program actually contains malicious code.
Once the trojan horse is installed, it has the ability to steal password and other
sensitive information, install other malware, and give the attacker remote access to
the system. One way to protect against trojan horses is to be careful about the
programs we download or install. Only download programs from trusted sources,
and be sure to read reviews before installing any net software. You should also keep
your OS and antivirus software up to date.
Another variation of trojan horse is the spyware. Spyware often accompanies other
programs, such as freeware or shareware, and its goal is to download adds, create
pop-up browser windows, or capture information from the user’s system and sent it
to a central site.
Trap Door
A trap door is a hidden feature in a program or system that allows unauthorized
access or bypasses security measures. It’s a type of security breach often used
for malicious purposes, like stealing data or gaining control of a system. Trap
doors are designed to be hidden, making them difficult to detect. They can be
created by programmers who deliberately insert them or through unintentional
coding. Detecting trap doors requires thorough code auditing, security testing,
and monitoring system activity for unusual patterns.
Logic Bomb
It is a type of malicious code that is designed to trigger a security incident only
under certain circumstances. It’s difficult to detect because it appears harmless
under normal operations. However, when a predefined set of parameters are
met, the logic comb activates, creating a security hole that can be exploited for
malicious purposes. Example, a programmer might write code to check if they
are still employed, if not, a logic bomb could be triggered to allow remote
access or cause damage to the system.
Stack and Buffer Overflow
A stack buffer overflow is a common way for attackers to gain
unauthorized access to a system. This attacks exploits a bug in a
program where the programmer neglected the code bunds checking
on an input field. This means the attacker can send more data than
the program was expecting, causing the program to crash or allow
the attacker to execute malicious code.
How it flow:
1. Overflow: the attacker sends more data than the program expects,
overflowing the allocated space in the buffer or stack.
2. Overwrite: the attacker overwrites the return address on the stack
with address of their malicious code.
3. Execute: when the program returns, it jumps to the attacker’s code
instead of the intended location, allowing the attacker to execute
their malicious code.
This C code demonstrate a buffer overflow vulnerability
#include <stdio.h>
#define BUFFER_SIZE 246
if (arg < 2)
return -1 ;
else {
strcp(buffer ,argv[1] ;
return 0;
}
}
grows
automatic variables
parameter/s
top
.
buffer(BUFFER_SIZE –
.
1)
.
copie NO_OP
…
d .
.
.
buffer(1)
modified shell code
buffer(0)
(a) (b)
Figure 15.4 hypothetical stack frame for figure 15.2, (a) before and (b) after
Viruses
Virus is a fragment of code embedded in a legitimate program. Viruses
are self replicating and are designed to “infect” other program. They
wreak havoc in a system by modifying or destroying files and causing
system crashes and program malfunctions. As with most penetration
attacks viruses are very specific to architectures, OS, and applications.
Viruses are a particular problem for users of PC’s, UNIX and other
multiuser OS generally are not susceptible to viruses because the
executable programs are protected from writing by the operating
system. Viruses can be spread through email attachments, file-sharing
services, infected disks, or macros embedded in documents. A virus
dropper is a program that installs a virus onto a system, often
disguised as a legitimate program or file. There are many types of
viruses, each with its own unique characteristics and methods of
spreading. To protect your system from viruses, it is important to use
antivirus software, keep your software updated, be careful about
opening email attachments, and download software from trusted
sources.
Types of viruses and how they infect system
Virus
replaces
original boot
block with
itself
The system boot, virus
decreases physical
memory, hides in memory
above new limit
worm
worm
Port Scanning
Port scanning is a technique used by hackers (often called crackers) to identify
potential vulnerabilities in computer systems. I’s not an attack itself but rather a
way to gather info that can be used for future attacks. Port scanning works by
automated, using a tool that attempts to create a TCP/IP connection to a specific
port or range of ports. The tool tries to connect to known vulnerabilities, such as a
bug in a specific service or port that is open but shouldn’t be. If the connection is
successful, the tool can attempt to communicate with the service to determine if
it’s the intended service and, if so, what version it is. This can help identify
potential vulnerabilities in the software. The information gathered from port
scanning can then be used to exploit vulnerabilities and gain access to the system.
Tools and techniques:
1. Nmap – popular open source utility for network exploration and security
auditing.
2. Nessus – a tool that performs a similar function to Nmap, but also includes a
database of known bugs and explot.
Port scanning can be a concern because they are often launched
from compromised systems called “zombies”, which are
controlled by attackers. This makes it difficult to trace the source
of the attack. And port scanning can be used to launch denial-of-
service attacks, which overwhelm a system with requests,
making it unavailable to legitimate users.
Securing Systems
Firewall protection – implementing a firewall to block
unauthorized access to ports.
Regular updates – keeping software up-to-date to patch known
vulnerabilities.
Security monitoring – monitoring network traffic for suspicious
activity.
Denial-of-service (DoS)
It is a type of cyberattack aimed at disrupting the legitimate use of a system or
service. Instead of trying to steal info. or gain unauthorized access, DoS attacks aim
to make the system unavailable to its intended users.
Types of DoS:
1. Resource exhaustion: these attacks overwhelm the system with a flood of
requests, consuming its resources and making it unable to respond to users. This
include flooding a website with traffic, sending excessive emails, or making a
numerous connection attempts.
2. Network disruption: these attacks target the network infrastructure that
connects the system to the internet, disrupting the flow of data and making the
system unreachable.
Characteristics of DoS:
• Intention: the goal is to disrupt service
• Impact: can cause temporary or permanent outages
• Difficulty of prevention: difficult due to complexity of network security and
constant evolution of attack mehtods
How to mitigate the risk of DoS:
1. Firewall
protection: use to block traffic and
prevent unauthorized access to the system.
2. Network monitoring: for suspicious activity and
identifying potential DoS attacks
3. Loadbalancing: distributing traffic across multiple
servers to prevent a single server from being
overwhelmed
4. Securityupdates: keeping systems and software
updated to patch vulnerabilities that could be
exploited by attackers
Cryptography as a Security Tool
Cryptography is a fundamental security tool that is
important in protecting data and communications in
computer system. It involves using mathematical techniques
to transform data (plaintext) into an unreadable format
(ciphertext), making it secure from unauthorized access.
Cryptography works by ensuring that only authorized parties
can access sensitive information. It protects data during
transmission and storage, preventing eavesdropping or
unauthorized decryption. It also verify the authenticity and
integrity of data. They ensure that data hasn’t been
tampered. Cryptography also helps verify the identity of
users and systems. It allows parties to authenticate
themselves and establish trust in digital environments.
Encryption
Encryption is a means for constraining the possible receivers of a
message. An encryption algorithm enables the sender of a message
to ensure that only a computer possessing a certain key can read
the message.
Encryption consist of the ff components:
• A set K of keys.
• A set M of message.
• A set C of ciphertexts.
• A function E : K (M C).
• A function D : K (C M).
message m
Encryptio
n
algorithm
E
Key
exchang
e
Decryptio
n
algorithm
D
message
m
Symmetric encryption
Symmetric encryption uses the same key for both encryption
and decryption. This means the key must be kept secret to
protect the security for both encrypted and decrypted data.
This algorithms work by performing a series of
transformations on the data, often using substitutions and
permutations. Some algorithm use “black-box”
transformations, where the specific steps are hidden to make
the algorithm more secure.
One popular example of a symmetric encryption algorithm is
the Data Encryption Standard. However, DES is now
considered insecure because its key can be easily crack with
modern computing power. A more secure alternative is the
Advanced Encryption Standard (AES), which uses longer keys
and more complex transformations.
Asymmetric Encryption
It uses a private key to decrypt data that was encrypted using a
public key. The most common example of this is the RSA (Rivest,
Shamir, and Adleman). RSA is a block-cipher public-key algorithm
and is the most widely used asymmetrical algorithm.
Advantages of Asymmetric Encryption:
1. Secure key contribution: the public key can be shared publicly
without compromising the security of the private key.
2. Flexibility: asymmetric encryption can be used for various
purposes, including digital signatures, secure communication.
Disadvantages:
1. computational complexity: computationally more expensive
than symmetric
2. Key management: managing multiple public and private keys
can be challenging.
Authentication
It is used to verify the identity of a sender or receiver of a message. It
ensures that the message originated form the claimed source and hasn’t
been tampered with during the transmission.
Components of authentication:
Keys: authentication algorithm use a set of keys to generate unique
identifiers(authenticators) for messages.
Authenticators: these are the values generated by the authentication
function, acting as digital signatures for the message.
Verification: the receiver of the message uses the sender’s public key to
verify the authenticity of the message by comparing the receive
authenticator with a calculated one.
Types:
Message authentication code (MAC)
Digital Signature
Key distribution
It is the process of securely sharing cryptographic keys
between parties who need to communicate securely. It’s a
critical challenge in cryptography, specially for symmetric
algorithms where both parties need the same secret key.
The challenges in key distribution are sharing keys
physically is inefficient and vulnerable to interception. And
managing a large number of keys for communication with
multiple users is complex. And also sharing keys over
insecure channels can lead to attackers intercepting and
exploiting them.
Implementation of cryptography
Network protocols are structured in layers, each layer acting as a client to the one
below it. When a protocol generates a message to send to its peer on another
machine, it hands its message to the protocol below it in the network-protocol stack
for delivery to that machine. Example, in an IP network, TCP (transport layer protocol).
TCP packets are passed down to IP for delivery to the TCP peer at the other end of the
TCP connection. It encapsulates the TCP packet in an IP packet, which it similarly
passes down to the data-link layer to be transmitted across the network to its IP peer
on the destination computer. This IP peer then delivers the TCP packet up to the TCP
peer on that machine. All in all, the ISO reference Model, which has been almost
universally adopted as a model for data networking, defines seven such protocol
layers.
Common security protocols:
SSL/TLS Secure Sockets Layer)/ (Transport Layer Security) – provides security at the
transport layer, ensuring secure communication between web browsers and servers.
Ipsec (Internet Protocol Security) – standardizes security at the network layer,
providing authentication and encryption for IP packets.
Virtual Private Network (VPN) – use IPsec to create secure connections over public
networks, making communication private and secure.
An example: SSL (Secure Sockets Layer)
SSL is a cryptographic protocol that enables secure communication
between two computers. It’s the most commonly used
cryptographic protocol on the internet today, used by web browsers
to communicate securely with web servers.
SSL works by:
Handshake – the client and server exchange messages to establish
a secure connection. This involves verifying each other’s identities
and generating a shared secret key.
Encryption – once the handshake is complete, the client and server
use the shared secret key to encrypt all subsequent
communication. This ensures that only the intended recipient can
read the messages.
Message authentication – SSL also uses MAC’s (Message
Authentication Codes) to verify integrity of messages. This prevents
attackers from tampering with the messages during transmission.
Passwords