Network Security
Network Security
Network Security
Introduction
• A common mistake in network security
– Attempt to patch vulnerabilities in a weak network that was poorly
designed and implemented
• Most applications are not designed and written with security in mind
– The network to provide protection
– A secure network defense remains a critical element in any enterprise’s
overall security plan
1
11/14/2022
Introduction
• Securing a network begins with the design of the network
• A secure network can be achieved through
– Network design
– Network security technologies
2
11/14/2022
3
11/14/2022
• The protocols add a field to the packet that “tags” it as belonging to the VLAN
4
11/14/2022
Physical segmentation
5
11/14/2022
Physical segmentation
Jump Server: Running only essential protocols and ports and connects two
dissimilar security zones while providing tightly restricted access between
them
● Firewalls
● VPN
● IDS/IPS
● Honeypot
● Access Technologies
– Network Access Control
– ACL
● …
6
11/14/2022
Firewalls
● Designed to stop unauthorized
traffic flowing from one network to
another
– Separate trusted and untrusted components
of a network
Firewalls
● A firewall can be software-based or hardware-based
– Software firewall runs as a program or service on a device
– Hardware firewalls are specialized separate devices that inspect traffic
● Hardware firewalls
– Have more features but expensive
– Usually are located outside the network security perimeter - As the first line of defense
7
11/14/2022
Firewalls
Firewall Categories
● The basis of a firewall is a rule base
– Establishes what action the firewall should take when it receives a packet (allow,
block)
Firewalls
Firewall Actions
● Rejected: Similar to “Denied”, but tells the source about this decision through
ICMP packet
8
11/14/2022
Firewalls
Firewall Actions
Firewalls
Firewall Categories
– Looks at the incoming packet and permits or denies it based strictly on the rule base
9
11/14/2022
Firewalls
Firewall Categories
– Looks at the incoming packet and permits or denies it based strictly on the rule base
Firewalls
Stateless packet filtering
10
11/14/2022
Firewalls
Stateless packet filtering
• The firewall performs a simple check of the data packets coming through the router—
inspecting information such as the destination and origination IP address, port number,
and other without opening up the packet to inspect its contents
Firewalls
Stateless packet filtering
11
11/14/2022
Firewalls
Stateful Firewall
● Tracks the state of traffic by monitoring all the connection interactions until it is
closed
Firewalls
Stateful Firewall
12
11/14/2022
Stateful Firewall
Example: Connections are only allowed through the ports that hold open
connections
Firewalls
Specialized Firewall
● Web application firewall (WAF)
– Protects the web applications by filtering and monitoring HTTP/S traffic
– Block cross-site scripting, SQL injection attacks and others
– Protects the application layer
13
11/14/2022
Firewalls
Specialized Firewall
● Next Generation Firewall (NGFW)
– Has additional functionality beyond a traditional
firewall
– Detect applications by using deep packet
inspection - examine the payloads of packets
and determine if they are carrying malware
– Perform URL filtering and intrusion prevention
services.
Assignment
Open source
● iptables
● pfSense
14
11/14/2022
Introduction
● Networks primarily intended for internal use are called private network
● If we grant access from outside to the private network, the attack
surface will significantly broaden
15
11/14/2022
To achieve CIA
● Encryption as the internet is dangerous place and all the traffic
should be protected or encrypted
● Integrity verification - the integrity needs to be reserved
● Authentication - to make sure that you are authorized to be insider
– Outside computers have to go through the VPN server to reach the hosts inside
a private network via authentication
– VPN server is exposed to the outside and the internal computers are still
protected, via firewalls or reserved IP addresses
16
11/14/2022
A Typical Setup
● This is a typical VPN setup where the “Client” machine wants to connect
with machine “V” on a private network
– “Client” uses the “VPN Server” to get authenticated to the private network
IP Tunneling
IP Tunneling
Traffics inside
Tunnel End A the tunnel Tunnel End B
are protected
The tunnel goes
through a public
network, such as
the Internet.
17
11/14/2022
● IPSec Tunneling
● TLS/SSL Tunneling
IPSec Tunneling
TLS/SSL Tunneling
18
11/14/2022
TUN/TAP Interface
• Question: How can the Tunnel
application get an IP packet?
Socket
Interface
19
11/14/2022
TUN/TAP Interface
• Most operating systems have two types of network interfaces:
– Physical: Corresponds to the physical Network Interface Card (NIC)
– Virtual: A virtualized representation of computer network interfaces - the network interface can
be implemented in software
For example, the loopback interface (127.0.0.1 for IPv4 and ::1 for IPv6) is not a physical device but a
piece of software simulating a network interface
• TUN Virtual Interface
– Work at OSI layer 3 or IP level
– Sending any packet to TUN will result in the packet being delivered to user space program
• TAP Virtual Interface
– Work at OSI layer 2 or Ethernet level
– Used for providing virtual network adapters for multiple guest machines connecting to a physical device
of the host machine
TUN/TAP Interface
20
11/14/2022
Routing
packets to
the tunnel
Routing
packets to
the tunnel
21
11/14/2022
Packets to this destination should be routed All other traffic will be routed
to the tun0 interface, i.e., they should go to this interface, i.e., they will
through the tunnel. not go through the tunnel
22
11/14/2022
Introduction
Security Intrusion and Intrusion Detection – RFC 2828
Security Intrusion
• A security event, or combination of multiple security events, that constitutes
a security incident in which an intruder gains, or attempts to gain, access to a
system (or system resource) without having authorization to do so
Intrusion Detection
• A security service that monitors and analyzes system events for the purpose
of finding, and providing real-time or near real-time warning of attempts to
access system resources in an unauthorized manner
23
11/14/2022
24
11/14/2022
Hackers
• Motivated by thrill and status/reputation
– Hacking community is a strong meritocracy
– Status is determined by level of competence
• Aawareness of intruder led to establishment of CIRTs
– Computer / Cyber Incident Response Teams
– Collect / Disseminate Vulnerability Info / Responses
– Hackers may also gain access to CERT reports
• Important to quickly patch the discovered vulnerabilities
25
11/14/2022
Insider Attacks
• Most difficult to detect and prevent
– Employees have access and system knowledge
26
11/14/2022
Elements of IDS
• Primary assumptions:
– System activities are observable
– Normal and intrusive activities have distinct evidence/feature/pattern
• Components of intrusion detection systems:
– From an algorithmic perspective:
• Features - capture intrusion evidences
• Models - Piece evidences together
– From a system architecture perspective:
• Various components: audit data processor, knowledge base, decision engine, alarm
generation and responses
Components of IDS
System Activities are Audit Records
Observable
Audit Data
Preprocessor
Activity Data
27
11/14/2022
Audit Records
• A fundamental tool for intrusion detection
• Two variants:
– Native audit records - provided by OS
• All multi-user OSes include accounting software that collects information on user activity
• Always available and no additional collection software is needed but may not contain
enough info or may not contain it in a convenient form
28
11/14/2022
Signature-based Detection
• Assumes that each intrusive activity is representable by a unique
pattern or a signature - signatures of known threats to identify them
– Attack signature database is maintained – Signature of known threats
• Sequences of system calls, patterns of network traffic, etc.
• Example: if (traffic contains “x90+de[^\r\n]{30}”) then “attack detected”
– Compare traffic to the database
– If match is found, alert is sent
– Requires constant updates
• High threat detection rate with no false positives, but blind to
zero-day vulnerabilities.
Anomaly-based Detection
• Learning systems by continuously creating “norms” of activities
– Norms are then later used to detect anomalies that might indicate an intrusion
– Compares observed activity against expected normal usage profiles
• Define a profile describing “normal” behavior, then detects deviations
– Anomalies caused by other element faults
• Example: router failure or misconfiguration
• Relatively high false negative/positive rates
29
11/14/2022
Anomaly Detection
Threshold detection
• Involves counting the number of occurrences of a specific event type over an
interval of time
– If the count surpasses what is considered a reasonable number that one
might expect to occur, then intrusion is assumed
• Checks excessive event occurrences over time
Anomaly Detection
Profile based
• Characterize past behavior of users, group of users, applications, then,
detect significant deviations
• A profile may consist of a set of parameters
– Counter: - request count, tasks completed, error count
– Gauge: - memory usage, queue size, number of requests in progress
30
11/14/2022
61
62
31
11/14/2022
63
32
11/14/2022
Snort Architecture
• Packet Decoder: parses the packet headers in all layers
• Detection Engine: actual IDS. Rule-based analysis.
• If the packet matches a rule, the rule specifies logging and alerting
options
33
11/14/2022
Snort Rules
• Snort uses a simple, flexible and effective rule definition language
– But needs training to be an expert on it
• Each rule has a fixed header and zero or more options
• Header fields
– action: what to do if matches – alert, drop, pass, etc.
– protocol: analyze further if matches - IP, ICMP, TCP, UDP
– source IP: single, list, any, negation
– source port: TCP or UDP port; single, list, any, negation
– direction: unidirectional (->) or bidirectional (<->).
– dest IP, dest port: same format as sources
Snort Rules
• Many options
– Different categories
– Other header fields can be checked using options
• Option format
– Keyword: arguments;
• Several options can be listed separated by semicolon
– Options are written in parentheses
• Example rule to detect TCP SYN-FIN attack:
Alert tcp $EXTERNAL_NET any -> $HOME_NET any \
(msg: "SCAN SYN FIN"; flags: SF;)
34
11/14/2022
Proxy Server
• Act as substitutes on behalf of the primary device
– Forward proxy
– Reverse proxy
• look for malware before it reaches the internal endpoint
• Hide the IP address of endpoints inside the secure network
Deception Instruments
35
11/14/2022
Deception Instruments
• Deception
– Act of causing someone to accept as true that is false
71
Honeypots
• A system designed to look like something that an intruder can hack
• The goal for a honeypot is to deceive intruders and learn from them
without compromising the security of the network
– To deceive attackers and learn about their tools and methods
72
36
11/14/2022
Honeypots
73
Honeypots
• Instrumented with monitors and event loggers
74
37
11/14/2022
Honeypot Deployment
Finding a strategic place for the
honeypot is important
Sinkholes
• Another deception technique designed to steer unwanted traffic away
from its intended destination to another device
– Deceiving the threat actor into thinking the attack is successful when the sinkhole is actually
providing information about the attack
Example
• A DNS sinkhole changes a normal DNS request to a pre-configured IP
address that points to a firewall with a rule of Deny set for all packets
– Every packet is dropped with no return information provided to the sender
38
11/14/2022
Access Technologies
• Designed to grant or deny access
• The access may be to the network or to specific data
• Includes
– Access Control List
– Network Access Control
39
11/14/2022
Networking ACLs
• External router ACL
– Restrict known vulnerable protocols from entering the network
– Limit traffic entering the network from unapproved networks
– Against IP spoofing that imitates another computer’s IP address
• Internal routers ACL
– Applies to outbound packets
– Usually are less restrictive but more specific than those on external routers ACLs
40
11/14/2022
Port Security
• Securing the ports on network devices such as a switch or router is important
to secure a network
• Attackers can access a network device through an unprotected port
– Reconfigure the device to introduces a number of vulnerabilities (compromise of route
security)
– False route information can be injected
• Types of attacks through port security
– MAC flooding
– MAC address spoofing
– ARP poisoning
41