Chào các bạn, hôm nay mình xin giới thiệu các bạn về giải pháp SIEM sử dụng Splunk, được biết đến là một hệ thống xây dựng thu thập log tập trung, dùng trong các doanh nghiệp, để phân tích, xử lý, phản ứng, phát hiện kịp thời các hành vi bất thường trong hệ thống từ đó đưa ra các cảnh báo đến người quản trị để kịp thời xử lý về bảo mật, hệ thống của mình. Cài đặt Splunk Server trên Centos 7 Mã: yum update -y Mã: yum install wget -y wget -O splunk-8.0.2.1-f002026bad55-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=8.0.2.1&product=splunk&filename=splunk-8.0.2.1-f002026bad55-linux-2.6-x86_64.rpm&wget=true' rpm -i splunk-8.0.2.1-f002026bad55-linux-2.6-x86_64.rpm /opt/splunk/bin/splunk start --accept-license Mở firewall Truy cập vào server qua ip public http://ippublic:8000 Mã: firewall-cmd --add-port=8000/tcp --permanent firewall-cmd --reload Cấu hình truy cập qua https Sau khi đăng nhập được vào Settings > System > Server settings, và click General Settings Khởi động lại dịch vụ và mở port 443 truy cập https://IP public để đến giao diện web Cấu hình trên máy chủ Splunk Server Tạo 2 index để nhận log đẩy về, ở đây mình nhận log windows và linux nên đặt tên là linux và windows Chọn Setting -> indexes -> New Index Các bạn nên cấu hình thông số Max Size of Entire Index =50GB để 1 index nó sẽ lưu tối đa 50GB, index= windows làm tương tự. Cấu hình mở port 9998 để nhận log Cấu hình tại Forwarding and receiving » Receive data Command hỗ trợ mở firewall Mã: firewall-cmd --zone=public --add-port=9998/tcp --permanent Hướng dẫn đẩy log về Windows Bật Success/Failure audit log tại Administrator Tools → Local security policy → Local Policy → Audit Policy Audit các trường sau: Audit account logon events Audit account management Audit logon events Audit policy change Audit privilege use Audit system event Tải splunk forwarder cho windows https://www.splunk.com/en_us/download/splunk-enterprise.html Tải file về máy client cần cài đặt Sau đó, chọn kiểu cấu hình “Customize Options” chọn Next Cài đặt ssl, nếu có Browse đến đường dẫn chứa tập tin public và private, sau đó nhập password và Browse đường dẫn SSL root CA. Nếu không sử dụng tính năng này có thể Next sang bước tiếp theo Chọn Local System và Next Tick chọn các log cần đẩy về để giám sát, nếu muốn giám sát 1 tập tin ứng dụng bất kì chọn “File” và đường dẫn đến File đó nhập tài khoản Administrator cho app Nếu có Deployment Server thì có thể nhập vào. Không có nhấn Next để bỏ qua Nhập IP Server và port sẽ nhận log từ client đẩy về Cài đặt Sau khi cài đặt chạy lệnh bên dưới để restart service splunk trên powershell PS C:\Program Files\SplunkUniversalForwarder\bin> .\splunk.exe restart *Thay đổi cấu hình log đẩy về chỉnh sửa tại path C:\Program Files\SplunkUniversalForwarder\etc\apps\SplunkUniversalForwarder\local\inputs.conf Restart lại splunk sau khi thay đổi cấu hìnhHướng dẫn đẩy log về Linux Mã: yum install wget -y wget -O splunkforwarder-8.0.2.1-f002026bad55-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=8.0.2.1&product=universalforwarder&filename=splunkforwarder-8.0.2.1-f002026bad55-linux-2.6-x86_64.rpm&wget=true' rpm -ivh splunkforwarder-8.0.2.1-f002026bad55-linux-2.6-x86_64.rpm cat > /opt/splunkforwarder/etc/system/local/user-seed.conf << EOF [user_info] USERNAME = admin PASSWORD = admin123 EOF /opt/splunkforwarder/bin/splunk start --accept-license --answer-yes --auto-ports --no-prompt /opt/splunkforwarder/bin/splunk enable boot-start /opt/splunkforwarder/bin/splunk add forward-server ServerSplunk:port -auth admin:admin123 echo "[monitor:///var/log/messages]" >> /opt/splunkforwarder/etc/system/local/inputs.conf echo "disabled = false" >> /opt/splunkforwarder/etc/system/local/inputs.conf echo "sourcetype=linux_message" >> /opt/splunkforwarder/etc/system/local/inputs.conf echo "index=linux_aws" >> /opt/splunkforwarder/etc/system/local/inputs.conf echo "[monitor:///var/log/audit/audit.log]" >> /opt/splunkforwarder/etc/system/local/inputs.conf echo "disabled = false" >> /opt/splunkforwarder/etc/system/local/inputs.conf echo "sourcetype=linux_audit" >> /opt/splunkforwarder/etc/system/local/inputs.conf echo "index=linux_aws" >> /opt/splunkforwarder/etc/system/local/inputs.conf /opt/splunkforwarder/bin/splunk restart rm -rf /opt/splunkforwarder/etc/system/local/user-seed.conf rm -rf splunkforwarder-8.0.2.1-f002026bad55-linux-2.6-x86_64.rpm Thay đổi cấu hình để monitor vi /opt/splunkforwarder/etc/system/local/inputs.conf [default] host = IP.localdomain sourcetype = linuxOS / đặt tên [monitor:///var/log/messages] / giám sát log messages tại đường dẫn [monitor:///var/log/secure] / giám sát log secure tại đường dẫn [monitor:////var/log/audit/audit.log] / giám sát log audit tại đường dẫn B5: /opt/splunkforwarder/bin/splunk add forward-server IP: Port / IP và port nhận log đẩy về B6: /opt/splunkforwarder/bin/splunk restart / sau mỗi lần thay đổi configure Command hỗ trợ mở fw iptables -A INPUT -p tcp -m tcp --dport port-j ACCEPT Server firewall-cmd --zone=public --add-port=port /tcp --permanent Vào splunk kiểm tra log đẩy về Bài này mình xin giới thiệu đến đây để các bạn có thể hiểu được cách thức và các lấy log từ các endpoint như thế nào, những bài tiếp theo mình sẽ giới thiệu các bạn về cách làm rule, như phát hiện login thành công ngoài giờ hành chính, bash của user gõ gì, hay tạo mới user, cả trên windows và linux
anh ơi em muốn hỏi anh 1 chút ạ: 1. em cấu hình để log của pfsense firewall nhận trên splunk rồi thì a có thể cho em hướng để phân tích những cái log đó, khi pfsense của e có cả cổng WAN để kết nối internet ạ (kiểu tấn công vào firewall đó ý ạ...) em cảm ơn