CSEC - 5

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/76

encourage image

There's no tags or description

Looks like no tags are added yet.

77 Terms

1
New cards

What is a firewall?

A security measure that prevents unauthorized electronic access to a networked system by filtering traffic between a private network and a public network

2
New cards

Firewall analogy

Like a firewall in building construction: it isolates one network or compartment from another

3
New cards

Physical setup of a boundary firewall

A machine that all wires from outside and inside connect to so ALL traffic passes through it and gets allow or deny decisions

4
New cards

What can a firewall NOT protect against?

Insider threats (malicious employee or USB key) and anything already inside the network - it only controls traffic crossing the boundary

5
New cards

Zero trust architecture

Trust nobody: every access must be authenticated and explicitly permitted even inside the network (contrast: a firewall trusts internal traffic)

6
New cards

Firewall policy

A set of rules (rows) the firewall compares each packet against to allow or deny it

7
New cards

Fields a firewall rule can match on

Type/protocol (TCP or UDP) - source address - destination address - destination port - action (permit or deny)

8
New cards

Firewall rule order

First matching rule wins - rules are checked top to bottom - if nothing matches the default action applies (or a catch-all rule at the bottom)

9
New cards

Allowlist firewall

Deny-by-default: only explicitly permitted traffic gets through - use for highly sensitive systems

10
New cards

Blocklist firewall

Allow-by-default: everything is permitted unless explicitly denied - use when you only want to stop nuisances

11
New cards

How to choose allowlist vs blocklist?

Depends on which list is shorter and how sensitive the assets are: sensitive = allowlist and nuisance control = blocklist

12
New cards

Rule: TCP from * to 192.168.1.* port 22 Permit

Allows SSH connections from anywhere (including the internet) to internal machines - e.g. remote access to your office PC from home

13
New cards

Port 22 / Port 80 / UDP port 69

22 = SSH - 80 = HTTP (web browsing) - 69 = TFTP (UDP)

14
New cards

Rule: TCP from 192.168.1.* to * port 80 Permit

Internal machines can browse the web (outbound HTTP)

15
New cards

Rule: TCP from * to 192.168.1.18 port 80 Permit

Anyone can reach the internal web server at 192.168.1.18 on port 80 (inbound)

16
New cards

Rule: UDP from * to 192.168.1.* any port Deny

Blocks all other UDP into the network - rule 2 (port 69) is matched first so that traffic still gets through

17
New cards

DMZ

Demilitarized zone: a semi-exposed segment holding public-facing servers (email and web and app) between the internet and the internal network

18
New cards

Home Wi-Fi router firewall

Home routers (from your ISP) run a firewall by default - you can view it and add your own rules (e.g. to allow a home server)

19
New cards

Three types of firewall

Packet filter (stateless) - stateful filter - application layer firewall (proxy)

20
New cards

Stateless firewall

Has no memory: treats each packet in isolation using only the rule table and forgets it once it has been handled

21
New cards

Stateless firewall advantage

Fast and simple so very common in the wild

22
New cards

Stateless firewall limitation

Has to be fairly restrictive to stop attacks - cannot tell whether a packet belongs to a real connection

23
New cards

Stateless rules for the TCP handshake example

Allow outbound SYN to port 80 - allow inbound SYN-ACK from port 80 - drop inbound SYN (stops outsiders initiating connections)

24
New cards

TCP three-way handshake

SYN (client) then SYN-ACK (server) then ACK (client)

25
New cards

Stateful firewall

Tracks every active connection in a state table and can tell if a packet starts a new connection or is part of an existing one or is invalid

26
New cards

What does a firewall state table store?

IP addresses and ports and sequence numbers for each active connection (plus the connection state e.g. established)

27
New cards

How a stateful firewall stops an attacker's fake SYN-ACK

The inbound packet matches no row in the state table (no connection was started from inside) so it is dropped

28
New cards

What can stateful firewalls allow inbound?

Only TCP packets that are replies to a connection initiated from inside the trusted network

29
New cards

Stateful vs stateless: trade-offs

Stateful is more powerful and stops inserted or out-of-order packets - but needs memory and costs more and is harder to configure and debug

30
New cards

Why are firewall rule sets hard to debug?

Rules accrue over time into a tangled puzzle - sometimes best to start fresh and cut down the number of rules

31
New cards

Application layer firewall

Works like a proxy: simulates the application and inspects the PAYLOAD as well as headers so it can block or modify content

32
New cards

Which firewalls look at the payload?

Only application layer firewalls - stateless and stateful ones just read IP and TCP headers

33
New cards

Application layer firewall examples

Block web traffic with certain words (censorship) - remove macros from Word files in email - stop credit card numbers leaving a database - scan attachments for malware

34
New cards

Sanitization

An application firewall edits a packet to remove sensitive data (e.g. replace personal info with generic text) instead of dropping it

35
New cards

Why can only the application layer scan email attachments?

The network layer does not know what an attachment is - only the application layer understands the content

36
New cards

Port scan

Attacker contacts many ports on a target (one source IP and many destination ports) to find listening services - the first step in mapping a network before attacking

37
New cards

How to deal with port scans

They happen constantly on the internet: block the source IP and drop traffic to ports you are not running anything on

38
New cards

Personal firewall

Software firewall on the device itself (e.g. Windows Defender) - basic protection for home and mobile devices

39
New cards

