BAB 12 - KEAMANAN JARINGAN
PENGANTAR BAB
Selamat datang di Fase 3 - Keamanan Infrastruktur! Setelah memahami fondasi konseptual di Fase 1 dan 2, kini kita memasuki dunia infrastruktur jaringan - tulang punggung dari seluruh komunikasi digital modern. Bab 12 ini adalah bab paling teknis di fase ini, dan akan menjadi fondasi untuk bab-bab berikutnya tentang keamanan server, website, dan analisis keamanan.
Jaringan komputer adalah medan pertempuran utama dalam Cyber Security. Hampir setiap serangan modern - dari phishing, malware, hingga APT - melibatkan jaringan sebagai vektor atau target. Menurut Verizon DBIR 2024, 39% breach melibatkan eksploitasi jaringan, menjadikannya salah satu vektor serangan paling umum.
Bab ini akan membawa Anda dari konsep dasar network security hingga praktik analisis traffic menggunakan tools profesional seperti Wireshark, tcpdump, dan Nmap. Setelah bab ini, Anda akan memiliki pemahaman mendalam tentang bagaimana jaringan bekerja, bagaimana serangan terjadi, dan bagaimana melindungi infrastruktur jaringan.
Verizon DBIR 2024
ITU 2024
IBM 2023
IBM 2023
- Memahami konsep network security dan CIA Triad dalam konteks jaringan
- Mengidentifikasi berbagai ancaman pada jaringan
- Merancang secure network architecture
- Mengonfigurasi firewall dan network segmentation
- Mengamankan Wi-Fi dengan WPA2/WPA3
- Mengimplementasikan VPN
- Menggunakan IDS/IPS untuk deteksi intrusi
- Memantau jaringan dengan network monitoring tools
- Menganalisis network traffic dengan Wireshark dan tcpdump
KONSEP NETWORK SECURITY
Definisi
"Network security is the protection of networks and their services from unauthorized modification, destruction, or disclosure and the assurance that the network performs its critical functions correctly and there are no harmful side effects."
"Network security is the set of policies, practices, and tools adopted to protect a computer network from intrusion, attack, or other harmful activities."
CIA Triad dalam Konteks Jaringan
| ASPEK CIA | MAKSUD DALAM JARINGAN | CONTOH SERANGAN | KONTROL |
|---|---|---|---|
| Confidentiality | Data hanya bisa dibaca oleh pihak berwenang | Sniffing, MITM | Enkripsi (TLS, VPN, IPsec) |
| Integrity | Data tidak diubah di tengah jalan | Man-in-the-Middle, packet injection | Hash, digital signature, HMAC |
| Availability | Jaringan selalu bisa diakses | DDoS, ransomware | Redundancy, load balancing, DDoS protection |
Layer Keamanan Jaringan
Physical & Data Link
Network & Transport
Session & Presentation
Application
| OSI LAYER | KEAMANAN YANG DITERAPKAN | CONTOH TEKNOLOGI |
|---|---|---|
| Layer 1-2 (Physical/Data Link) | Port security, MAC filtering, 802.1X | Switch port security, WPA3, 802.1X |
| Layer 3-4 (Network/Transport) | Firewall, IPsec, ACL | iptables, Cisco ACL, IPsec VPN |
| Layer 5-6 (Session/Presentation) | SSL/TLS, session management | TLS 1.3, SSL certificates |
| Layer 7 (Application) | WAF, application firewall | ModSecurity, Cloudflare WAF |
Defense in Depth untuk Jaringan
- Internet = dunia luar yang tidak dikenal
- Perimeter firewall = gerbang kota dengan penjaga
- DMZ = area pasar di luar tembok kota (publik tapi terkontrol)
- Internal firewall = tembok dalam kota
- Internal network = area inti kota yang paling aman
- IDS/IPS = patroli polisi yang mengawasi aktivitas mencurigakan
Setiap lapis pertahanan memperlambat attacker. Jika satu lapis jebol, masih ada lapis berikutnya.
- NIST SP 800-53 Rev.5 - Security and Privacy Controls
- ISO/IEC 27033-1 - Network security
- Stallings, W. (2020). Cryptography and Network Security, 8th Ed.
- Kurose, J. & Ross, K. (2021). Computer Networking: A Top-Down Approach, 8th Ed.
ANCAMAN PADA JARINGAN
Memahami ancaman adalah langkah pertama untuk membangun pertahanan. Setiap serangan jaringan mengeksploitasi kelemahan dalam protokol, konfigurasi, atau manusia.
Kategori Ancaman Jaringan
| KATEGORI | DESKRIPSI | MELANGGAR | CONTOH SERANGAN |
|---|---|---|---|
| Interception | Penyadapan data di tengah jalan | Confidentiality | Sniffing, MITM, wiretapping |
| Interruption | Mengganggu ketersediaan layanan | Availability | DDoS, DoS, cable cutting |
| Fabrication | Membuat data palsu | Authenticity | Spoofing, DNS poisoning |
| Modification | Mengubah data di transit | Integrity | Man-in-the-Middle, packet injection |
| Reconnaissance | Pengumpulan informasi target | Confidentiality | Port scanning, OS fingerprinting |
| Exploitation | Memanfaatkan vulnerability | Semua aspek | Buffer overflow, protocol exploit |
Serangan Jaringan Umum
SNIFFING
Menyadap paket data di jaringan
MAN-IN-THE-MIDDLE
Menyisip di tengah komunikasi
DDoS
Banjiri server dengan request
SPOOFING
Memalsukan identitas (IP, MAC, DNS)
ARP POISONING
Manipulasi tabel ARP di LAN
DNS POISONING
Manipulasi cache DNS
VLAN HOPPING
Lompat antar VLAN
EVIL TWIN
Wi-Fi palsu menyerupai yang asli
Praktik: Reconnaissance dengan Nmap
Bash - Nmap Network Scanning # 1. Ping scan - cek host yang hidup $ nmap -sn 192.168.1.0/24 # 2. Port scan standar $ nmap 192.168.1.1 # 3. Service version detection $ nmap -sV 192.168.1.1 # 4. OS detection $ nmap -O 192.168.1.1 # 5. Aggressive scan (OS + version + scripts + traceroute) $ nmap -A 192.168.1.1 # 6. Stealth scan (SYN scan) $ sudo nmap -sS 192.168.1.1 # 7. UDP scan $ sudo nmap -sU 192.168.1.1 # 8. Scan semua port $ nmap -p- 192.168.1.1 # 9. Vulnerability scan dengan NSE scripts $ nmap --script vuln 192.168.1.1 # 10. Output ke file $ nmap -oN scan.txt -oX scan.xml 192.168.1.0/24
Tahun 2017, malware NotPetya menyebar melalui update software akuntansi Ukraina yang terinfeksi. Maersk (perusahaan logistik terbesar dunia) terkena dampaknya - 45.000 PC dan 4.000 server terinfeksi dalam hitungan jam. Seluruh operasi global lumpuh selama beberapa hari.
Kerugian: $300 juta. Pelajaran: serangan jaringan bisa melumpuhkan seluruh operasi bisnis.
- Sniffing = menguping percakapan di jalan
- MITM = perantara yang mengubah surat di tengah jalan
- DDoS = macet total di jalan raya
- Spoofing = mobil dengan plat nomor palsu
- ARP poisoning = papan petunjuk jalan yang diubah
- Verizon - DBIR 2024 - Network Attacks Analysis
- MITRE ATT&CK - Network-based Attack Techniques
- NIST SP 800-184 - Guide to Cyber Threat Intelligence
- Lyon, G. (2009). Nmap Network Scanning. Nmap Project.
SECURE NETWORK ARCHITECTURE
Secure network architecture adalah desain jaringan yang mengintegrasikan prinsip keamanan sejak awal. Bukan sekadar menambahkan kontrol keamanan di akhir, tapi security by design.
Prinsip Secure Architecture
- Defense in Depth - banyak lapis pertahanan
- Least Privilege - hak akses minimal yang dibutuhkan
- Segmentation - bagi jaringan jadi zona-zona
- Zero Trust - jangan percaya siapapun, verifikasi selalu
- Fail Secure - gagal ke keadaan aman
- Economy of Mechanism - desain sesederhana mungkin
- Complete Mediation - cek akses setiap saat
- Open Design - keamanan tidak bergantung pada kerahasiaan desain
Arsitektur Jaringan 3-Tier
Zero Trust Architecture
"Zero trust architecture (ZTA) provides a collection of theories, technologies, and strategies that assume that no implicit trust is granted to assets or user identities based solely on their physical or network location."
Prinsip Zero Trust:
- Verify Explicitly - autentikasi & otorisasi berdasarkan semua data point
- Use Least Privilege Access - batasi akses dengan JIT/JEA
- Assume Breach - enkripsi, segmentasi, deteksi real-time
Zero Trust vs Traditional
| ASPEK | TRADITIONAL | ZERO TRUST |
|---|---|---|
| Trust model | Trust internal network | Never trust, always verify |
| Perimeter | Castle-and-moat | Micro-perimeters per resource |
| Access control | Network-based | Identity-based |
| Visibility | Limited | Continuous monitoring |
| Verification | Once at login | Continuous, contextual |
- Traditional = rumah dengan satu pagar - sekali masuk, bebas ke mana saja
- Zero Trust = hotel mewah - harus scan kartu untuk setiap pintu (lobby, kamar, gym, kolam)
- Setiap akses diverifikasi ulang berdasarkan identitas dan konteks
- NIST SP 800-207 - Zero Trust Architecture
- CISA - Zero Trust Maturity Model
- Forrester - Zero Trust eXtended (ZTX) Ecosystem
FIREWALL
Firewall adalah sistem keamanan jaringan yang memfilter trafik berdasarkan aturan yang telah ditentukan. Firewall adalah lini pertahanan pertama dalam arsitektur jaringan aman.
Definisi
"A firewall is a device or group of devices that enforces access control at the boundary between networks, and is designed to block or allow traffic based on predetermined security rules."
Jenis Firewall
| JENIS | LAYER OSI | CARA KERJA | KELEBIHAN | KEKURANGAN |
|---|---|---|---|---|
| Packet Filter | Layer 3-4 | Filter berdasarkan IP, port, protocol | Cepat, ringan | Tidak pahami konteks aplikasi |
| Stateful Inspection | Layer 3-4 | Track state koneksi | Lebih aman dari packet filter | Resource intensive |
| Application Proxy | Layer 7 | Proxy untuk aplikasi spesifik | Deep inspection | Lambat, kompleks |
| Next-Gen Firewall (NGFW) | Layer 2-7 | Combination + IPS + app control | Fitur lengkap | Mahal |
| Web Application Firewall (WAF) | Layer 7 | Filter HTTP/HTTPS | Anti web attacks | Hanya untuk web apps |
Praktik: iptables (Linux)
Bash - iptables Firewall Configuration # 1. Lihat rules yang aktif $ sudo iptables -L -n -v # 2. Flush semua rules $ sudo iptables -F # 3. Set default policy $ sudo iptables -P INPUT DROP $ sudo iptables -P FORWARD DROP $ sudo iptables -P OUTPUT ACCEPT # 4. Allow loopback $ sudo iptables -A INPUT -i lo -j ACCEPT # 5. Allow established connections $ sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # 6. Allow SSH (port 22) $ sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT # 7. Allow HTTP/HTTPS $ sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT $ sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT # 8. Block specific IP $ sudo iptables -A INPUT -s 192.168.1.100 -j DROP # 9. Rate limit SSH (anti brute force) $ sudo iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set $ sudo iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP # 10. Log dropped packets $ sudo iptables -A INPUT -j LOG --log-prefix "IPTABLES DROP: " --log-level 4 # 11. Save rules (Ubuntu/Debian) $ sudo apt install iptables-persistent $ sudo netfilter-persistent save # 12. Save rules (CentOS/RHEL) $ sudo iptables-save > /etc/sysconfig/iptables
Praktik: UFW (Uncomplicated Firewall)
Bash - UFW Simplified Firewall # 1. Install UFW $ sudo apt install ufw # 2. Set default policies $ sudo ufw default deny incoming $ sudo ufw default allow outgoing # 3. Allow SSH (PENTING! sebelum enable) $ sudo ufw allow ssh # 4. Enable firewall $ sudo ufw enable # 5. Cek status $ sudo ufw status verbose # 6. Allow HTTP/HTTPS $ sudo ufw allow http $ sudo ufw allow https # 7. Allow specific port $ sudo ufw allow 8080/tcp # 8. Allow from specific IP $ sudo ufw allow from 192.168.1.100 # 9. Deny specific IP $ sudo ufw deny from 10.0.0.5 # 10. Delete rule $ sudo ufw status numbered $ sudo ufw delete 3 # 11. Reset firewall $ sudo ufw reset # 12. Logging $ sudo ufw logging on $ sudo tail -f /var/log/ufw.log
- Packet filter = satpam cek KTP saja (IP, port)
- Stateful = satpam ingat siapa yang sudah masuk
- NGFW = satpam + CCTV + metal detector + cek isi tas
- Default deny = semua tamu ditolak kecuali yang diizinkan
- Default allow = semua tamu boleh masuk (BAHAYA!)
- NIST SP 800-41 Rev.3 - Guide to Firewalls and Firewall Policy
- Netfilter - iptables Tutorial
- Canonical - UFW Documentation
- Zwick, J. (2020). Linux Firewalls. No Starch Press.
NETWORK SEGMENTATION
Network segmentation adalah praktik membagi jaringan menjadi beberapa segmen/zona yang lebih kecil. Tujuannya: membatasi lateral movement attacker jika berhasil masuk ke satu segmen.
Mengapa Segmentasi Penting?
"Install and maintain a firewall configuration to protect cardholder data" - segmentasi jaringan adalah syarat wajib untuk kepatuhan PCI DSS (standar keamanan kartu kredit).
Jenis Segmentasi
| JENIS | TEKNOLOGI | LAYER | USE CASE |
|---|---|---|---|
| Physical Segmentation | Switch/router terpisah | Layer 1 | High-security environments |
| VLAN | Virtual LAN | Layer 2 | Segmentasi dalam satu switch |
| Subnet | IP subnet | Layer 3 | Segmentasi logis |
| DMZ | Firewall + subnet terpisah | Layer 3 | Public-facing services |
| Microsegmentation | Software-defined | Layer 7 | Zero trust, per-workload |
Praktik: VLAN Configuration (Cisco)
Cisco IOS - VLAN Configuration # 1. Create VLAN Switch(config)# vlan 10 Switch(config-vlan)# name HR_DEPARTMENT Switch(config-vlan)# exit Switch(config)# vlan 20 Switch(config-vlan)# name FINANCE Switch(config-vlan)# exit Switch(config)# vlan 30 Switch(config-vlan)# name IT_DEPARTMENT Switch(config-vlan)# exit # 2. Assign port to VLAN Switch(config)# interface gigabitEthernet 0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 10 Switch(config-if)# exit Switch(config)# interface gigabitEthernet 0/2 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 20 Switch(config-if)# exit # 3. Configure trunk port (antar switch) Switch(config)# interface gigabitEthernet 0/24 Switch(config-if)# switchport mode trunk Switch(config-if)# switchport trunk allowed vlan 10,20,30 Switch(config-if)# exit # 4. Verify VLAN Switch# show vlan brief Switch# show interfaces trunk # 5. Inter-VLAN routing (router-on-a-stick) Router(config)# interface gigabitEthernet 0/0.10 Router(config-subif)# encapsulation dot1Q 10 Router(config-subif)# ip address 192.168.10.1 255.255.255.0 Router(config)# interface gigabitEthernet 0/0.20 Router(config-subif)# encapsulation dot1Q 20 Router(config-subif)# ip address 192.168.20.1 255.255.255.0 # 6. ACL untuk batasi akses antar VLAN Router(config)# access-list 100 permit ip 192.168.10.0 0.0.0.255 192.168.20.0 0.0.0.255 Router(config)# access-list 100 deny ip any any
Praktik: VLAN di Linux (802.1Q)
Bash - Linux VLAN Configuration # 1. Install vlan package $ sudo apt install vlan # 2. Load 8021q module $ sudo modprobe 8021q # 3. Create VLAN interface $ sudo ip link add link eth0 name eth0.10 type vlan id 10 $ sudo ip link add link eth0 name eth0.20 type vlan id 20 # 4. Assign IP address $ sudo ip addr add 192.168.10.1/24 dev eth0.10 $ sudo ip addr add 192.168.20.1/24 dev eth0.20 # 5. Bring up interfaces $ sudo ip link set eth0.10 up $ sudo ip link set eth0.20 up # 6. Enable IP forwarding (untuk routing antar VLAN) $ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward # 7. Verify $ cat /proc/net/vlan/config $ ip -d link show eth0.10 # 8. Persistent configuration (Ubuntu/Debian) # Edit /etc/network/interfaces: # auto eth0.10 # iface eth0.10 inet static # address 192.168.10.1 # netmask 255.255.255.0 # vlan-raw-device eth0
- Switch fisik = gedung kantor
- VLAN = ruangan berbeda (HR, Finance, IT)
- Trunk port = koridor penghubung antar ruangan
- Inter-VLAN routing = pintu antar ruangan dengan akses kontrol
- ACL = siapa yang boleh masuk ruangan mana
Meski satu gedung, setiap departemen punya ruangan sendiri. Orang HR tidak bisa sembarangan masuk ruang Finance.
- IEEE 802.1Q - Virtual LANs Standard
- Cisco - VLAN Configuration Guide
- PCI DSS v4.0 - Requirement 1: Network Security Controls
- NIST SP 800-192 - Network Segmentation Guidelines
KEAMANAN WI-FI
Wi-Fi adalah teknologi jaringan nirkabel yang paling umum digunakan. Namun, sifatnya yang broadcast membuatnya rentan terhadap berbagai serangan. Mengamankan Wi-Fi adalah prioritas utama.
Statistik Wi-Fi Attacks
AVAST 2024
Kaspersky 2024
Aircrack-ng
Ancaman Wi-Fi
EVIL TWIN
AP palsu menyerupai yang asli
KEY CRACKING
Brute force WPA/WPA2 key
DEAUTH ATTACK
Putuskan koneksi client
MITM
Sadap trafik Wi-Fi
ROGUE AP
AP tidak sah di jaringan
WARDRIVING
Scan Wi-Fi dari mobil
Best Practices Wi-Fi Security
- Gunakan WPA3 (atau minimal WPA2-AES)
- Password kuat - minimal 12 karakter, kompleks
- Ubah SSID default - jangan pakai nama router
- Matikan WPS - rentan brute force
- Update firmware router secara berkala
- Matikan remote management
- Gunakan guest network terpisah untuk tamu
- Disable SSID broadcast (opsional, security through obscurity)
- MAC filtering (tambahan, bukan pengganti enkripsi)
- Jangan pakai Wi-Fi publik untuk transaksi sensitif
Praktik: Wi-Fi Security Audit
Bash - Wi-Fi Security Audit (EDUKASI) # PERINGATAN: Hanya untuk jaringan Anda sendiri! # 1. Install aircrack-ng suite $ sudo apt install aircrack-ng # 2. Cek wireless interface $ iwconfig # 3. Put interface in monitor mode $ sudo airmon-ng check kill $ sudo airmon-ng start wlan0 # 4. Scan networks $ sudo airodump-ng wlan0mon # 5. Capture handshake (target specific AP) $ sudo airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w capture wlan0mon # 6. Deauth attack (force client reconnect) $ sudo aireplay-ng --deauth 10 -a AA:BB:CC:DD:EE:FF wlan0mon # 7. Crack WPA2 password $ aircrack-ng -w wordlist.txt capture-01.cap # 8. Stop monitor mode $ sudo airmon-ng stop wlan0mon $ sudo systemctl restart NetworkManager # Tools lain: # - Kismet: wireless network detector # - Wireshark: packet analysis # - Fern WiFi Cracker: GUI-based
- Wi-Fi signal = siaran radio - siapa saja dalam jangkauan bisa dengar
- Enkripsi WPA2/WPA3 = bahasa sandi - hanya yang punya kunci yang paham
- Evil twin = radio palsu yang meniru frekuensi asli
- Deauth attack = ganggu siaran radio asli
- IEEE 802.11i/w - WPA2/WPA3 Standards
- Wi-Fi Alliance - WPA3 Security Specification
- NIST SP 800-153 - Guide to Securing Wi-Fi
- Aircrack-ng - Documentation (aircrack-ng.org)
WPA2 & WPA3
WPA2 (Wi-Fi Protected Access 2) dan WPA3 adalah standar enkripsi untuk Wi-Fi. Memahami perbedaan dan cara kerjanya penting untuk mengamankan jaringan nirkabel.
Evolusi Wi-Fi Security
| STANDAR | TAHUN | ENKRIPSI | STATUS |
|---|---|---|---|
| WEP | 1999 | RC4 | BROKEN - JANGAN PAKAI |
| WPA | 2003 | TKIP (RC4) | DEPRECATED |
| WPA2 | 2004 | AES-CCMP | STANDAR SAAT INI |
| WPA3 | 2018 | AES-GCMP / SAE | TERBARU & TERAMAN |
Perbedaan Utama
| ASPEK | WPA2 | WPA3 |
|---|---|---|
| Handshake | 4-way handshake (PSK) | SAE (Simultaneous Authentication of Equals) |
| Dictionary attack | Rentan (offline) | Tahan (online only) |
| Forward secrecy | Tidak | Ya (past session aman meski key bocor) |
| Encryption | AES-CCMP 128-bit | AES-GCMP 192-bit (Enterprise) |
| Open networks | Tidak terenkripsi | OWE (Opportunistic Wireless Encryption) |
| IoT support | Terbatas | WPA3-Easy Connect (QR code) |
WPA3 Modes
| MODE | USE CASE | AUTHENTICATION |
|---|---|---|
| WPA3-Personal | Rumah, SOHO | SAE dengan password |
| WPA3-Enterprise | Enterprise, government | 802.1X/EAP, 192-bit crypto |
| WPA3-Enterprise 192-bit | High-security environments | CNSA suite (NSA standards) |
Praktik: Konfigurasi WPA3
OpenWrt - WPA3 Configuration # Edit /etc/config/wireless config wifi-device 'radio0' option type 'mac80211' option path 'pci0000:00/0000:00:01.0' option channel 'auto' option htmode 'VHT80' config wifi-iface 'default_radio0' option device 'radio0' option network 'lan' option mode 'ap' option ssid 'MySecureWiFi' # WPA3-Personal option encryption 'sae-mixed' # WPA2/WPA3 mixed mode option key 'YourStrongPassword123!' # Atau WPA3-only # option encryption 'sae' # option key 'YourStrongPassword123!' # WPA3-Enterprise # option encryption 'owe' # Opportunistic # option auth_server '192.168.1.10' # option auth_port '1812' # option auth_secret 'radius_secret' # Restart wireless $ wifi reload # Verify $ iwinfo $ iw dev wlan0 info
Tahun 2017, peneliti Mathy Vanhoef menemukan KRACK (Key Reinstallation Attack) yang mengeksploitasi kerentanan dalam 4-way handshake WPA2. Serangan ini memungkinkan attacker mendekripsi trafik Wi-Fi, menyuntikkan malware, dan mencuri data.
Dampak: semua perangkat Wi-Fi yang pakai WPA2 terpengaruh. Solusi: patch firmware. Pelajaran: WPA2 tidak sempurna, butuh WPA3.
- WPA2 = kunci rumah biasa - bisa di-copy jika pencuri cukup dekat
- WPA3 = kunci biometrik - tidak bisa di-copy, hanya pemilik asli yang bisa buka
- SAE handshake = jabat tangan khusus yang hanya bisa dilakukan jika kedua pihak tahu "rahasia"
- Forward secrecy = meski kunci hari ini bocor, pesan kemarin tetap aman
- Wi-Fi Alliance - WPA3 Specification
- IEEE 802.11-2020 - Wireless LAN Standard
- Vanhoef, M. (2017). KRACK Attacks (krackattacks.com)
- NIST SP 800-153 - Guide to Securing Wi-Fi
VPN
VPN (Virtual Private Network) adalah teknologi yang membuat tunnel terenkripsi melalui jaringan publik (internet), memungkinkan komunikasi aman seolah-olah berada di jaringan privat.
Definisi
"A VPN is a private network that uses a public network to connect remote sites or users together, using encryption and authentication to secure the connection."
Jenis VPN
| JENIS | DESKRIPSI | USE CASE | CONTOH |
|---|---|---|---|
| Site-to-Site | Menghubungkan dua jaringan | Kantor cabang ke kantor pusat | IPsec, GRE |
| Remote Access | User remote ke jaringan korporat | WFH, mobile workers | OpenVPN, WireGuard, SSL VPN |
| Consumer VPN | Privasi & akses geo-restricted | Streaming, privacy | ExpressVPN, NordVPN |
| Mobile VPN | VPN untuk mobile device | Always-on connectivity | Always-on VPN, MDM |
VPN Protocols
| PROTOCOL | LAYER | ENKRIPSI | KECEPATAN | STATUS |
|---|---|---|---|---|
| PPTP | Layer 2 | MPPE (weak) | Cepat | BROKEN - JANGAN PAKAI |
| L2TP/IPsec | Layer 2+3 | IPsec | Sedang | OK tapi lambat |
| OpenVPN | Layer 2/3 | OpenSSL (AES) | Cepat | RECOMMENDED |
| SSTP | Layer 4 | SSL/TLS | Cepat | Microsoft proprietary |
| IKEv2/IPsec | Layer 3 | IPsec | Sangat cepat | RECOMMENDED (mobile) |
| WireGuard | Layer 3 | ChaCha20, Curve25519 | Sangat cepat | MODERN & RECOMMENDED |
Praktik: OpenVPN Setup
Bash - OpenVPN Server Setup # 1. Install OpenVPN dan EasyRSA $ sudo apt install openvpn easy-rsa # 2. Setup PKI (Public Key Infrastructure) $ make-cadir ~/openvpn-ca $ cd ~/openvpn-ca # 3. Edit vars file $ nano vars # Set: set_var EASYRSA_REQ_COUNTRY "ID" # set_var EASYRSA_REQ_PROVINCE "Lampung" # set_var EASYRSA_REQ_ORG "MyCompany" # 4. Build CA $ ./easyrsa init-pki $ ./easyrsa build-ca # 5. Generate server certificate $ ./easyrsa gen-req server nopass $ ./easyrsa sign-req server server # 6. Generate DH parameters $ ./easyrsa gen-dh # 7. Generate ta.key (TLS auth) $ openvpn --genkey --secret keys/ta.key # 8. Copy files to OpenVPN directory $ sudo cp pki/ca.crt pki/private/ca.key pki/issued/server.crt pki/private/server.key pki/dh.pem ~/openvpn-ca/keys/ta.key /etc/openvpn/ # 9. Create server.conf $ sudo cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/ $ sudo gunzip /etc/openvpn/server.conf.gz $ sudo nano /etc/openvpn/server.conf # 10. Generate client certificate $ cd ~/openvpn-ca $ ./easyrsa gen-req client1 nopass $ ./easyrsa sign-req client client1 # 11. Start OpenVPN $ sudo systemctl start openvpn@server $ sudo systemctl enable openvpn@server # 12. Check status $ sudo systemctl status openvpn@server $ ip addr show tun0
Praktik: WireGuard Setup
Bash - WireGuard (Modern VPN) # 1. Install WireGuard $ sudo apt install wireguard # 2. Generate keys (server) $ cd /etc/wireguard $ umask 077 $ wg genkey | tee privatekey | wg pubkey > publickey # 3. Create server config $ sudo nano /etc/wireguard/wg0.conf # [Interface] # PrivateKey = <server-private-key> # Address = 10.0.0.1/24 # ListenPort = 51820 # [Peer] # PublicKey = <client-public-key> # AllowedIPs = 10.0.0.2/32 # 4. Generate client keys $ wg genkey | tee client-privatekey | wg pubkey > client-publickey # 5. Start WireGuard $ sudo wg-quick up wg0 # 6. Enable IP forwarding $ echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf $ sudo sysctl -p # 7. Check status $ sudo wg show # 8. Stop WireGuard $ sudo wg-quick down wg0
- Internet = jalan raya publik yang ramai dan tidak aman
- VPN tunnel = terowongan rahasia yang terenkripsi
- Enkripsi = mobil lapis baja di dalam terowongan
- VPN server = pintu keluar terowongan di tujuan
Meski jalan raya berbahaya, data Anda aman di dalam terowongan terenkripsi.
- NIST SP 800-77 Rev.1 - Guide to IPsec VPNs
- OpenVPN - Documentation (openvpn.net)
- WireGuard - Documentation (wireguard.com)
- RFC 4301 - Security Architecture for IP (IPsec)
IDS & IPS
IDS (Intrusion Detection System) dan IPS (Intrusion Prevention System) adalah sistem yang mendeteksi dan/atau mencegah aktivitas mencurigakan di jaringan. IDS hanya mendeteksi, IPS mendeteksi DAN memblokir.
Definisi
"An IDS/IPS is a device or software application that monitors network or system activities for malicious activities or policy violations and produces reports to a management station."
IDS vs IPS
| ASPEK | IDS | IPS |
|---|---|---|
| Fungsi utama | Deteksi & alert | Deteksi & block |
| Posisi di jaringan | Out-of-band (passive) | In-line (active) |
| Impact pada trafik | Tidak mempengaruhi | Bisa menambah latency |
| False positive | Alert saja | Bisa block trafik legitimate |
| Use case | Monitoring, forensik | Real-time protection |
Detection Methods
| METHOD | CARA KERJA | KELEBIHAN | KEKURANGAN |
|---|---|---|---|
| Signature-based | Cocokkan dengan database signature | Akurat untuk known threats | Tidak deteksi zero-day |
| Anomaly-based | Deteksi penyimpangan dari baseline | Bisa deteksi unknown threats | High false positive |
| Stateful protocol analysis | Analisis state protokol | Deteksi protocol violations | Resource intensive |
| Heuristic/Behavioral | Analisis perilaku | Deteksi anomali kompleks | Kompleks, butuh ML |
IDS/IPS Deployment Types
| TYPE | DESKRIPSI | USE CASE |
|---|---|---|
| NIDS/NIPS | Network-based, monitor trafik jaringan | Perimeter network |
| HIDS/HIPS | Host-based, monitor aktivitas di host | Server kritis, endpoint |
| Wireless IDS/IPS | Monitor Wi-Fi traffic | Wireless network |
| Network Behavior Analysis (NBA) | Analisis pola trafik | Deteksi DDoS, anomali |
Praktik: Snort IDS
Bash - Snort IDS Configuration # 1. Install Snort $ sudo apt install snort # 2. Configure network interface $ sudo nano /etc/snort/snort.conf # Set: ipvar HOME_NET [192.168.1.0/24] # 3. Create custom rule $ sudo nano /etc/snort/rules/local.rules # Alert on ICMP ping alert icmp any any -> $HOME_NET any (msg:"ICMP Ping detected"; sid:1000001; rev:1;) # Alert on SSH login alert tcp any any -> $HOME_NET 22 (msg:"SSH connection attempt"; sid:1000002; rev:1;) # Alert on specific IP alert ip 192.168.1.100 any -> $HOME_NET any (msg:"Suspicious IP detected"; sid:1000003; rev:1;) # 4. Test configuration $ sudo snort -T -c /etc/snort/snort.conf # 5. Run Snort in IDS mode $ sudo snort -A console -q -c /etc/snort/snort.conf -i eth0 # 6. Run in background with logging $ sudo snort -D -c /etc/snort/snort.conf -i eth0 -l /var/log/snort # 7. Check alerts $ sudo tail -f /var/log/snort/alert # 8. Use PulledPork for rule updates $ sudo apt install pulledpork $ sudo pulledpork -c /etc/pulledpork/pulledpork.conf
Praktik: Suricata IDS/IPS
Bash - Suricata IDS/IPS # 1. Install Suricata $ sudo apt install suricata # 2. Update rules $ sudo suricata-update # 3. Configure network $ sudo nano /etc/suricata/suricata.yaml # Set: HOME_NET: "[192.168.1.0/24]" # 4. Test configuration $ sudo suricata -T -c /etc/suricata/suricata.yaml # 5. Run Suricata $ sudo suricata -c /etc/suricata/suricata.yaml -i eth0 # 6. Check logs $ sudo tail -f /var/log/suricata/fast.log $ sudo tail -f /var/log/suricata/eve.json # 7. Enable IPS mode (inline) # Edit suricata.yaml: # af-packet: # - interface: eth0 # ips: yes # 8. Use with systemd $ sudo systemctl start suricata $ sudo systemctl enable suricata
- IDS = CCTV + alarm - hanya awasi dan beri tahu jika ada maling
- IPS = satpam + alarm - awasi DAN langsung tangkap maling
- Signature-based = daftar wajah buronan yang diketahui
- Anomaly-based = curiga dengan perilaku mencurigakan
- NIST SP 800-94 - Guide to Intrusion Detection and Prevention Systems
- Snort - Documentation (snort.org)
- Suricata - Documentation (suricata.io)
- Emerging Threats - IDS Rules
NETWORK MONITORING
Network monitoring adalah proses continuous monitoring trafik, performa, dan keamanan jaringan. Tujuannya: deteksi dini masalah, troubleshooting, dan memastikan ketersediaan layanan.
Tujuan Network Monitoring
- Performance monitoring - bandwidth, latency, packet loss
- Availability monitoring - uptime/downtime perangkat
- Security monitoring - deteksi anomali, serangan
- Capacity planning - prediksi kebutuhan resource
- Troubleshooting - identifikasi akar masalah
- Compliance - audit trail untuk regulasi
Monitoring Tools
| TOOL | TIPE | FUNGSI | LISENSI |
|---|---|---|---|
| Wireshark | Packet analyzer | Deep packet inspection | Open source |
| tcpdump | Packet capture | Command-line packet capture | Open source |
| Nagios | Monitoring | Infrastructure monitoring | Open source |
| Zabbix | Monitoring | Enterprise monitoring | Open source |
| Prometheus + Grafana | Metrics + Visualization | Time-series monitoring | Open source |
| ELK Stack | Log management | Log collection & analysis | Open source |
| SIEM (Splunk, AlienVault) | Security monitoring | Security event correlation | Commercial |
| ntopng | Traffic analysis | Real-time traffic monitoring | Open source |
Praktik: tcpdump
Bash - tcpdump Packet Capture # 1. Capture all traffic $ sudo tcpdump -i eth0 # 2. Capture specific protocol $ sudo tcpdump -i eth0 tcp $ sudo tcpdump -i eth0 udp $ sudo tcpdump -i eth0 icmp # 3. Capture specific port $ sudo tcpdump -i eth0 port 80 $ sudo tcpdump -i eth0 port 443 $ sudo tcpdump -i eth0 port 22 # 4. Capture specific IP $ sudo tcpdump -i eth0 host 192.168.1.100 $ sudo tcpdump -i eth0 src host 192.168.1.100 $ sudo tcpdump -i eth0 dst host 192.168.1.100 # 5. Capture with verbose output $ sudo tcpdump -i eth0 -vv -X # 6. Save to file $ sudo tcpdump -i eth0 -w capture.pcap # 7. Read from file $ tcpdump -r capture.pcap # 8. Complex filter $ sudo tcpdump -i eth0 'tcp port 80 and host 192.168.1.100' # 9. Capture with packet count limit $ sudo tcpdump -i eth0 -c 100 # 10. Capture HTTP GET requests $ sudo tcpdump -i eth0 -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | grep -i "GET"
Praktik: Prometheus + Grafana
Bash - Prometheus + Grafana Setup # 1. Install Prometheus $ sudo apt install prometheus # 2. Configure Prometheus $ sudo nano /etc/prometheus/prometheus.yml # global: # scrape_interval: 15s # scrape_configs: # - job_name: 'node' # static_configs: # - targets: ['localhost:9100'] # 3. Install node_exporter $ sudo apt install prometheus-node-exporter # 4. Install Grafana $ wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - $ echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee /etc/apt/sources.list.d/grafana.list $ sudo apt update $ sudo apt install grafana # 5. Start services $ sudo systemctl start prometheus $ sudo systemctl start prometheus-node-exporter $ sudo systemctl start grafana-server # 6. Enable on boot $ sudo systemctl enable prometheus $ sudo systemctl enable grafana-server # 7. Access Grafana # http://localhost:3000 # Default login: admin/admin # 8. Add Prometheus data source # Configuration -> Data Sources -> Add data source -> Prometheus # URL: http://localhost:9090 # 9. Import dashboard # Dashboards -> Import -> Import ID: 1860 (Node Exporter Full)
Praktik: SNMP Monitoring
Bash - SNMP Monitoring # 1. Install SNMP tools $ sudo apt install snmp snmpd # 2. Configure snmpd $ sudo nano /etc/snmp/snmpd.conf # sysLocation "Server Room" # sysContact "admin@example.com" # rocommunity public 192.168.1.0/24 # 3. Restart snmpd $ sudo systemctl restart snmpd # 4. Query SNMP $ snmpwalk -v2c -c public localhost system # 5. Get specific OID $ snmpget -v2c -c public localhost sysDescr.0 # 6. Monitor interface traffic $ snmpwalk -v2c -c public localhost ifInOctets $ snmpwalk -v2c -c public localhost ifOutOctets # 7. Monitor CPU load $ snmpwalk -v2c -c public localhost hrProcessorLoad
- Speedometer = bandwidth usage
- Tachometer = CPU/memory usage
- Warning lights = alerts & alarms
- Fuel gauge = disk space
- Temperature gauge = device temperature
Tanpa dashboard, Anda tidak tahu kondisi mobil. Tanpa monitoring, Anda tidak tahu kondisi jaringan.
- Wireshark - Documentation (wireshark.org)
- Prometheus - Documentation (prometheus.io)
- Grafana - Documentation (grafana.com)
- Nagios - Documentation (nagios.org)
ANALISIS TRAFFIC (PRAKTIK)
Analisis network traffic adalah proses examining paket data untuk memahami pola komunikasi, mendeteksi anomali, dan mengidentifikasi ancaman. Ini adalah skill fundamental bagi security analyst.
Tujuan Analisis Traffic
- Troubleshooting - identifikasi masalah jaringan
- Performance analysis - optimasi performa
- Security analysis - deteksi serangan & anomali
- Forensics - investigasi insiden
- Compliance - audit trail
- Capacity planning - prediksi kebutuhan
Praktik: Wireshark
Wireshark - Network Analysis # 1. Install Wireshark $ sudo apt install wireshark # 2. Add user to wireshark group $ sudo usermod -aG wireshark $USER # 3. Start Wireshark $ wireshark # 4. Command-line capture with tshark $ tshark -i eth0 # 5. Capture with filter $ tshark -i eth0 -f "port 80" # 6. Save capture $ tshark -i eth0 -w capture.pcap # 7. Read capture file $ tshark -r capture.pcap # 8. Display filters in Wireshark: # ip.addr == 192.168.1.100 # tcp.port == 80 # http.request.method == "GET" # dns.qry.name contains "google" # icmp # tcp.flags.syn == 1 # 9. Follow TCP stream # Right-click packet -> Follow -> TCP Stream # 10. Export objects # File -> Export Objects -> HTTP
Common Display Filters
| FILTER | DESKRIPSI |
|---|---|
ip.addr == 192.168.1.100 |
Traffic dari/ke IP tertentu |
tcp.port == 80 |
HTTP traffic |
tcp.port == 443 |
HTTPS traffic |
dns |
DNS queries |
http.request.method == "POST" |
HTTP POST requests |
tcp.flags.syn == 1 |
SYN packets (connection start) |
tcp.flags.reset == 1 |
RST packets (connection reset) |
icmp |
ICMP (ping) traffic |
frame.len > 1000 |
Large packets |
http contains "password" |
HTTP with password in plaintext |
Praktik: Analisis Serangan
Wireshark - Attack Analysis # 1. Detect port scan # Filter: tcp.flags.syn == 1 and tcp.flags.ack == 0 # Look for: many SYN packets to different ports from same source # 2. Detect SYN flood # Filter: tcp.flags.syn == 1 # Look for: high volume of SYN packets without corresponding ACK # 3. Detect ARP spoofing # Filter: arp # Look for: multiple ARP replies with same IP but different MAC # 4. Detect DNS tunneling # Filter: dns and udp.port == 53 # Look for: unusually large DNS queries or high frequency # 5. Detect cleartext credentials # Filter: http.request.method == "POST" # Look for: password fields in plaintext # 6. Detect C2 communication # Filter: tcp.flags.push == 1 # Look for: regular interval connections to suspicious IPs # 7. Detect data exfiltration # Filter: tcp.flags.push == 1 and frame.len > 1000 # Look for: large outbound transfers # 8. Statistics -> Conversations # See top talkers by bytes/packets # 9. Statistics -> Protocol Hierarchy # See protocol distribution # 10. Statistics -> IO Graphs # Visualize traffic over time
Praktik: NetFlow Analysis
Bash - NetFlow/sFlow Analysis # 1. Install nfdump $ sudo apt install nfdump # 2. Install nfcapd (NetFlow collector) $ sudo apt install nfdump-sflow # 3. Start collector $ sudo nfcapd -l /var/log/netflow -p 2055 -D # 4. Read NetFlow data $ nfdump -r /var/log/netflow/nfcapd.202609091430 # 5. Top talkers $ nfdump -r /var/log/netflow/nfcapd.202609091430 -s srcip # 6. Top destinations $ nfdump -r /var/log/netflow/nfcapd.202609091430 -s dstip # 7. Top ports $ nfdump -r /var/log/netflow/nfcapd.202609091430 -s port # 8. Filter by IP $ nfdump -r /var/log/netflow/nfcapd.202609091430 "src ip 192.168.1.100" # 9. Statistics $ nfdump -r /var/log/netflow/nfcapd.202609091430 -s record # 10. Use nfdump with nfprofile for long-term analysis $ nfprofile -r /var/log/netflow/nfcapd.202609091430
Praktik: Zeek (Bro) IDS
Bash - Zeek Network Analysis # 1. Install Zeek $ echo 'deb http://download.opensuse.org/repositories/security:/zeek/xUbuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/zeek.list $ sudo apt update $ sudo apt install zeek # 2. Configure Zeek $ sudo nano /opt/zeek/etc/node.cfg # [zeek] # type=standalone # host=localhost # interface=eth0 # 3. Deploy Zeek $ sudo /opt/zeek/bin/zeekctl deploy # 4. Check status $ sudo /opt/zeek/bin/zeekctl status # 5. View logs $ sudo tail -f /opt/zeek/logs/current/conn.log $ sudo tail -f /opt/zeek/logs/current/dns.log $ sudo tail -f /opt/zeek/logs/current/http.log # 6. Analyze logs with zeek-cut $ cat /opt/zeek/logs/current/conn.log | /opt/zeek/bin/zeek-cut id.orig_h id.resp_h proto # 7. Stop Zeek $ sudo /opt/zeek/bin/zeekctl stop
Analisis Kasus
| SKENARIO | INDIKATOR | ANALISIS |
|---|---|---|
| Port scanning | Banyak SYN ke port berbeda dari satu IP | Reconnaissance activity |
| DDoS attack | Volume traffic spike, banyak SYN tanpa ACK | Denial of Service |
| Data exfiltration | Large outbound transfers, unusual hours | Data theft |
| C2 communication | Regular beaconing, encrypted traffic to unknown IPs | Malware command & control |
| DNS tunneling | Large DNS queries, high frequency | Data exfiltration via DNS |
- Packet capture = rekaman CCTV kecelakaan
- Filter = fokus ke kendaraan tertentu
- Flow analysis = pola lalu lintas
- Anomaly detection = deteksi perilaku mencurigakan
Seperti forensik kecelakaan, analisis traffic membantu memahami apa yang terjadi, kapan, dan siapa yang terlibat.
- Wireshark - User's Guide (wireshark.org/docs)
- Zeek - Documentation (zeek.org)
- Kurose, J. & Ross, K. (2021). Computer Networking: A Top-Down Approach
- Cheswick, W. et al. (2003). An Internet Solver's Best Friend.
DIAGNOSTIK KOMPETENSI
Uji pemahaman Anda tentang Bab 12! Target minimal: 70% untuk melanjutkan ke Bab 13.
- Total 10 pertanyaan pilihan ganda
- Klik opsi untuk menjawab - feedback langsung
- Benar = HIJAU, salah = MAGENTA
- Penjelasan muncul setelah menjawab
- Klik "LIHAT HASIL AKHIR" untuk skor final
-
- NIST SP 800-53 Rev.5 - Security and Privacy Controls
- NIST SP 800-41 Rev.3 - Guide to Firewalls
- NIST SP 800-207 - Zero Trust Architecture
- NIST SP 800-94 - Intrusion Detection Systems
- IEEE 802.11-2020 - Wireless LAN Standard
- Wi-Fi Alliance - WPA3 Specification
- Stallings, W. (2020). Cryptography and Network Security
- Kurose, J. & Ross, K. (2021). Computer Networking
- Lyon, G. (2009). Nmap Network Scanning
- Verizon - DBIR 2024