Fi
ll
Firewall
Pengertian Firewall
•
Firewall adalah sebuah software atau hardware atau
kombinasi keduanya maupun sistem itu sendiri untuk
kombinasi 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 atau
melindungi, baik dengan menyaring, membatasi atau
bahkan menolak suatu hubungan/kegiatan (dari luar
dari luar
kedalam atau dari dalam ke luar
kedalam atau dari dalam ke luar) suatu segmen pada
jaringan pribadi dengan jaringan l ar ang b kan
jaringan 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.
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
Konfigurasi Sederhana
Konfigurasi Sederhana
pc (jaringan local) <==> firewall <==> internet (jaringan lain)
p (j
g
)
(j
g
)
Boleh lewat mbak ? Nih surat-suratnya
Anak kecil ga boleh keluar.. sudah malam keluar.. sudah malam
Karakteristik Firewall
Karakteristik Firewall
●
Seluruh hubungan/kegiatan dari dalam ke luar ,
h
l
ti fi
ll
harus melewati firewall.
● Hal ini dapat dilakukan dengan cara memblok/membatasi baik secara fisik semua akses terhadap jaringan Lokal, kecuali melewati firewall Banyak sekali bentuk jaringan kecuali 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.
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 g gunakan 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 mail
seperti 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 k
ijinkan 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,
Tipe Firewall
Tipe Firewall
●
Rule Based
●
Rule Based
●
Packet Filtering
St ti
●
Static
●
Stateful
●
Application Level
Rules Based Firewall
Rules 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
Dua pendekatan aturan
Dua pendekatan aturan
●
Default allow
●
Default allow
●
Mengijinkan semua lewat kecuali yang
terdaftar
terdaftar
●
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
Packet Filtering
Packet Filtering
●
Packet Filtering diaplikasikan dengan cara mengatur
k t IP b ik
j
l
ti t
semua 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 k
akan 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
Static Packet Filter Firewall
Static Packet Filter Firewall
Corporate Network The Internet
IP-H TCP-H Application Message
Permit (Pass)
IP-H UDP-H Application Message
IP H ICMP H
Deny
ICMP Message
IP-H ICMP-H
(Drop) ICMP Message
Only IP, TCP, UDP and ICMP Headers Examined Log File Static Packet Filter Fi ll Firewall
Static Packet Filter Firewall
Static Packet Filter Firewall
Corporate Network The Internet
IP-H TCP-H Application Message
Permit (Pass)
IP-H UDP-H Application Message
IP H ICMP H
Deny
ICMP Message
IP-H ICMP-H
(Drop) ICMP Message
Arriving Packets
Examined One at a Time, in Isolation; This Misses Many Arracks
Log File Static Packet Filter Fi ll Firewall
Stateful Inspection Firewalls
NewStateful Inspection Firewalls
●Default Behavior
●
Default Behavior
●
Permit connections initiated by an internal host
●Deny connections initiated by an external host
y
y
●Can change default behavior with ACL
Automatically Accept Connection Attempt
Internet Router
A tomaticall Den Connection Attempt Automatically Deny Connection Attempt
Stateful Inspection Firewalls
Stateful 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 connection
an open connection
Stateful Inspection Firewalls
Stateful 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 inspection
ports with no further inspection
● This can miss some attacks, but it catches almost
everything except attacks based on application message content
Stateful Inspection Firewall
O
ti
I
Operation I
2. Establish 1. TCP SYN Segment From: 60.55.33.12:62600 Establish Connection 3. TCP SYN Segment From: 60.55.33.12:62600 Internal To: 123.80.5.34:80 To: 123.80.5.34:80 Stateful Note: Outgoing Connections External Webserver 123.80.5.34 Internal Client PC 60.55.33.12 Firewall Connection Table Connections Allowed By Default Type Internal IP Internal Port External IP External Port Status Connection Table TCP 60.55.33.12 62600 123.80.5.34 80 OKStateful Inspection Firewall
O
ti
I
Operation I
Stateful Firewall Internal 6. 4. Stateful Firewall External Webserver 123.80.5.34 Internal Client PC 60.55.33.12 TCP SYN/ACK Segment From: 123.80.5.34:80 To: 60.55.33.12:62600 5. TCP SYN/ACK Segment From: 123.80.5.34:80 To: 60.55.33.12:62600 5. Check Connection OK;Pass the Packet Connection Table Type Internal IP Internal Port External IP External Port Status Connection Table TCP 60.55.33.12 62600 123.80.5.34 80 OK
Stateful Inspection Firewalls
Stateful 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 Internal IP Internal Port External IP External Port 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
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 t An abbreviated packet…
Source SrcPort Destination DestPort 204.210.251.1 8104 128.146.2.205 31337
A Cisco packet filter A Cisco packet filter
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 IP
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 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 of 5. 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 a
8. If TCP SYN 1 AND ACK 0, DENY [attempt to open a connection from the outside]
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 l
10. 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 [NetBIOS 12. 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 ll
14. 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]
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
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]
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 numbers
9. 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 p g [allow [ 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
Packet Filtering
Packet 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
authentikasi
authentikasi
●
Mudah terjadi miskonfigurasi
●
Sukar melakukan konfigurasi terhadap protokol
yang dinamis
yang dinamis
●
Tidak dapat menangani
content-based filtering
Packet Filtering
Packet 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 kepada menipu 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)
Aplication Level Gateway (Proxy
Fi
ll)
Firewall)
Mekanismenya tidak hanya berdasarkan
y
y
sumber, tujuan dan atribut paket, tetapi juga
bisa mencapai isi paket tersebut
Application Level
Application Level
● Application-level Gateway yang biasa juga di kenal sebagai proxy server yang berfungsi untuk memperkuat/menyalurkan proxy 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 k
menggunakan 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 d
sesuai 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 i
tersebut 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.
Application Level
Application 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
A
hit
t
Fi
ll
Architecture Firewall
Home Firewall Architecture
Home Firewall Architecture
PC Fi ll Internet Firewall Always-On Connection Internet Service Provider Home PC Broadband Modem UTP Cord Coaxial Cable Home PC Windows XP has an internal firewall
Originally called the Internet Connection Firewall Disabled by default
After Ser ice Pack 2 called the Windo s Fire all
New
SOHO Firewall Router
A
hit
t
Architecture
I t t S i P id
Ethernet Switch Internet Service Provider
User PC UTP UTP Broadband Modem (DSL or SOHO Router UTP (DSL or Cable) Router ---DHCP Sever, NAT Firewall and
User PC NAT Firewall, and
Limited Application Firewall
User PC Man Access Ro ters Combine the Ro ter
Firewall Architecture for a
L
Fi
ith
Si
l Sit
Larger 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 t 172.18.9.x Subnet Public W b External DNS S Webserver 60.47.3.9 DNS Server 60.47.3.4 Marketing Client on Accounting Server on SMTP Relay HTTP Proxy Client on 172.18.5.x Server on 172.18.7.x e ay Proxy Proxy Server
Setting Firewall
Setting Firewall
●
Using the “DMZ” (DeMilitarized zone) to
●
Using the DMZ (DeMilitarized zone) to
your advantage
Firewalls as Intrusion Detection devices
●
Firewalls as Intrusion Detection devices
DMZ Configuration
DMZ Configuration
●Separate area off the firewall
p
●
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
DMZ Configuration
DMZ Configuration
●
Place web servers in the “DMZ” network
●
Only allow web ports (TCP ports 80 and 443)
internet Firewall
DMZ Configuration
DMZ 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 Server
DMZ Configuration
DMZ Configuration
J i L k l I t t Jaringan 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