Anda di halaman 1dari 43

Firewall

Pengertian Firewall
• Firewall adalah sebuah software atau hardware atau
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
bahkan menolak suatu hubungan/kegiatan (dari luar
kedalam atau dari dalam ke luar) suatu segmen pada
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.

2
Konsep Firewall

● Tujuan untuk melindungi, dengan :


● Menyaring hubungan /kegiatan suatu segmen pada
● membatasi jaringan pribadi dengan jaringan luar yang
● menolak bukan merupakan ruang lingkupnya
● Segmen tersebut dapat merupakan sebuah
workstation, server, router, atau local area network
(LAN) anda

3
Konfigurasi Sederhana
pc (jaringan local) <==> firewall <==> internet (jaringan lain)

Boleh lewat
mbak ? Nih surat-
suratnya Anak kecil ga boleh
keluar.. sudah
malam

Firewall

4
Karakteristik Firewall
● Seluruh hubungan/kegiatan dari dalam ke luar ,
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
yang memungkinkan.
● Hanya Kegiatan yang terdaftar/dikenal yang dapat
melewati/melakukan hubungan,
● hal ini dapat dilakukan dengan mengatur policy pada
konfigurasi keamanan lokal. Banyak sekali jenis firewall
yang dapat dipilih sekaligus berbagai jenis policy yang
ditawarkan.
● Firewall itu sendiri haruslah kebal atau relatif kuat
terhadap serangan/kelemahan.
● hal ini berarti penggunaan sistem yang dapat dipercaya dan
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 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.
● 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
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, 6
firewall dapat memfilter email untuk menanggulangi/mencegah
spam.
Tipe Firewall
● Rule Based
● Packet Filtering
● Static
● Stateful

● Application Level

7
Rules Based Firewall
● Firewalls rules are created to match policy
● 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
● Apa yang akan kamu lakukan di sana ?
● Tidak semudah yang nomer 1, sebab kadang-kadang
bisa ditipu seorang client

8
Dua pendekatan aturan
● Default allow
● Mengijinkan semua lewat kecuali yang
terdaftar
● Place roadblocks/watch gates along a wide
open road.
● Default deny
● Semua dilarang lewat kecuali yang
terdaftar
● Build a wall and carve paths for
you like.
everyone 9
Packet Filtering
● Packet Filtering diaplikasikan dengan cara mengatur
semua packet IP baik yang menuju, melewati
atau akan dituju oleh packet tersebut.
● pada tipe ini packet tersebut akan diatur
apakah 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).
● Biasa dikenal sebagai packet inspection
● Examines IP, TCP, UDP, and ICMP headers and port number
● Static packet inspection
● Stateful inspection

10
Static Packet Filter Firewall
Corporate Network The Internet

Permit IP-H TCP- Application Message


H
(Pass)
IP-H UDP-H Application
Message
Deny
(Drop) IP-H
ICMP-H ICMP Message

Log Static Only IP, TCP, UDP and ICMP


Packet Headers Examined
File Filter
Firewall
11
Static Packet Filter Firewall
Corporate Network The Internet

Permit IP-H TCP- Application Message


H
(Pass)
IP-H UDP-H Application
Message
Deny
(Drop) IP-H
ICMP-H ICMP Message

Static Arriving Packets


Log
Packet Examined One at a Time, in Isolation;
Filter This Misses Many
File
Firewall Arracks
12
Stateful Inspection
Firewall s N ew
● Default Behavior
● Permit connections initiated by an internal host
● Deny connections initiated by an external host
● Can change default behavior with ACL

Automatically Accept Connection Attempt

Router Internet

Automatically Deny Connection Attempt


13
Stateful Inspection Firewalls
● State of Connection: Open or Closed
● State: Order of packet within a dialog
● Often simply whether the packet is part of
an open connection

14
Stateful Inspection Firewalls

● Stateful Firewall Operation


● If accept a connection…
● Record the two IP addresses and port numbers in
state table as OK (open)
● Accept future packets between these hosts and
ports 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
Operation I
2.
Establis
1. Connection
h 3.
TCP SYN TCP SYN
From: 60.55.33.12:62600
Segment From: 60.55.33.12:62600
Segment
To: 123.80.5.34:80 To: 123.80.5.34:80

Note: Outgoing
Internal Stateful
Connections
Client PC External
Allowed By
60.55.33.12 Firewall Webserver
Default
123.80.5.34
Connection Table
Internal Internal External External
Typ Status
IP Port IP Port
e
TCP 60.55.33.12 62600 123.80.5.34 80 OK
16
Stateful Inspection Firewall
Operation I
Stateful Firewal

6. 4.
Internal
TCP SYN/ACK Segment
Client PC TCP SYN/ACK Segment External
From: 123.80.5.34:80
60.55.33.12
To: 60.55.33.12:62600 From: 123.80.5.34:80 Webserver
5.
To: 60.55.33.12:62600123.80.5.34
Check Connection
OK;
Connection Table Pass the Packet

Internal Internal External External


Typ Status
IP Port IP Port
e
TCP 60.55.33.12 62600 123.80.5.34 80 OK
17
Stateful Inspection Firewalls

● Stateful Firewall Operation


● For UDP, also record two IP addresses and
port numbers in the state table
Connection Table
Internal Internal External IP External
Typ Status
Port IP Port
e
TCP 60.55.33.12 62600 80 OK
123.80.5.34
UDP 60.55.33.12 63206 1.8.33.4 69 OK

18
PACKET FILTERING
Contohnya: packet bertujuan ke server kita menggunakan IP 202.159.121.38 dengan port 80
(atribut yang dimiliki paket tsb)

