Everyone wants to be on the Internet and to interconnect networks.
Has persistent security concerns and can’t easily secure a system.
Typically uses Firewalls and IDS to provide perimeter defence as part of comprehensive security strategy.
The Role of the Firewall
A hardware or software solution which restricts access between your network and an outside network.
- Firewall can be uni-directional or bi-directional
- Usually at perimeter (where the two networks meet)
Firewalls restrict access to services you don’t want to make available to the outside.
- This includes services and machines that you don’t know about (Web servers on desktops, laptops using public ports, etc)
Firewalls scale well and centralize management.
- As the number of hosts increases, the ability to fully secure and monitor each host decreases. Firewalls help solve this problem by allowing some amount of centralization.
It can not protect against everything!!!
What is a Firewall?
A choke point of control and monitoring.
Interconnects networks with differing trust.
Imposes restrictions on network services.
Only authorized traffic is allowed.
Auditing and controlling access.
Can implement alarms for abnormal behavior.
Provide NAT & usage monitoring.
Implement VPNs using IPSec.
Cannot protect from attacks bypassing it.
E.g., sneaker net, utility modems, trusted organisations, trusted services (eg SSL/SSH).
Cannot protect against internal threats.
E.g. disgruntled or colluding employees.
Cannot protect against transfer of all virus infected programs or files.
Because of huge range of O/S & file types.
Cannot protect from natural disasters.
Cannot protect from yourself.
Traditional packet filters: filters often combined with router, creating a firewall.
Firewalls – Packet Filters
Simplest, fastest firewall component.
Foundation of any firewall system.
Examine each IP packet (no context) and permit or deny according to rules.
Hence restrict access to services (ports).
Possible default policies:
- that not expressly permitted is prohibited;
- that not expressly prohibited is permitted.
Traditional packet filters
Analyzes each datagram going through it; makes drop decision based on:
- source IP address;
- destination IP address;
- source port;
- destination port;
- TCP flag bits:
- SYN bit set: datagram for connection initiation;
- ACK bit set: part of established connection;
- TCP or UDP or ICMP: firewalls often configured to block all UDP;
- Direction: is the datagram leaving or entering the internal network?
- Router interface: decisions can be different for different interfaces.
Filtering Rules – Examples
Each router/firewall interface can have its own ACL.
Access control lists
Apply rules from top to bottom.
Advantages and disadvantages of traditional packet filters
- one screening router can protect entire network;
- can be efficient if filtering rules are kept simple;
- widely available. Almost any router, even Linux boxes.
- can possibly be penetrated;
- cannot enforce some policies. For example, permit certain users;
- rules can get complicated and difficult to test.
Attacks on Packet Filters
IP address spoofing:
- fake source address;
Source routing attacks:
- attacker sets a route other than default;
- block source routed packets.
Tiny fragment attacks:
- split header info over several tiny packets;
- either discard or reassemble before check.
Firewalls – Stateful Packet Filters
Traditional packet filters do not examine higher layer context: i.e., matching return packets with outgoing flow.
Stateful packet filters address this need.
They examine each IP packet in context:
- keep track of client-server sessions;
- check each packet validly belongs to one;
Stateful filter: Adds more intelligence to the filter decision-making process.
Stateful = remember past packets.
They are better able to detect bogus packets out of context.
Stateful filters: example
Log each TCP connection initiated through firewall: SYN segment.
Timeout entries which see no activity for, say, 60 seconds.
If rule table indicates that stateful table must be checked: check to see if there is already a connection in stateful table.
Stateful filters can also remember outgoing UDP segments.
- Packet arrives from outside: SA=18.104.22.168, SP=80,DA=22.214.171.124, DP=12699, SYN=0, ACK=1
- Check filter table → check stateful table
- Connection is listed in connection table → let packet through
Firewalls – Application Level Gateway (or Proxy)
Have application specific gateway / proxy.
Has full access to protocol:
- user requests service from proxy;
- proxy validates request as legal;
- then actions request and returns result to user;
- can log / audit traffic at application level.
Need separate proxies for each service:
- some services naturally support proxying;
- others are more problematic.
Advantages and disadvantages of proxy gateways
- Proxy can log all connections, activity in connections
- Proxy can provide caching
- Proxy can do intelligent filtering based on content
- Proxy can perform user-level authentication
- Not all services have proxied versions
- May need different proxy server for each service
- Requires modification of client
Security in the other layers
- Network security is able to protect data by encrypting all data in the datagrams and cannot provide user-level security.
- It is easier to deploy new Internet services at the higher layers of the stack; application developers introduce in their application many security features.
Some examples at other layers:
- secure e-mail:PGP;
- secure trasport protocols: SSL.
Pretty good privacy (PGP)
Internet e-mail encryption scheme, de-facto standard.
Uses symmetric key cryptography, public key cryptography, hash function, and digital signature as described.
Provides secrecy, sender authentication, integrity.
Inventor, Phil Zimmerman.
PGP combines the best available cryptographic algorithms to achieve secure e-mail communication.
It is assumed that all users are using public key cryptography (with RSA digital signatures) and have generated a private/public key pair.
All users also use a symmetric key system such as triple DES.
This is a digital signature scheme with hashing.
- Alice has (private/public) key pair (Ad/Ae) and she wants to send a digitally signed message m to Bob.
- Alice hashes the message using SHA-1 to obtain SHA(m).
- Alice encrypts the hash using her private key Ad to obtain ciphertext c given by c=pk.encryptAd(SHA(m))
- Alice sends Bob the pair (m,c)
- Bob receives (m,c) and decrypts c using Alice’s public key Ae to obtain signature s s=pk.decryptAe(c)
- He computes the hash of m using SHA-1 and if this hash value is equal to s then the message is authenticated.
Bob is sure that the message is correct and that is does come from Alice. Furthermore Alice cannot later deny sending the message since only Alice has access to her private key Ad which works in conjunction with the public key Ae.
- Alice wishes to send Bob a confidential message m.
- Alice generates a random session key k for a symmetric cryptosystem.
- Alice encrypts k using Bob’s public key Be to get k’ = pk.encryptBe(k)
- Alice encrypts the message m with the session key k to get ciphertext c c=sk.encryptk(m)
- Alice sends Bob the values (k’,c)
- Bob receives the values (k’,c) and decrypts k’ using his private key Bd to obtain k k=pk.decryptBd(k’)
- Bob uses the session key k to decrypt the ciphertext c and recover the message m m=sk.decryptk(c)
Public and symmetric key cryptosystems are combined in this way to provide security for key exchange and then efficiency for encryption. The session key k is used only to encrypt message m and is not stored for any length of time.
PGP Authenticaton and Confidentiality
The schemes for authentication and confidentiality can be combined so that Alice can sign a confidential message which is encrypted before transmission. The steps required are as follows:
- Alice generates a signature c for her message m as in the Authentication scheme c=pk.encryptAd(SHA(m))
- Alice generates a random session key k and encrypts the message m and the signature c using a symmetric cryptosystem to obtain ciphertext C C=sk.encryptk(m,c)
- She encrypts the session key k using Bob’s public key k’ = pk.encryptBe(k)
- Alice sends Bob the values (k’,C)
- Bob recieves k’ and C and decrypts k’ using his private key Bd to obtain the session key k k=pk.decryptBd(k’)
- Bob decrypts the ciphertext C using the session key k to obtain m and c (m,c) = sk.decryptk(C)
- Bob now has the message m. To authenticate it he uses Alice’s public key Ae to decrypt the signature c and hashes the message m using SHA-1. If SHA(m) = pk.decryptAe(C) Then the message is authenticated.
Secure Sockets Layer (SSL)
Transport layer security to any TCP-based app using SSL services.
Used between Web browsers, servers for e-commerce (https).
- server authentication;
- data encryption;
- client authentication (optional).
- SSL-enabled browser includes public keys for trusted CAs;
- browser requests server certificate, issued by trusted CA;
- browser uses CA’s public key to extract server’s public key from certificate.
Check your browser’s security menu to see its trusted CAs.
Encrypted SSL session
Browser generates symmetric session key, encrypts it with server’s public key, sends encrypted key to server.
Using private key, server decrypts session key.
Browser, server know session key: All data sent into TCP socket (by client or server) encrypted with session key.
SSL: basis of IETF Transport Layer Security (TLS).
SSL can be used for non-Web applications, e.g., IMAP.
Client authentication can be done with client certificates.
SSL Handshake Protocol – overview