Securityأمن الشبكات
مقدمة الفصل
ماذا ستتعلم في هذا الفصل
- What network security is: confidentiality, authentication, message integrity, access and availability; what a "bad guy" can do.
- The language of cryptography: plaintext, ciphertext, encryption and decryption keys.
- Securing TCP connections with SSL: its goals, its place above TCP, the handshake and the record protocol.
- Network-layer confidentiality with IPsec: services, transport and tunnel modes, AH and ESP.
- Operational security: firewalls (stateless packet filters, application gateways) and their limitations; intrusion detection systems.
أقسام الفصل
- 1What is network security?ما أمن الشبكات؟
- 2The language of cryptographyلغة التشفير
- 3SSL: Secure Sockets LayerSSL: طبقة المقابس الآمنة
- 4Network-layer confidentiality and IPsecالسرية في طبقة الشبكة وIPsec
- 5Firewalls and stateless packet filteringالجدران النارية وترشيح الحزم عديم الحالة
- 6Application gateways and limitations of firewallsبوابات التطبيقات وحدود الجدران النارية
- 7Intrusion detection systemsأنظمة كشف التسلل
تلميح: استخدم أسهم لوحة المفاتيح للتنقل بين الشرائح.
What is network security?ما أمن الشبكات؟
Only sender, intended receiver should "understand" message contents: sender encrypts message, receiver decrypts message.
Sender, receiver want to confirm identity of each other.
Sender, receiver want to ensure message not altered (in transit, or afterwards) without detection.
Services must be accessible and available to users.
Alice, Bob, Trudy — and what a bad guy can doأليس وبوب وترودي
What is network security?
- Bob, Alice want to communicate "securely"; Trudy (intruder) may intercept, delete, add messages.
- Real-life Bobs and Alices: Web browser/server for electronic transactions (e.g., on-line purchases); on-line banking client/server; DNS servers; routers exchanging routing table updates.
ما الذي يستطيع المهاجم فعله؟ تذكّر قبل الكشف.
- Eavesdropالتنصت
Intercept messages.
- Insert messagesإدخال رسائل
Actively insert messages into connection.
- Impersonationالانتحال
Can fake (spoof) source address in packet (or any field in packet).
- Hijackingالاختطاف
"Take over" ongoing connection by removing sender or receiver, inserting himself in place.
- Denial of serviceحجب الخدمة
Prevent service from being used by others (e.g., by overloading resources).
The language of cryptographyلغة التشفير
- m
Plaintext message.
- K_A
Alice's encryption key + encryption algorithm → ciphertext K_A(m).
- K_B
Bob's decryption key + decryption algorithm → plaintext again: m = K_B(K_A(m)).
SSL: Secure Sockets LayerSSL
- Widely deployed security protocol: supported by almost all browsers, web servers; https; billions $/year over SSL.
- Mechanisms: [Woo 1994]; implementation: Netscape. Variation — TLS: transport layer security, RFC 2246.
- Provides confidentiality, integrity, authentication.
- Original goals: Web e-commerce transactions; encryption (especially credit-card numbers); Web-server authentication; optional client authentication; minimum hassle in doing business with new merchant.
- Available to all TCP applications: secure socket interface.
Normal application
- Application
- TCP
- IP
Application with SSL
- Application
- SSL
- TCP
- IP
- SSL provides application programming interface (API) to applications.
- C and Java SSL libraries/classes readily available.
Real SSL: the handshakeمصافحة SSL
SSL: Secure Sockets Layer
- 1Server authentication
- 2Negotiation: agree on crypto algorithms
- 3Establish keys
- 4Client authentication (optional)
Handshake steps (slide 10)
- 1
Client sends list of algorithms it supports, along with client nonce.
- 2
Server chooses algorithms from list; sends back: choice + certificate + server nonce.
- 3
Client verifies certificate, extracts server's public key, generates pre_master_secret, encrypts with server's public key, sends to server.
- 4
Client and server independently compute encryption and MAC keys from pre_master_secret and nonces.
- 5
Client sends a MAC of all the handshake messages.
- 6
Server sends a MAC of all the handshake messages.
Why the last two MACs, and why two nonces?MAC والرقمان العشوائيان
SSL: Secure Sockets Layer
فكّر في الهجوم قبل أن تكشف الحل.
Tampering with the handshake (slide 11)
The client offers a range of algorithms, some strong, some weak. A man-in-the-middle deletes the stronger algorithms from the list. What stops this?
The **last 2 steps** (each side sends a MAC of all the handshake messages) **protect the handshake from tampering**; the last two messages are encrypted.
Replaying records (slide 12)
Trudy sniffs all messages between Alice & Bob; next day she opens a TCP connection with Bob and sends the exact same sequence of records. Bob (Amazon) would think Alice made two separate orders for the same thing. What stops this?
**Bob sends a different random nonce for each connection.** This causes the **encryption keys to be different on the two days**, so Trudy's messages **fail Bob's integrity check**.
SSL record protocol and record formatسجلات SSL
SSL: Secure Sockets Layer
- Data is split into fragments; each fragment gets a MAC; data and MAC are encrypted; a record header is added.
- Record header: content type; version; length.
- MAC: includes sequence number, MAC key M_x.
- Fragment: each SSL fragment 2^14 bytes (~16 Kbytes).
| Field | Size |
|---|---|
| content type | 1 byte |
| SSL version | 2 bytes |
| length | 3 bytes |
| data | لا تذكر الشرائح شيئًا هنا. |
| MAC | لا تذكر الشرائح شيئًا هنا. |
- Data and MAC encrypted (symmetric algorithm).
- Real SSL connection (slide 15): after the handshake, everything henceforth is encrypted; TCP FIN follows.
Network-layer confidentiality and IPsec servicesIPsec وخدماته
Between two network entities, the sending entity encrypts the datagram payload — TCP or UDP segment, ICMP message, OSPF message …. All data sent from one entity to the other would be hidden (web pages, e-mail, P2P file transfers, TCP SYN packets …): "blanket coverage".
IPsec services (slide 17)
- data integrity
- origin authentication
- replay attack prevention
- confidentiality
- Two protocols providing different service models: AH and ESP.
IPsec modes and protocolsأوضاع IPsec وبروتوكولاه
Network-layer confidentiality and IPsec
Transport modeوضع النقل
- IPsec datagram emitted and received by end-system
- Protects upper level protocols
Tunneling modeوضع النفق
- Edge routers IPsec-aware
- or hosts IPsec-aware
| Protocol | Source authentication | Data integrity | Confidentiality |
|---|---|---|---|
| AH (Authentication Header) | Yes | Yes | No |
| ESP (Encapsulation Security Protocol) | Yes | Yes | Yes |
- ESP is more widely used than AH.
- Four combinations are possible: host mode with AH, host mode with ESP, tunnel mode with AH, tunnel mode with ESP — tunnel mode with ESP: most common and most important (slide 21).
Firewalls: what and whyالجدار الناري ولماذا
Firewalls and stateless packet filtering
Isolates organization's internal net from larger Internet, allowing some packets to pass, blocking others. Administered network: trusted "good guys"; public Internet: untrusted "bad guys".
Firewalls: why (slide 23)
- Prevent denial of service attacks
- SYN flooding: attacker establishes many bogus TCP connections, no resources left for "real" connections
- Prevent illegal modification/access of internal data
- e.g., attacker replaces CIA's homepage with something else
- Allow only authorized access to inside network
- set of authenticated users/hosts
Three types of firewalls
- stateless packet filters
- stateful packet filters
- application gateways
Stateless packet filteringالمرشح عديم الحالة
- Internal network connected to Internet via router firewall.
- Router filters packet-by-packet; decision to forward/drop packet based on:
- source IP address
- destination IP address
- TCP/UDP source and destination port numbers
- ICMP message type
- TCP SYN and ACK bits
ما نتيجة كل قاعدة؟
Example 1
Block incoming and outgoing datagrams with IP protocol field = 17 and with either source or dest port = 23.
**All incoming, outgoing UDP flows and telnet connections are blocked.**
Example 2
Block inbound TCP segments with ACK=0.
**Prevents external clients from making TCP connections with internal clients, but allows internal clients to connect to outside.**
Policies and firewall settingsسياسات وإعدادات
Firewalls and stateless packet filtering
| Policy | Firewall setting (slide 26) |
|---|---|
| No outside Web access. | Drop all outgoing packets to any IP address, port 80 |
| No incoming TCP connections, except those for institution's public Web server only. | Drop all incoming TCP SYN packets to any IP except 130.207.244.203, port 80 |
| Prevent Web-radios from eating up the available bandwidth. | Drop all incoming UDP packets - except DNS and router broadcasts. |
| Prevent your network from being used for a smurf DoS attack. | Drop all ICMP packets going to a "broadcast" address (e.g. 130.207.255.255). |
| Prevent your network from being tracerouted | Drop all outgoing ICMP TTL expired traffic |
Application gatewaysبوابات التطبيقات
Filters packets on application data as well as on IP/TCP/UDP fields.
Example: allow select internal users to telnet outside
- 1
Require all telnet users to telnet through gateway.
- 2
For authorized users, gateway sets up telnet connection to dest host. Gateway relays data between 2 connections.
- 3
Router filter blocks all telnet connections not originating from gateway.
Limitations of firewalls, gatewaysحدود الجدران النارية
Application gateways and limitations of firewalls
- IP spoofingRouter can't know if data "really" comes from claimed source.
- One gateway per applicationIf multiple app's. need special treatment, each has own app. gateway.
- Client configurationClient software must know how to contact gateway, e.g., must set IP address of proxy in Web browser.
- UDPFilters often use all or nothing policy for UDP.
- TradeoffDegree of communication with outside world, level of security.
- Still attackedMany highly protected sites still suffer from attacks.
Intrusion detection systemsأنظمة كشف التسلل
| Packet filtering | IDS | |
|---|---|---|
| What it looks at | TCP/IP headers only | Packet contents (deep packet inspection), e.g. character strings against a database of known virus, attack strings |
| Across packets/sessions | No correlation check among sessions | Examines correlation among multiple packets |
- Multiple IDSs: different types of checking at different locations (slide 31).
- The figure shows a firewall between the internal network and the Internet, IDS sensors, and a demilitarized zone with the Web server, FTP server and DNS server.
الخلاصة
أنهيت الدرس
الخطوة التالية: ثبّت المعلومات بالبطاقات، ثم اختبر نفسك بالأسئلة.
ما راجعته في هذا الدرس
- What is network security?ما أمن الشبكات؟
- The language of cryptographyلغة التشفير
- SSL: Secure Sockets LayerSSL: طبقة المقابس الآمنة
- Network-layer confidentiality and IPsecالسرية في طبقة الشبكة وIPsec
- Firewalls and stateless packet filteringالجدران النارية وترشيح الحزم عديم الحالة
- Application gateways and limitations of firewallsبوابات التطبيقات وحدود الجدران النارية
- Intrusion detection systemsأنظمة كشف التسلل