An abbreviated packet…
Source SrcPort Destination DestPort
204.210.251.1 8104 128.146.2.205 31337
A Cisco packet filter
access-list 2640 deny any 128.146.2.0
0.0.0.255 gt 1023

19
Packet Filtering Example (1)
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
range]
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
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
connection from the outside] 20
Packet Filtering Example (1…)
9. If TCP destination port = 20, DENY [FTP data connection]
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
connection for clients]
13.If TCP destination port = 513, DENY [UNIX rlogin without
password]
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]
DENY ALL 21
Packet Filtering Example (1…)
● 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 them

22
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
range]
4. If source IP address NOT = 60.47.*.*, DENY [not in internal
address range]
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;


23
scanning]
used in host
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 [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
13. DENY ALL 24
No need for Rules 9-12
Packet Filtering

Kelebihan dari tipe ini adalah mudah untuk
di implementasikan, transparan untuk
pemakai, lebih cepat
● Kelemahannya :
● Cukup rumitnya untuk menyetting paket yang
akan difilter secara tepat, serta lemah dalam hal
authentikasi
● Mudah terjadi miskonfigurasi
● Sukar melakukan konfigurasi terhadap protokol
yang dinamis
● Tidak dapat menangani content-based filtering
(remove e-mail attachments, javascript, ActiveX)

25
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.
● Source routing attacks :
● tipe ini tidak menganalisa informasi routing
sumber IP, sehingga memungkinkan untuk
membypass firewall.
● 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
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 dan memiliki Offset = 1
pada IP fragment (bagian IP) 26
Aplication Level Gateway (Proxy
Firewall)
Mekanismenya tidak hanya berdasarkan
sumber, tujuan dan atribut paket, tetapi juga
bisa mencapai isi paket tersebut
Application Level
● Application-level Gateway yang biasa juga di kenal sebagai
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
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 sesuai maka gateway akan melakukan hubungan
terhadap aplikasi tersebut yang terdapat pada remote host,
dan menyalurkandata diantara kedua titik. apabila data
tersebut tidak sesuai maka firewall tidak
akan meneruskan data 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.
● Biasa dikenalapplication
● Examines Application Inspection
layer messages 28
Application Level
● Kelebihannya :
● Relatif 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)
● 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 firewall
● 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
by vendor.
● Configuration can be complex
● Must configure proxy for each protocol

29
Architecture Firewall
Home Firewall Architecture
PC
Firewall
Always-On
Internet
Connection
Service Provider UTP
Coaxial Broadband
Cable Cord
Modem Home PC

Windows XP has an internal firewall


New
Originally called the Internet Connection Firewall
Disabled by default
After Service Pack 2 called the Windows Firewall
Enabled by default 31
SOHO Firewall Router
Architecture
Internet Service Provider
Ethernet Switch UTP
UTP User PC
UTP
Broadband SOHO
Modem Router
(DSL or ---
Cable) Router User PC
DHCP Sever,
NAT Firewall, and
Limited
Application
User PC
Many AccessFirewall
Routers Combine the Router
and Ethernet Switch in a Single Box 32
Firewall Architecture for a
Larger Firm with a Single Site
1. Screening Router
60.47.1.1 Last
Rule=Permit All
I
n
t
e
Public r External
Webserver DNS
n Server
60.47.3.9 e60.47.3.4
t
172.18.9.x Subnet

Marketing Accounting SMTP HTTP


Client on Server on Relay Proxy
172.18.5.x 172.18.7.x Proxy Server
Subnet Subnet 60.47.3.10 60.47.3.1 33
Setting Firewall
● Using the “DMZ” (DeMilitarized zone) to
your advantage
● Firewalls as Intrusion Detection devices
● Configure VPN’s for management

34
DMZ Configuration
● Separate area off the firewall
● Different network segments may have different
policies
● Departments
● Service areas
● Public Services
● Internal Services

● Usually a different subnet


● Commonly used to house Internet facing machines
(i.e. Web Servers)
● Has its own firewall policy
35
DMZ Configuration
● Place web servers in the “DMZ” network
● Only allow web ports (TCP ports 80 and 443)

Firewall

Web Server
36
DMZ Configuration
● Don’t allow web servers access to your network
● Allow local network to manage web servers (SSH)
● Don’t allow servers to connect to the Internet
● Patching is not convenient
Mas ..yang
merah gak
boleh lewat
lho

Firewall

Web Server
37
DMZ Configuration
Jaringan Lokal: Internet:
• Semua boleh • Semua boleh
menghubungi web- menghubungi web-
server (port 80/443 server (port 80/443
• PC-PC tertentu boleh • Selain layanan web
Firewall
menghubungi server tidak diperkenankan
lewat SSH (port 22) • Server tidak boleh
• Server tidak boleh jalan-jalan di internet
menghubungi
jaringan lokal

Web Server

38
Firewall sebagai IDS
● IDS = Intrusion Detection System
● Collect log information from the deny
rules
● Find Portscanning, hacking attempts,
etc…
● Isolate traffic with deny rules helps cut
down the information overload

39
Firewall sebagai IDS
● What to do with ALL that data…..Graph
It!
● Shows trends, what people are looking
for
● Helps prioritize security tasks
● Occasionally you may want to block
portscans

40
Firewall sebagai IDS
● Pay close attention to traffic leaving
DMZ
● 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
VPN
● VPN = Virtual Private Network
● VPN is far more secure than other
management methods:
● SSL and SSH are vulnerable to Man-In-
The Middle Attacks
● Telnet and SNMP are clear text
● There are no known MIM attacks against
IPSEC (Yet)

42
VPN
● VPN clients are supported on most
platforms
● Most firewalls will work with most
clients
● Netscreen now officially supports
FreeSwan
● Mac OS X is now supporting
VPN
43

Anda mungkin juga menyukai