BA Chapter9 Access Control Firewalls Intrusion Detection
BA Chapter9 Access Control Firewalls Intrusion Detection
● Now we look at
Implementations
► Access Control: Blocking unauthorized access
§ Specifying a policy of who should be allowed to access
what and how Protocols and policies
► Firewalls: Blocking unwanted network traffic
§ Specifying a policy of which traffic to allow and which
Cryptographic primitives
to deny
● Access Control
► Firewall types
► Placement of firewalls
Complexity
Application
Process by which use of system resources
Middleware
is regulated according to a security policy
Operating System
Reliability
and is permitted only by authorized
Hardware
entities (users, programs, processes, or
other systems) according to that policy
File 1
Subject 1 all
Others
ACL of File 1
§ May include deciding how gets a special grant ► Compares security labels of objects to security
access right clearances of subjects
► Creator of object
● Examples
● Each process or subject is associated with a user ID and at least one group ID
● Access decisions to objects are based on user IDs and group IDs
● When a file is created it is owned by a particular user and marked with that user’s user ID as owner
► I.e. root can do whatever it likes, some things can only be done by root
● Each process has three user IDs and three group IDs
► a process that runs this file is granted access based on the userID of the owner of the file
► The effectiveUID on which the access decision depends is set to the UID of the owner of the file
► This special permission allows allows the process running the file to access files and directories that are
normally available only to the owner.
► chmod 2000 sets the setuid bit, chmod 4000 sets the setgid bit
► If a directory has the sticky bit set, a file within it can be deleted only by file owner, directory owner, or root
Role1
Role2
Role3
Role Object
R1 R2 …. Rn R1 R2 F1 F2 P1 D2 …
U1 X R1 control Owner, r wake search
U2 X R2 c w x
U3 X X R3
Role
U4 X
…
User
U5 X Rn w stop
U6 X
…
● Defines authorizations expressed as conditions on properties of the subject, object, and the
environment
► E.g. attribute of object: creator of the object
► Then a single access rule can specify the ownership privilege for any creator of an object
● Advantage of ABAC
► Performance impact of evaluating predicates on objects and user properties for each access
● Subject ● Object
► Define the identity and characteristics of § E.g., title, creator, date, author,…
● ABAC relies on
► A formal access control rule defining allowable operations for subject/object attribute combinations in a
given environment
● ABAC systems are able to enforce DAC, RBAC, and MAC concepts
Classi-
Clearence
fication
child
► The adult role obtains all three rights, the juvenile role only the
last two, child role only the last one
R3: can_access(u,m,e) ← R1 ⋀ R2
● Access Control
► Firewall types
► Placement of firewalls
Internet
(External Network)
Internal Network
● A network firewall
► If the packet header information is a subset of the rule, the packet is said to match the rule
► A default rule is often placed at the end of a policy with action deny
§ Makes the policy comprehensive
No. Protocol Src IP Src Port Dest IP Dest Port Action
1 UDP 190.1.1.* * * 80 deny
2 TCP 180.* * 180.* 90 accept
3 UDP 210.1.* * * 90 accept
4 TCP 210.* * 220.* 80 accept
5 UDP 190.* * * 80 accept
6 * * * * * deny
► E.g ,the tuple 198.188.150.* corresponds to the set of IP addresses ranging from 198.188.150.0 to
198.188.150.255
● The tuples of a rule collectively define a set of packets that match this rule
► E.g. the rule Proto = TCP, SIP = 190.150.140.38, SP = 188, DIP = 190.180.39.*, DP = 80, action = accept
defines a set of 256 unique packet headers that match this rule
► U(R) ⊆ P describes the set of packets that do not match any rule in the policy
► typically ensured by adding a default rule of “deny” at the end of the policy
► The two policies are said to be equivalent if their accept, deny and non-match sets are
the same
● Note that being equivalent does not mean that the two policies have the same
rules!!
► Just that given any packet the two policies will lead to the same actions always
● In first-match policies more specific policy rules typically appear at the beginning of the policy and
● Example: shadowing
► Occurs if an earlier rule i matches every packet that another lower rule j (j > i) matches
● If both rules have the same action, this is not a problem but if e.g. rule i is added after rule j the
► For example
► By itself rule j will drop any TCP packet arriving from 190.150.140.38 and destined to 190.180.39.180 on
port 80
► When rule i is added before rule j, then any packet like this with source port 188 will be accepted
► Only the system administrator will typically know whether or not this behavior was intended
● The number of firewall rules will typically impact the firewall performance
► Policy reordering such that rules that match more packets are placed earlier in the policy
§ Must be done with care to avoid violating the integrity of a policy
§ I.e., after reordering, the policy should still accept and deny the same packets
► Packet filters
► Stateful firewalls
Physical
● In TCP connections, ports with numbers less than 1024 are permanently assigned to servers
● What should a firewall do if it sees, say, an incoming request to some client’s port 5612?
► It must allow it: this could be a server’s response in a previously established connection…
► E.g., if no stateful packet filter is used, allowing internal users to connect to any external webserver will
require two rules
§ One for outgoing traffic to any webserver
§ One for incoming traffic to any user regardless of whether a user requested traffic from that webserver
► A stateful firewall can support a more restrictive policy that allows incoming traffic from webservers only in
response to requests by users
► Dynamically add a rule to the policy that allows return packets when a connection is started
External
Firewall
Internet
Workstations Boarder
Internal Router
Firewall
Internal protected network DMZ
● Internal firewall adds more strict filtering capabilities compared to external firewall
► Filter attacks from DMZ towards internal network and vice versa
● Multiple internal firewalls can be used to protect portions of internal network from each other
► If a user on the internal network wants to connect to an application server on the external network
§ The proxy (here the firewall) would terminate the connection
§ The proxy would then create a connection to the external server
● Application layer firewalls and other security devices are being merged into one device
● Access Control
► Firewall types
► Placement of firewalls
Analyzers
► Analyzers receive and store data collected by one or
more sensors
► Maximize the detection rate, i.e., the ratio of detected to total attacks
§ = Recall = TP / (TP + FN)
► Minimizing the false alarm rate, i.e., ratio of false positive to all negatives
§ = False Positive Rate = FP / (FP + TN)
IT-Security - Chapter 9 Access Control, Firewalls, Intrusion Detection 45
Problem: Base Rate Fallacy
● It is very difficult to meet this goal of high detection rate and low false alarm rate
● In general
► if the actual numbers of intrusions is low compared to the number of legitimate uses of a system
► Then if an alarm is raised the probability that indeed an attack takes place is very low unless the
detection is extremely discriminative
● Suppose two events A and B occur with probability Pr(𝐴) and Pr(𝐵), respectively
● What is the conditional probability that A occurs given that B has occurred?
Pr(𝐴 ∩ 𝐵)
Pr(𝐴 ∣ 𝐵) =
Pr(𝐵)
Pr 𝐴 𝐵 Pr(𝐵)
Pr(𝐵 ∣ 𝐴) =
Pr(𝐴)
● Suppose mutually exclusive events E1, … ,En together cover the entire set of possibilities
Pr 𝐴 = ∑! Pr(𝐴 ∣ 𝐸! ) - Pr(𝐸! )
● Assume
► IDS’s detection rate is 90%, i.e. IDS classifies 90% of SYN floods as attack
► IDS’s false alarm rate is 1%, i.e. IDS classifies 1% of valid connections as attack
● What is the probability that a connection flagged by IDS as a SYN flood really is a valid connection?
Pr(alarm | valid) • Pr(valid)
Pr(valid | alarm) =
Pr(alarm)
0.01 • 0.99
= ≈ 52% chance that traffic is valid
0.01 • 0.99 + 0.90 • 0.01 given an alarm is raised
● Anomaly Detection
► Try to determine whether current behavior is of a legitimate user or of intruder by comparing it to the
model
► Use a set of known malicious data patterns (signatures) or attack rules (heuristics) and compare them to
currently observed data
► Problem
§ Does not necessarily detect undesirable yet usual behavior
► Problem
§ Cannot detect new attacks, i.e. false negatives typically very high
IT-Security - Chapter 9 Access Control, Firewalls, Intrusion Detection 51
Anomaly Detection
● Training: develop a model of legitimate behavior
► Collect and process sensor data from normal operation of monitored system
► May occur at distinct times or may be a continuous of monitoring and evolving the model
● Detection approaches
► Statistical: analysis of the observed behavior using univariate, multivariate, or time-series models of observed metrics
► Knowledge-based: approaches use an expert system that classifies observed behavior according to a set of rules that model
legitimate behavior
► Machine-learning: approaches automatically determine a suitable model from features extracted from the sensor data using
machine-learning techniques
§ E.g. Bayesian networks, Markov models, neural networks, fuzzy logic, clustering, but also classifiers such as SVMs, Random Forests, deep
neural networks,…
§ Often make use of attack data as well, i.e. train model with benign AND malicious data
● Signature approaches
► Match large collection of known attack patterns against data monitored on a system or in transit over the
network
► Signatures need to be specific enough to minimize false alarm rate but still detect malicious data
► But: significant effort necessary to review new attacks and generate signatures
► Often derived from analyzing attack tools and scripts collected on the Internet
● Set of patterns defining a behavioral signature likely to be associated with attack of a certain type
● Attack signatures are usually very specific and may miss variants of known attacks
► Bodies of known viruses and worms, port numbers of applications with known buffer overflows, RET
addresses of overflow exploits
● Aims to detect both attacks from the outside as well as internal attack
● Are only able to detect attacks when they already hit the target system
● System call traces: Record sequences of system calls made by processes on the system
► Works well on Linux and Unix systems
► Difficult on Windows systems as use of DLLs hides which process uses which system calls (use of DLL
function calls proposed as alternative)
● Audit (log file) records: Operating systems include software that collects information on user activity
► Problem: audit records may not include relevant information; intruder may manipulate the records
● File integrity checksums: Detect intruder activity on a system by periodically scanning critical
files for changes
► Use message authentication code to compute checksums, compare them to a known baseline
► Examines traffic for many hosts with a variety of devices and software
● Challenge
► Arranging the monitoring to minimize the number of agents but cover the complete network
● Inline sensor
► Inserted into a network segment such that monitored traffic must pass the sensor
● Passive sensor
► Monitors copy of network traffic, actual traffic does not pass through it
► Sends an alert
► Timestamp
► Connection or session ID
► Source and destination IPs and ports, number of bytes transmitted over the connection
● Access Control
► An access policy determines which subjects have which rights over which objects
§ As opposed to authentication which determines who is who
► In role-based access control roles are used as subjects and users are assigned one or more roles
IT-Security - Chapter 9 Access Control, Firewalls, Intrusion Detection 61
Summary
● Network Firewalls
► Control network traffic flow to and from one network or network segment to another
► In stateful firewalls additional state is kept on previously inspected packets and acceptance / denial depends
on this state
► Consist of sensors that collect information and analyzers that receive information from sensors
● W. Stallings, Cryptography and Network Security: Principles and Practice, 8th edition, Pearson 2022