hoatranlab.io.vn Zalo: 0917516878 Hotline: 0917516878 [email protected] LinkedIn
HoaTranLab Logo HoaTranLab
Trang chủ / Security / PAN-OS Lab 12 Tuần / Tuần 06
PAN-OS Administration Lab · Tuần 06/12

📘 Tuần 6 – Logging, Monitoring và Security Profiles

Trần Văn Hòa 2026 ~15 phút đọc Palo Alto · PAN-OS · PnetLab

📘 Tuần 6 – Logging, Monitoring và Security Profiles


🗺️ Sơ đồ – Hệ thống Log và Security Profiles

flowchart TD Traffic["🔄 Traffic đến Palo Alto"] subgraph PAN["🔥 Palo Alto – Kiểm soát & Ghi log"] subgraph SP2["🛡️ Security Profiles (Áp dụng vào Security Policy)"] AV["🦠 Antivirus Profile Quét virus trong traffic"] IPS["⚔️ Vulnerability Protection Chặn exploit, CVE"] URL["🌐 URL Filtering Lọc website theo category"] WF["📁 WildFire Phân tích file độc hại"] AS["🤖 Anti-Spyware Chặn botnet, C2"] end subgraph Logging["📊 Logging & Monitoring"] TrafficLog["📋 Traffic Log Mọi kết nối qua firewall"] ThreatLog["⚠️ Threat Log Virus, IPS, URL alert"] SysLog["⚙️ System Log Admin login, commit, reboot"] ConfigLog["📝 Config Log Thay đổi cấu hình"] end subgraph Destinations["📤 Nơi gửi Log"] Local["💾 Local Disk (Giới hạn dung lượng)"] Panorama_box["🗼 Panorama (Quản lý tập trung)"] Syslog_box["📡 Syslog Server 10.10.20.100:514"] SNMP_box["📈 SNMP Trap Giám sát phần cứng"] end end Traffic --> SP2 SP2 --> Logging Logging --> Destinations style SP2 fill:#e3f2fd,stroke:#1976d2 style Logging fill:#f3e5f5,stroke:#7b1fa2 style Destinations fill:#e8f5e9,stroke:#388e3c

📚 Lý thuyết cơ bản

🔰 Security Profiles là gì?

Security Profiles = "Lớp kiểm tra nội dung" – gắn thêm vào Security Policy để quét sâu traffic.

💡 Security Policy chỉ hỏi: "Traffic này có được phép đi không?" Security Profiles hỏi thêm: "Traffic được phép đi, nhưng bên trong có chứa gì không?" Giống như: - Security Policy = Bảo vệ cổng kiểm tra vé. - Security Profile = Máy scan X-quang kiểm tra hành lý bên trong.

🔰 Các Security Profiles chính

ProfileBảo vệ khỏiCần license?
AntivirusVirus, malware trong file downloadThreat Prevention
Anti-SpywareBotnet, spyware, C2 callbackThreat Prevention
Vulnerability ProtectionExploit lỗ hổng, CVEThreat Prevention
URL FilteringWebsite độc hại, không phù hợpURL Filtering
WildFireFile chưa biết → gửi lên cloud phân tíchWildFire
File BlockingChặn loại file nhất định (.exe, .zip...)Không cần license
Data FilteringPhát hiện dữ liệu nhạy cảm (số CCCD, thẻ ngân hàng)DLP

🔰 Log Forwarding Profile là gì?

Log Forwarding Profile = Cấu hình gửi log đến đâu.

💡 Tạo một Log Forwarding Profile → Gán vào Security Policy → Mọi traffic match rule đó sẽ được log và gửi đến Syslog/Panorama.

🔰 SNMP trong Palo Alto

Giám sát phần cứng (CPU, RAM, disk, interface) qua SNMP – tương tự FortiGate nhưng cú pháp khác.


🛠️ Thực hành

Tạo Security Profile Groups

Qua GUI: Objects → Security Profile Groups → Add

textadmin@PA-LAB-01> configure

# Tạo Antivirus Profile
admin@PA-LAB-01# set profiles virus "AV-Default" decoder ftp action reset-both
admin@PA-LAB-01# set profiles virus "AV-Default" decoder http action reset-both
admin@PA-LAB-01# set profiles virus "AV-Default" decoder smtp action reset-both