Rootkit weakness of personal firewalls

Rootkit-type software runs at the lowest privilege level and can disable the firewall or virus scanner - even benign programs (e.g. anti-cheat) can act like one

40
New cards

Firewall pros

Prevent straightforward attacks and information leakage - if you can think of how an attacker would act you can write a rule for it

41
New cards

Firewall cons

Can be circumvented - can block legitimate traffic - cost rises as effectiveness rises (overhead and configuration) - false sense of security

42
New cards

Firewall bottom line

You have to have one but do not count on it for much

43
New cards

Defense in depth

Many layers of defenses (e.g. firewall + IDS) because no single one is enough

44
New cards

Why does NAT exist?

IPv4 address exhaustion: only 2^32 (about 4.3 billion) addresses but far more devices than that

45
New cards

IPv4 address size

32 bits = 4 x 8 bits (e.g. 192.168.2.6)

46
New cards

IPv6 vs NAT

IPv6 is the long-term fix - NAT was the stopgap that let many internal IPs share one external IP

47
New cards

What is NAT?

The border router or firewall maps between its own external IP and the internal private IPs so many machines share one routable address

48
New cards

Private vs routable IPs

Only external (public) IPs are routable on the internet - private ranges (192.168.x.x and 172.16-31.x.x and 10.x.x.x) get dropped if they try to cross it

49
New cards

Why does your laptop IP differ from what whatismyip shows?

Your laptop has a private internal IP (e.g. 172.20.145.155 on uni WiFi) - websites only see the NAT router's external IP

50
New cards

Same internal IP on two networks

Fine: private addresses only need to be unique within their own network (e.g. a company PC and a home PC can both be 192.168.4.2)

51
New cards

NAT outbound step

Router keeps the destination - rewrites the SOURCE IP and port to its own external IP and a new port - and records the mapping in a table

52
New cards

NAT inbound step to a server

Router rewrites the DESTINATION to the internal host registered for that port (e.g. port 80 goes to 192.168.4.2)

53
New cards

Port forwarding

Router rule saying traffic arriving on port X is for internal machine Y - needed so outsiders can reach a server behind NAT - two machines cannot share the same forwarded port

54
New cards

NAT reply path

Router looks up the port in its table - swaps the stored internal address and port back in - and forwards the reply to the right machine

55
New cards

NAT header rule of thumb

Leaving a network: change the FROM - arriving at a network: change the TO

56
New cards

NAT worked example from slides

Home PC 192.168.4.2 port 5338 sends to 173.162.146.61 port 80 - home router rewrites source to 192.41.131.255 port 7648 - company router then rewrites the destination to 192.168.4.2 port 80

57
New cards

Risk of setting up NAT/port forwarding for IoT cameras

Letting yourself view the camera remotely also exposes it to attackers - cheap devices keep default passwords

58
New cards

Shodan

A search engine that keeps scanning the internet for exposed insecure devices (webcams etc) with default passwords

59
New cards

IDS

Intrusion Detection System: detects an incident already in progress - firewalls prevent while an IDS detects

60
New cards

Why do we need an IDS if we have a firewall?

Some traffic must be let in and humans are the weakest link (phishing and attachments and insider threats) so not everything can be anticipated

61
New cards

Network operations center

Room where staff monitor alarms and network activity for weird behaviour - you need sensible alarms rather than hundreds of screens

62
New cards

True positive

Attack happens and the alarm sounds (good)

63
New cards

False positive

No attack but the alarm sounds (a false alarm)

64
New cards

False negative

Attack happens but no alarm sounds (a missed attack)

65
New cards

True negative

No attack and no alarm (good)

66
New cards

Can an IDS have zero false positives and zero false negatives?

No - the nature of alarms means you cannot eliminate both so tuning trades one off against the other

67
New cards

Rule-based (signature) IDS

Uses signatures of known attacks to detect matching actions

68
New cards

Rule-based IDS pros and cons

Pro: high accuracy and low false positives - Cons: admin must anticipate attacks - attackers can test against common signatures - cannot detect new attack types (so more false negatives)

69
New cards

Statistical (anomaly) IDS

Dynamically builds a model of normal behaviour and flags anything that does not match

70
New cards

Statistical IDS pros and cons

Pros: no need to anticipate attacks and can detect new attacks - Cons: needs warm-up time and has higher false positives and lower accuracy

71
New cards

Base-rate fallacy

Even a 99% accurate IDS gives mostly false alarms when real attacks are rare because benign traffic hugely outnumbers malicious traffic

72
New cards

Base-rate fallacy numbers from slides

1000100 log entries: 100 malicious (99 detected and 1 missed) and 1000000 benign (10000 false positives) - so 10099 alarms and about 99% are false

73
New cards

Target 2013 breach

IDS correctly flagged the attack but there were too many alarms to investigate - and insurers can refuse cover if you knew about an attack and did nothing

74
New cards

Alarm fatigue

Too many (mostly false) alarms make staff stop looking - a noisy IDS can be a liability

75
New cards

Attacker abusing an IDS

Attacker deliberately triggers floods of false positives to bury the real attack or wear out analysts

76
New cards

Firewall vs IDS in one line

Firewall prevents known-bad traffic - IDS detects incidents in progress

77
New cards

How to practise NAT for the exam

Draw the packet headers (FROM and TO and ports) at each hop for both the request and the reply - it is a common exam question