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

📘 Tuần 7 – User-ID, Authentication và kiểm soát theo danh tính

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

📘 Tuần 7 – User-ID, Authentication và kiểm soát theo danh tính


🗺️ Sơ đồ – User-ID Integration với Active Directory

flowchart TD subgraph AD["🏢 Active Directory Domain (lab.local)"] DC["🖥️ Domain Controller 10.10.20.50 Windows Server"] Users["👥 Users - IT-Group - HR-Group - Guest-Group"] end subgraph PA["🔥 Palo Alto PA-LAB-01"] UID["🔍 User-ID Agent (đọc Security Event Log từ DC)"] IPMap["📋 IP-to-User Mapping 10.10.10.100 → DOMAIN\nguyenvana 10.10.10.101 → DOMAIN\tranthib"] subgraph Policy["📜 Security Policy dựa vào User"] P1["Rule: IT-Group → VLAN20 ✅ Allow SSH, RDP"] P2["Rule: HR-Group → VLAN20 ❌ Deny"] P3["Rule: Any → Internet ✅ Allow web-browsing"] end end DC -->|"Security Event Log 4768/4769 (Kerberos login events)"| UID UID --> IPMap IPMap --> Policy style AD fill:#e3f2fd,stroke:#1976d2 style PA fill:#fff3e0,stroke:#f57c00

📚 Lý thuyết cơ bản

🔰 User-ID là gì?

User-ID = Tính năng nhận dạng người dùng theo tên (thay vì chỉ theo IP).

💡 Vấn đề của firewall truyền thống: - "IP 10.10.10.100 đang truy cập Server" → Ai đang ngồi ở máy đó? Với User-ID: - "DOMAIN\nguyenvana đang truy cập Server từ 10.10.10.100" → Biết chính xác người dùng! Lợi ích: Policy dựa vào tên người dùng/nhóm AD thay vì IP có thể thay đổi.

🔰 Cách User-ID hoạt động

Palo Alto đọc Security Event Log từ Domain Controller:

  • Event 4768/4769: User đăng nhập Kerberos → biết IP nào đang dùng bởi user nào.
  • Xây dựng bảng IP-to-User Mapping: IP ↔ Username ↔ Group AD.

🔰 Các phương thức User-ID

Phương thứcMô tảDùng khi
Windows-basedĐọc Security Event Log từ DCMôi trường Windows AD
Syslog-basedNhận syslog từ DHCP/VPN/802.1XMôi trường không có AD
XML APIAPI tích hợp với hệ thống khácTích hợp custom
GlobalProtectLấy từ VPN clientRemote users
Captive PortalYêu cầu đăng nhập webGuest network

🔰 Authentication Policy

Authentication Policy = Yêu cầu user đăng nhập trước khi truy cập tài nguyên (Captive Portal).


🛠️ Thực hành

Bật User-ID trên Zone Trust

textadmin@PA-LAB-01> configure

# Bật User-ID cho zone Trust
admin@PA-LAB-01# set zone Trust enable-user-identification yes

admin@PA-LAB-01# commit

Cấu hình kết nối tới Domain Controller

text# GUI: Device → User Identification → User-ID Agents
# Hoặc dùng built-in Windows agent:

# Cấu hình WMI/WinRM để đọc log từ DC
admin@PA-LAB-01# set user-id-collector setting wmi-client enabled yes

# Thêm server monitor account (đọc Security Event Log)
admin@PA-LAB-01# set user-id-collector setting server-monitor account domain lab.local
admin@PA-LAB-01# set user-id-collector setting server-monitor account username svc_paloalto
admin@PA-LAB-01# set user-id-collector setting server-monitor account password <password>

# Thêm DC để monitor
admin@PA-LAB-01# set user-id-collector server-monitor "DC-Lab" server 10.10.20.50
admin@PA-LAB-01# set user-id-collector server-monitor "DC-Lab" type Windows Active Directory

admin@PA-LAB-01# commit

Cấu hình LDAP Server Profile (kết nối AD)

text# GUI: Device → Server Profiles → LDAP → Add
admin@PA-LAB-01# set shared server-profile ldap "AD-LAB" server "dc01" address 10.10.20.50
admin@PA-LAB-01# set shared server-profile ldap "AD-LAB" server "dc01" port 389
admin@PA-LAB-01# set shared server-profile ldap "AD-LAB" base "DC=lab,DC=local"
admin@PA-LAB-01# set shared server-profile ldap "AD-LAB" bind-dn "CN=svc_paloalto,OU=ServiceAccounts,DC=lab,DC=local"
admin@PA-LAB-01# set shared server-profile ldap "AD-LAB" bind-password <password>
admin@PA-LAB-01# set shared server-profile ldap "AD-LAB" type active-directory
admin@PA-LAB-01# set shared server-profile ldap "AD-LAB" ssl no

admin@PA-LAB-01# commit

Tạo User Group và áp dụng vào Security Policy

text# GUI: Objects → Address Groups (User based)
# Tạo group IT-Staff từ AD
admin@PA-LAB-01# set shared user-group "IT-Staff" filter "(samaccountname=*)"

# Áp dụng User Group vào Security Policy
admin@PA-LAB-01# set rulebase security rules "IT-to-Server" from Trust
admin@PA-LAB-01# set rulebase security rules "IT-to-Server" to Trust
admin@PA-LAB-01# set rulebase security rules "IT-to-Server" source any
admin@PA-LAB-01# set rulebase security rules "IT-to-Server" source-user IT-Staff
admin@PA-LAB-01# set rulebase security rules "IT-to-Server" destination VLAN20-SERVER
admin@PA-LAB-01# set rulebase security rules "IT-to-Server" application ssh ms-rdp
admin@PA-LAB-01# set rulebase security rules "IT-to-Server" action allow

admin@PA-LAB-01# commit

Kiểm tra User-ID mapping

text# Xem bảng mapping IP → User hiện tại
admin@PA-LAB-01> show user ip-user-mapping all

# Xem user group mapping
admin@PA-LAB-01> show user group-mapping all

# Debug User-ID
admin@PA-LAB-01> debug user-id log-ip-user-mapping yes

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

  • ✅ Dùng service account riêng (không dùng Domain Admin) để Palo Alto đọc log DC.
  • ✅ Bật LDAPS (port 636) thay vì LDAP plain text.
  • ✅ Giới hạn IP nào được query User-ID Agent.
  • ✅ Log mọi traffic có User-ID để audit.

📖 Case thực tế

Công ty phát hiện có người trong nhóm HR đang dùng SSH vào server sản xuất (ngoài giờ hành chính). Policy cũ dùng IP → không phân biệt được. Sau khi bật User-ID + gán Group Policy: - HR-Group → bị chặn SSH/RDP vào server. - IT-Group → vẫn được phép. - Threat Log ghi rõ "DOMAIN\tranthib cố truy cập server ngoài giờ → DENY". 👉 User-ID giúp kiểm soát theo danh tính thật, không phụ thuộc IP.


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