Post on 22-Mar-2019
Fi llFirewall
Pengertian Firewall• Firewall adalah sebuah software atau hardware atau
kombinasi keduanya maupun sistem itu sendiri untukkombinasi keduanya maupun sistem itu sendiri untuk mencegah akses yang tidak berhak ke suatu jaringan sehingga ada suatu mekanisme yang bertujuan untuk melindungi baik dengan menyaring membatasi ataumelindungi, baik dengan menyaring, membatasi atau bahkan menolak suatu hubungan/kegiatan (dari luar dari luar kedalam atau dari dalam ke luarkedalam atau dari dalam ke luar) suatu segmen pada jaringan pribadi dengan jaringan l ar ang b kanjaringan pribadi dengan jaringan luar yang bukan merupakan ruang lingkupnya berdasarkan aturan-aturan yang ditetapkan. Segmen tersebut dapat merupakan sebuah jaringan workstation, server,router, atau local area network (LAN) maupun wireless.
2
Konsep Firewall
● Tujuan untuk melindungi, dengan :j g , g● Menyaring● membatasi
menolak
hubungan /kegiatan suatu segmen pada jaringan pribadi dengan jaringan luar yang bukan merupakan ruang lingkupnya● menolak
● Segmen tersebut dapat merupakan sebuah workstation, server, router, atau local area network
bukan merupakan ruang lingkupnya
(LAN) anda
3
Konfigurasi SederhanaKonfigurasi Sederhanapc (jaringan local) <==> firewall <==> internet (jaringan lain)p (j g ) (j g )
Boleh lewat mbak ? Nih surat-suratnya
Anak kecil ga boleh keluar.. sudah malamkeluar.. sudah malam
Firewall
4
Karakteristik FirewallKarakteristik Firewall● Seluruh hubungan/kegiatan dari dalam ke luar ,
h l ti fi llharus melewati firewall.● Hal ini dapat dilakukan dengan cara memblok/membatasi
baik secara fisik semua akses terhadap jaringan Lokal, kecuali melewati firewall Banyak sekali bentuk jaringankecuali melewati firewall. Banyak sekali bentuk jaringan yang memungkinkan.
● Hanya Kegiatan yang terdaftar/dikenal yang dapat melewati/melakukan hubungan, g● hal ini dapat dilakukan dengan mengatur policy pada
konfigurasi keamanan lokal. Banyak sekali jenis firewall yang dapat dipilih sekaligus berbagai jenis policy yang ditawarkan.ditawarkan.
● Firewall itu sendiri haruslah kebal atau relatif kuat terhadap serangan/kelemahan. ● hal ini berarti penggunaan sistem yang dapat dipercaya dan p gg y g p p y
dengan Operating system yang relatif aman.5
Teknik Yang Digunakan● Service control (kendali terhadap layanan)
● berdasarkan tipe-tipe layanan yang digunakan di Internet dan boleh diakses baik untuk kedalam ataupun keluar firewall. Biasanya firewall akan mencek no IP Address dan juga nomor port yang di j g p y ggunakan baik pada protokol TCP dan UDP, bahkan bisa dilengkapi software untuk proxy yang akan menerima dan menterjemahkan setiap permintaan akan suatu layanan sebelum mengijinkannya.Bahkan bisa jadi software pada server itu sendiri , seperti layanan untuk web ataupun untuk mailseperti layanan untuk web ataupun untuk mail.
● Direction Control (kendali terhadap arah)● berdasarkan arah dari berbagai permintaan (request) terhadap
layanan yang akan dikenali dan diijinkan melewati firewall.● User control (kendali terhadap pengguna)
● berdasarkan pengguna/user untuk dapat menjalankan suatu layanan, artinya ada user yang dapat dan ada yang tidak dapat menjalankan suatu servis,hal ini di karenakan user tersebut tidak di iji k k l i fi ll Bi di k kijinkan untuk melewati firewall. Biasanya digunakan untuk membatasi user dari jaringan lokal untuk mengakses keluar, tetapi bisa juga diterapkan untuk membatasi terhadap pengguna dari luar.
● Behavior Control (kendali terhadap perlakuan)● berdasarkan seberapa banyak layanan itu telah digunakan. Misal,
firewall dapat memfilter email untuk menanggulangi/mencegah spam. 6
Tipe FirewallTipe Firewall
● Rule Based● Rule Based● Packet Filtering
St ti● Static● Stateful
● Application Level
7
Rules Based FirewallRules Based Firewall● Firewalls rules are created to match policy p y● Rules are based on:
● Routing based filters (Who – siapa)● Sender and Destination● berasal dari mana ?● Mau ke mana ?● Tidak peduli mau ngapain di sana
● Content based filters (What – mau apa)● TCP/IP Port numbers and Services● TCP/IP Port numbers and Services ● Apa yang akan kamu lakukan di sana ?● Tidak semudah yang nomer 1, sebab kadang-kadang
bisa ditipu seorang clientp g
8
Dua pendekatan aturanDua pendekatan aturan
● Default allow● Default allow● Mengijinkan semua lewat kecuali yang
terdaftarterdaftar● Place roadblocks/watch gates along a wide
open road.open road.● Default deny
● Semua dilarang lewat kecuali yang● Semua dilarang lewat kecuali yang terdaftar
● Build a wall and carve paths for everyone● Build a wall and carve paths for everyone you like. 9
Packet FilteringPacket Filtering● Packet Filtering diaplikasikan dengan cara mengatur
k t IP b ik j l ti tsemua packet IP baik yang menuju, melewati atau akan dituju oleh packet tersebut.
● pada tipe ini packet tersebut akan diatur apakah k di t i d dit k t di t l kakan di terima dan diteruskan , atau di tolak.
● penyaringan packet ini di konfigurasikan untuk menyaring packet yang akan di transfer secara dua arah (baik dari atau ke jaringan lokal)arah (baik dari atau ke jaringan lokal).
● Biasa dikenal sebagai packet inspection● Examines IP, TCP, UDP, and ICMP headers and port number
● Static packet inspection ● Stateful inspection
10
Static Packet Filter FirewallStatic Packet Filter FirewallCorporate Network The Internet
IP-H TCP-H Application MessagePermit(Pass)
IP-H UDP-H Application Message
IP H ICMP HDeny
ICMP MessageIP-H ICMP-H(Drop) ICMP Message
Only IP, TCP, UDP and ICMPHeaders Examined
LogFile
StaticPacketFilter
Fi llFirewall11
Static Packet Filter FirewallStatic Packet Filter FirewallCorporate Network The Internet
IP-H TCP-H Application MessagePermit(Pass)
IP-H UDP-H Application Message
IP H ICMP HDeny
ICMP MessageIP-H ICMP-H(Drop) ICMP Message
Arriving PacketsExamined One at a Time, in Isolation;
This Misses Many Arracks
LogFile
StaticPacketFilter
Fi llFirewall12
Stateful Inspection FirewallsNewStateful Inspection Firewalls
● Default Behavior● Default Behavior● Permit connections initiated by an internal host● Deny connections initiated by an external hosty y● Can change default behavior with ACL
Automatically Accept Connection Attempt
InternetRouter
A tomaticall Den Connection AttemptAutomatically Deny Connection Attempt13
Stateful Inspection FirewallsStateful Inspection Firewalls
● State of Connection: Open or Closed● State of Connection: Open or Closed
● State: Order of packet within a dialog
● Often simply whether the packet is part of an open connectionan open connection
14
Stateful Inspection FirewallsStateful Inspection Firewalls
● Stateful Firewall Operation
● If accept a connection● If accept a connection…
● Record the two IP addresses and port numbers in state table as OK (open)state table as OK (open)
● Accept future packets between these hosts and ports with no further inspectionports with no further inspection● This can miss some attacks, but it catches almost
everything except attacks based on application message content
15
Stateful Inspection Firewall O ti IOperation I
2.Establish
1.TCP SYN Segment
From: 60.55.33.12:62600
EstablishConnection 3.
TCP SYN SegmentFrom: 60.55.33.12:62600
Internal
To: 123.80.5.34:80 To: 123.80.5.34:80
Stateful Note: OutgoingConnections External
Webserver123.80.5.34
InternalClient PC
60.55.33.12Firewall
Connection Table
ConnectionsAllowed By
Default
Type InternalIP
InternalPort
ExternalIP
ExternalPort Status
Connection Table
TCP 60.55.33.12 62600 123.80.5.34 80 OK16
Stateful Inspection Firewall O ti IOperation I
Stateful Firewall
Internal 6. 4.
Stateful Firewall
ExternalWebserver123.80.5.34
InternalClient PC
60.55.33.12
TCP SYN/ACK SegmentFrom: 123.80.5.34:80To: 60.55.33.12:62600 5.
TCP SYN/ACK SegmentFrom: 123.80.5.34:80To: 60.55.33.12:626005.
Check ConnectionOK;
Pass the PacketConnection Table
Type InternalIP
InternalPort
ExternalIP
ExternalPort Status
Connection Table
TCP 60.55.33.12 62600 123.80.5.34 80 OK17
Stateful Inspection FirewallsStateful Inspection Firewalls
● Stateful Firewall Operation
● For UDP also record two IP addresses and● For UDP, also record two IP addresses and port numbers in the state table
C ti T bl
Type InternalIP
InternalPort
ExternalIP
ExternalPort Status
Connection Table
TCP
UDP
60.55.33.12
60.55.33.12
62600
63206
123.80.5.34
1.8.33.4
80
69
OK
OK
18
PACKET FILTERING Contohnya: packet bertujuan ke server kita menggunakan IP 202.159.121.38 dengan port 80 (atribut yang dimiliki paket tsb)
A bb i t d k tAn abbreviated packet…Source SrcPort Destination DestPort204.210.251.1 8104 128.146.2.205 31337
A Cisco packet filterA Cisco packet filter access-list 2640 deny any 128.146.2.0 0.0.0.255 gt 1023
19
Packet Filtering Example (1)Packet Filtering Example (1)1. If source IP address = 10.*.*.*, DENY [private IP address range]2 If IP dd 172 16 * * 172 31 * * DENY [ i t IP2. If source IP address = 172.16.*.* to 172.31.*.*, DENY [private IP
address range]3. If source IP address = 192.168.*.*, DENY [private IP address
range]g ]4. If source IP address = 60.40.*.*, DENY [firm’s internal address
range]
5 If source IP address = 1 2 3 4 DENY [black-holed address of5. If source IP address 1.2.3.4, DENY [black holed address of attacker]
6. If TCP SYN=1 AND FIN=1, DENY [crafted attack packet]
7. If destination IP address = 60.47.3.9 AND TCP destination port=80 OR 443, PASS [connection to a public webserver]
8 If TCP SYN=1 AND ACK=0 DENY [attempt to open a8. If TCP SYN 1 AND ACK 0, DENY [attempt to open a connection from the outside]
20
Packet Filtering Example (1…)Packet Filtering Example (1…)9. If TCP destination port = 20, DENY [FTP data connection]10 If TCP d i i 21 DENY [FTP i t l10. If TCP destination port = 21, DENY [FTP supervisory control
connection]11. If TCP destination port = 23, DENY [Telnet data connection]12 If TCP destination port = 135 through 139 DENY [NetBIOS12. If TCP destination port = 135 through 139, DENY [NetBIOS
connection for clients]13. If TCP destination port = 513, DENY [UNIX rlogin without
password]14 If TCP d ti ti t 514 DENY [UNIX h l h h ll14. If TCP destination port = 514, DENY [UNIX rsh launch shell
without login]15. If TCP destination port = 22, DENY [SSH for secure login, but
some versions are insecure]]16. If UDP destination port=69, DENY [Trivial File Transfer
Protocol; no login necessary]17. If ICMP Type = 0, PASS [allow incoming echo reply
messages]messages]DENY ALL 21
Packet Filtering Example (1…)Packet Filtering Example (1…)
● DENY ALL● DENY ALL● Last rule
● Drops any packets not specifically permitted by earlier rules
● In the previous ACL, Rules 8-17 are not needed; Deny all would catch themy
22
Packet Filtering Example (2)Packet Filtering Example (2)1. If source IP address = 10.*.*.*, DENY [private IP address range]2. If source IP address = 172.16.*.* to 172.31.*.*, DENY [private IP
address range]3. If source IP address = 192.168.*.*, DENY [private IP address , [p
range]4. If source IP address NOT = 60.47.*.*, DENY [not in internal
address range]g ]Rules 1-3 are not needed because of this rule
5. If ICMP Type = 8, PASS [allow outgoing echo messages]
6. If Protocol=ICMP, DENY [drop all other outgoing ICMP messages]
7. If TCP RST=1, DENY [do not allow outgoing resets; used in host scanning] 23
Packet Filtering Example (2)Packet Filtering Example (2)8. If source IP address = 60.47.3.9 and TCP source port = 80
OR 443, PERMIT [public webserver responses]Needed because next rule stops all packets from well-known port
numbers9. If TCP source port=0 through 49151, DENY [well-known and
registered ports]10. If UDP source port=0 through 49151, DENY [well-known and
registered ports]11. If TCP source port =49152 through 65,536, PASS [allow
outgoing client connections]12. If UDP source port = 49152 through 65,536, PERMIT [allow p g [
outgoing client connections]Note: Rules 9-12 only work if all hosts follow IETF rules for port
assignments (well-known, registered, and ephemeral). Windows computers do. Unix computers do not
13. DENY ALLNo need for Rules 9-12
24
Packet FilteringPacket Filtering● Kelebihan dari tipe ini adalah mudah untuk di p
implementasikan, transparan untuk pemakai, lebih cepat
● Kelemahannya :● Kelemahannya :● Cukup rumitnya untuk menyetting paket yang
akan difilter secara tepat, serta lemah dalam hal authentikasiauthentikasi
● Mudah terjadi miskonfigurasi● Sukar melakukan konfigurasi terhadap protokol
yang dinamisyang dinamis● Tidak dapat menangani content-based filtering
(remove e-mail attachments, javascript, ActiveX)
25
Packet FilteringPacket Filtering● Serangan yang mungkin terjadi
● IP address spoofing : ● intruder (penyusup) dari luar dapat melakukan ini dengan cara
menyertakan/menggunakan ip address jaringan lokal yanbg telah diijinkan untuk melalui firewall. j
● Source routing attacks : ● tipe ini tidak menganalisa informasi routing sumber IP,
sehingga memungkinkan untuk membypass firewall.● Tiny Fragment attacks :● Tiny Fragment attacks :
● intruder (penyusup) membagi IP kedalam bagian bagian (fragment) yang lebih kecil dan memaksa terbaginya informasi mengenai TCP header. Serangan jenis ini di design untuk menipu aturan penyaringan yang bergantung kepadamenipu aturan penyaringan yang bergantung kepada informasi dari TCP header. penyerang berharap hanya bagian (fragment) pertama saja yang akan di periksa dan sisanya akan bisa lewat dengan bebas. Hal ini dapat di tanggulangi dengan cara menolak semua packet dengan protokol TCP d iliki Off 1 d IP f (b i IP)dan memiliki Offset = 1 pada IP fragment (bagian IP)
26
Aplication Level Gateway (Proxy Fi ll)Firewall)
Mekanismenya tidak hanya berdasarkan y ysumber, tujuan dan atribut paket, tetapi juga bisa mencapai isi paket tersebut
27
Application LevelApplication Level● Application-level Gateway yang biasa juga di kenal sebagai
proxy server yang berfungsi untuk memperkuat/menyalurkanproxy server yang berfungsi untuk memperkuat/menyalurkan arus aplikasi. Tipe ini akan mengatur semua hubungan yang menggunakan layer aplikasi ,baik itu FTP, HTTP, GOPHER dll.
● Cara kerjanya adalah apabila ada pengguna yang k l h t lik i i l FTP t kmenggunakan salah satu aplikasi semisal FTP untuk
mengakses secara remote, maka gateway akan meminta user memasukkan alamat remote host yang akan di akses.Saat pengguna mengirimkan USer ID serta informasi lainnya yang
i k t k l k k h b t h dsesuai maka gateway akan melakukan hubungan terhadap aplikasi tersebut yang terdapat pada remote host, dan menyalurkan data diantara kedua titik. apabila data tersebut tidak sesuai maka firewall tidak akan meneruskan data t b t t l k L bih j h l i d ti i itersebut atau menolaknya. Lebih jauh lagi, pada tipe ini Firewall dapat di konfigurasikan untuk hanya mendukung beberapa aplikasi saja dan menolak aplikasi lainnya untuk melewati firewall.
● Biasa dikenal Application Inspection● Examines application layer messages 28
Application LevelApplication Level ● Kelebihannya :
● Relatif lebih aman daripada tipe packet filtering router lebih mudah untuk memeriksa (audit) danRelatif lebih aman daripada tipe packet filtering router lebih mudah untuk memeriksa (audit) dan mendata (log) semua aliran data yang masuk pada level aplikasi.
● Tidak mengijinkan langsung koneksi antara internal dan eksternal host● Can support authentication, ‘classes’ of users● Can allow/deny access based on content● Can keep very detailed logs of activity (including the data portions of packets)
C hi● Caching● Kekurangannya
● pemrosesan tambahan yang berlebih pada setiap hubungan. yang akan mengakibatkan terdapat dua buah sambungan koneksi antara pemakai dan gateway, dimana gateway akan memeriksa dan meneruskan semua arus dari dua arah.
● Lebih lambat daripada packet filtering firewallp p g● Require additional hardware
● more hardware for more users ● slow hardware = slow service
● Some firewalls require special client configurations on the workstations.● Some protocols may not be supported (AIM RealAudio Napster H 323) Varies● Some protocols may not be supported (AIM, RealAudio, Napster, H.323) Varies
by vendor.● Configuration can be complex
● Must configure proxy for each protocol
29
A hit t Fi llArchitecture Firewall
Home Firewall ArchitectureHome Firewall ArchitecturePC
Fi ll
Internet
Firewall
Always-OnConnection
InternetService Provider
Home PC
BroadbandModem
UTPCord
CoaxialCable
Home PC
Windows XP has an internal firewall
Originally called the Internet Connection FirewallDisabled by default
After Ser ice Pack 2 called the Windo s Fire all
New
After Service Pack 2 called the Windows FirewallEnabled by default 31
SOHO Firewall Router A hit tArchitecture
I t t S i P idEthernet Switch
Internet Service Provider
User PCUTP
UTP
Broadband Modem (DSL or
SOHORouter
UTP
(DSL orCable)
---Router
DHCP Sever,NAT Firewall and
User PC
NAT Firewall, andLimited Application Firewall
User PCMan Access Ro ters Combine the Ro terMany Access Routers Combine the Router and Ethernet Switch in a Single Box 32
Firewall Architecture for a L Fi ith Si l SitLarger Firm with a Single Site
1. Screening Router 60 47 1 1 Last
Internet
60.47.1.1 Last Rule=Permit All
172 18 9 S b t172.18.9.x Subnet
Public W b
External DNS SWebserver
60.47.3.9DNS Server
60.47.3.4
Marketing Client on
Accounting Server on
SMTP Relay
HTTPProxyClient on
172.18.5.x Subnet
Server on 172.18.7.x
Subnet
e ayProxy
60.47.3.10
Proxy Server
60.47.3.1 33
Setting FirewallSetting Firewall
● Using the “DMZ” (DeMilitarized zone) to● Using the DMZ (DeMilitarized zone) to your advantageFirewalls as Intrusion Detection devices● Firewalls as Intrusion Detection devices
● Configure VPN’s for management
34
DMZ ConfigurationDMZ Configuration● Separate area off the firewallp● Different network segments may have different
policies● Departments● Departments● Service areas● Public Services● Internal Services● Internal Services
● Usually a different subnet● Commonly used to house Internet facing machines
(i.e. Web Servers)● Has its own firewall policy● Has its own firewall policy
35
DMZ ConfigurationDMZ Configuration● Place web servers in the “DMZ” network● Only allow web ports (TCP ports 80 and 443)
internet
Firewall
Web Server36
DMZ ConfigurationDMZ Configuration● Don’t allow web servers access to your network
All l l k b (SSH)● Allow local network to manage web servers (SSH)● Don’t allow servers to connect to the Internet● Patching is not convenient
Mas ..yang
internet
Mas ..yang merah gak boleh lewat
lho
Firewall
Web Server37
DMZ ConfigurationDMZ Configuration
J i L k l I t tJaringan Lokal:• Semua boleh menghubungi web-server (port 80/443
Internet:• Semua boleh menghubungi web-server (port 80/443
Firewall
(p• PC-PC tertentu boleh menghubungi server lewat SSH (port 22)
• Server tidak boleh
(p• Selain layanan web tidak diperkenankan
• Server tidak boleh jalan jalan di internet• Server tidak boleh
menghubungi jaringan lokal
jalan-jalan di internet
Web Server
38
Firewall sebagai IDSFirewall sebagai IDS
● IDS = Intrusion Detection System● IDS = Intrusion Detection System● Collect log information from the deny
rulesrules● Find Portscanning, hacking attempts,
tetc…● Isolate traffic with deny rules helps cut
down the information overload
39
Firewall sebagai IDSFirewall sebagai IDS
● What to do with ALL that data Graph● What to do with ALL that data…..Graph It!Shows trends what people are looking● Shows trends, what people are looking for
H l i iti it t k● Helps prioritize security tasks● Occasionally you may want to block
portscans
40
Firewall sebagai IDSFirewall sebagai IDS
● Pay close attention to traffic leaving● Pay close attention to traffic leaving DMZOften the first sign of a compromise● Often the first sign of a compromise
● Low traffic rules, so logs aren’t as enormous
● Email is nice, provided you’re the only one reading it
41
VPNVPN
● VPN = Virtual Private Network● VPN = Virtual Private Network● VPN is far more secure than other
management methods:management methods:● SSL and SSH are vulnerable to Man-In-
The Middle AttacksThe Middle Attacks● Telnet and SNMP are clear text
Th k MIM tt k i t● There are no known MIM attacks against IPSEC (Yet)
42
VPNVPN
● VPN clients are supported on most● VPN clients are supported on most platformsMost firewalls will work with most clients● Most firewalls will work with most clients
● Netscreen now officially supports F SFreeSwan
● Mac OS X is now supporting VPN
43