# Tạo Anti-Spyware Profile
admin@PA-LAB-01# set profiles spyware "AS-Default" rules "block-critical-high" severity [critical high]
admin@PA-LAB-01# set profiles spyware "AS-Default" rules "block-critical-high" action block-ip
admin@PA-LAB-01# set profiles spyware "AS-Default" rules "block-critical-high" packet-capture single-packet

# Tạo Vulnerability Protection Profile
admin@PA-LAB-01# set profiles vulnerability "VP-Default" rules "block-critical" severity critical
admin@PA-LAB-01# set profiles vulnerability "VP-Default" rules "block-critical" action block-ip

# Tạo URL Filtering Profile
admin@PA-LAB-01# set profiles url-filtering "URL-Default" action block category malware
admin@PA-LAB-01# set profiles url-filtering "URL-Default" action block category phishing
admin@PA-LAB-01# set profiles url-filtering "URL-Default" action alert category social-networking

Gán Security Profiles vào Security Policy

text# Áp dụng profile cho rule Trust-to-Internet
admin@PA-LAB-01# set rulebase security rules "Allow-Trust-to-Internet" profile-setting profiles virus AV-Default
admin@PA-LAB-01# set rulebase security rules "Allow-Trust-to-Internet" profile-setting profiles spyware AS-Default
admin@PA-LAB-01# set rulebase security rules "Allow-Trust-to-Internet" profile-setting profiles vulnerability VP-Default
admin@PA-LAB-01# set rulebase security rules "Allow-Trust-to-Internet" profile-setting profiles url-filtering URL-Default

admin@PA-LAB-01# commit

Cấu hình Log Forwarding (Syslog)

text# Tạo Syslog Server profile
admin@PA-LAB-01# set log-settings syslog "Syslog-LAB" server "syslog-01" server 10.10.20.100
admin@PA-LAB-01# set log-settings syslog "Syslog-LAB" server "syslog-01" transport UDP
admin@PA-LAB-01# set log-settings syslog "Syslog-LAB" server "syslog-01" port 514
admin@PA-LAB-01# set log-settings syslog "Syslog-LAB" server "syslog-01" format BSD
admin@PA-LAB-01# set log-settings syslog "Syslog-LAB" server "syslog-01" facility LOG_USER

# Tạo Log Forwarding Profile
admin@PA-LAB-01# set log-settings profiles "Forward-All" match-list "traffic-to-syslog" log-type traffic
admin@PA-LAB-01# set log-settings profiles "Forward-All" match-list "traffic-to-syslog" send-syslog Syslog-LAB

# Gán Log Forwarding Profile vào Security Policy
admin@PA-LAB-01# set rulebase security rules "Allow-Trust-to-Internet" log-setting Forward-All

admin@PA-LAB-01# commit

Cấu hình SNMP

text# Bật SNMP v2c (GUI: Device → Setup → Operations → SNMP Setup)
admin@PA-LAB-01# set deviceconfig system snmp-setting access-setting version v2c
admin@PA-LAB-01# set deviceconfig system snmp-setting access-setting version v2c snmp-community-string lab-community

admin@PA-LAB-01# commit

Xem Log qua CLI

text# Xem traffic log 20 dòng gần nhất
admin@PA-LAB-01> show log traffic last 20

# Xem threat log
admin@PA-LAB-01> show log threat last 20

# Lọc log theo IP nguồn
admin@PA-LAB-01> show log traffic src eq 10.10.10.100

# Lọc log theo ứng dụng
admin@PA-LAB-01> show log traffic app eq facebook-base

🔒 Bảo mật cần nhớ

  • ✅ Áp dụng Security Profiles cho tất cả rule Allow ra Internet.
  • ✅ Bật log forwarding ra Syslog/Panorama – không chỉ lưu local.
  • ✅ Dùng SNMPv3 với auth + priv trong production.
  • ✅ Kiểm tra Threat Log thường xuyên để phát hiện tấn công sớm.

📖 Case thực tế

Một máy trong VLAN10 bị nhiễm malware, lén lút gửi dữ liệu ra ngoài (C2 callback) qua HTTPS port 443. Security Policy cho phép HTTPS → traffic qua bình thường. Nhờ Anti-Spyware Profile đang active: - Palo Alto nhận dạng pattern C2 callback → ghi Threat Log + block connection. - Admin nhận alert qua Syslog → cô lập máy bị nhiễm kịp thời. 👉 Security Profiles là lớp phòng thủ thứ 2 sau Security Policy.


📅 Tuần 6/12 – PAN-OS Administration Lab trên PnetLab