Kết luận chương 3

Một phần của tài liệu (LUẬN văn THẠC sĩ) nghiên cứu giải pháp tập trung và ứng dụng quản lý hệ thống mạng trường đại học hà nội (Trang 56 - 82)

Chương 3 của luận văn đã khảo sát mạng nội bộ tại trường Đại học Hà Nội, các vấn đề nảy sinh trong quá trình sử dụng và các yêu cầu trong giám sát hệ thống mạng nhằm đáp ứng nhu cầu đào tạo của nhà trường.

Luận văn cũng đề xuất giải pháp giám sát tập trung cho hệ thống mạng nội bộ của trường Đại học Hà Nội. Các kết quả thử nghiệm cho thấy các giải pháp bảo mật đề xuất có tiềm năng triển khai trong thực tế và phù hợp với các yêu cầu đề ra.

KẾT LUẬN

Các kết quả đạt được của luận văn:

Với mục tiêu nghiên cứu giải pháp giám sát tập trung và ứng dụng tại Trường Đại học Hà Nội, luận văn đã đạt được một số kết quả sau đây:

- Khảo sát các giải pháp giám sát tập trung

- Khảo sát các yêu cầu xây dựng hệ thống giám sát tập trung - Nghiên cứu các giải pháp giám sát tập trung

- Đề xuất giải pháp giám sát tập trung có thể triển khai cho hệ thống mạng trường Đại Học Hà Nội.

Hướng phát triển tiếp theo:

Học viên sẽ tiếp tục nghiên cứu, hoàn thiện các giải pháp giám sát tập trung để có thể áp dụng và triển khai một cách hiệu quả trong thực tế.

TÀI LIỆU THAM KHẢO

Tiếng Việt

[1] Hoàng Xuân Dậu (2007), Bài giảng an toàn bảo mật hệ thống thông tin, Học viện Công nghệ Bưu chính Viễn thông.

Tiếng Anh

[2] Ebook - Cisco Certified Network Associate – Cisco Academy

[3] Ebook - Certified Information System Security Professional – Microsoft [4] Ebook - Certified Ethical Hacker - Ec-Council

[5] R.C.Sreijl - Analysis of Managed Virtual Private Network, 2000 [6] IEEE std. 802 IQ. (2005) – “Virtual Bridged Local Area Networks”.

[7] K.R. Karthikeyan, A. Indra (2010) – “Intrusion Detection Tools and Techniques: A Survey” - International Journal of Computer Theory and Engineering, Vol.2, No.6.

Trang WEB [8] https://www.elastic.co/elk-stack/ [9] https://www.elastic.co/products [10] https://www.elastic.co/guide/index.html [11] http://www.lpi.org/ [12] https://en.wikipedia.org/wiki/FCAPS/ [13] https://redcode16.wordpress.com/2017/07/03/giai-phap-siem-security- infomation-and-event-management/ [14] https://www.zabbix.com [15] https://www.splunk.com [16] https://www.nagios.org [17] https://www8.hp.com [18] https://www.paessler.com/prtg [19] https://docs.microsoft.com/en-us/windows/

PHỤ LỤC

Trong phần phụ lục, Học viên trình bày chi tiết một số thử nghiệm các giải pháp bảo mật triển khai tại Trường Đại học Hà Nội bao gồm:

- Cài đặt máy chủ giám sát tập trung ELK.

- Cài đặt Metricbeat giám sát hiệu năng phần cứng, dịch vụ, database. - Cài đặt Packetbeat giám sát lưu lượng băng thông máy chủ

- Cài đặt Filebeat giám sát hệ điều hành Linux

- Cài đặt Winlogbeat giám sát truy cập người dùng đến Active Directory, hệ điều hành Windows.

- Cấu hình Switch, Router gửi syslog về máy chủ ELK. - Cấu hình Firewall Fortinet gửi syslog về máy chủ ELK. - Cấu hình ngưỡng, cảnh báo trong ELK.

Trước khi đi vào cài đặt và cấu hình, ta cần lên trang chủ tải các file RPM của ELK, Filebeat, Metricbeat, Packetbeat, Winlogbeat. Tất cả các phiên bản đều là 6.1.2. Ở đây Filebeat, Metricbeat, Packetbeat, sẽ cài trên hệ điều hành CentOS 7, còn Winlogbeat sẽ cài trên hệ điều hành Windows. Các máy CentOS 7 đã được update, tắt Firewall và Selinux. Máy Window đã tắt Firewall.

1. Cài đặt máy chủ giám sát tập trung ELK

Phần mềm ELK được cài đặt trên HĐH máy chủ Linux: CentOS-7 (64-bit). Các bước cài đặt HĐH CentOS-7 được triển khai bình thường.

Cài đặt hostname

# vi /etc/hostname

Đổi hostname thành elk.hanu.vn, cần reboot để server nhận hostname mới Cài đặt hosts

# vi /etc/hosts Thêm vào như sau

192.168.1.5 elk.hanu.vn Chỉnh sửa IP, Subnet, Gateway

IPADDR=”192.168.1.5” GATEWAY=”192.168.1.1” DNS1=”8.8.8.8”

Sau đó khởi động lại dịch vụ mạng # systemctl restart network

Cần thiết có thể ping 8.8.8.8 để kiểm tra kết nối mạng Cập nhật hệ điều hành máy chủ

# yum update –y Tắt SELinux

# vi /etc/sysconfig/selinux

Thay dòng “SELINUX=enforcing” thành “SELINUX=disabled” Firewall:

# systemctl stop firewalld # systemctl disable firewalld Cài đặt Java hỗ trợ ELK

# yum install java-1.8.0-openjdk.x86_64 –y

Giờ ta sử dụng WinSCP, đưa 3 file ELK đã tải vào trong thư mục /opt Quay lại màn hình làm việc CentOS để cài đặt ELK

Ta vào trong thư mục /opt nơi vừa để 3 file ta tải và cài đặt ELK # cd /opt

# yum localinstall elasticsearch-6.1.2.rpm kibana-6.1.2-x86_64.rpm logstash-6.1.2.rpm

Hệ điều hành sẽ tự động cài ELK. Cấu hình Elasticsearch

# vi /etc/elasticsearch/elasticsearch.yml Bỏ dấu # ở trước 2 dòng: ( ấn I để vào insert ) Network.host: 192.168.1.5

http.port: 9200

# systemctl start elasticsearch # systemctl enable elasticsearch Cấu hình Kibana

# vi /etc/kibana/kibana.yml Đổi thành:

server.host: “192.168.1.5”

elasticsearch.url: “192.168.1.5:9200”

( Lưu ý trước server.host, server.port và elasticsearch.url không có dấu # ) Khởi động dịch vụ

# systemctl start kibana # systemctl enable kibana

Cài đặt Nginx ( việc cài đặt nginx có thể có hoặc không có, tùy vào mục đích ) # yum -y install epel-release

# yum -y install nginx Chỉnh sửa file cấu hình nginx

# vi /etc/nginx/nginx.conf

Tìm và xóa đoạn server { } – xóa đến khi đoạn cuối file chỉ còn như sau: include /etc/nginx/conf.d/*.conf;

}

Sau đó ta tạo file mới, ghi nội dung của kibana: # vi /etc/nginx/conf.d/kibana.conf

server { listen 80;

server_name bkap.vn;

auth_basic "Restricted Access"; location / {

proxy_pass http://localhost:5601; proxy_http_version 1.1;

proxy_set_header Connection 'upgrade';

proxy_set_header Host $host;

proxy_cache_bypass $http_upgrade;

}

}

Sau đó ta khởi động dịch vụ nginx và logstash # systemctl start nginx

# systemctl enable nginx # systemctl start logstash # systemctl enable logstash

Giờ ta có thể vào ELK thông qua giao diện Kibana qua: http://(IP):5601

2. Cài đặt Metricbeat giám sát hiệu năng phần cứng, dịch vụ, database

Tương tự ELK, sử dụng WinSCP đưa file RPM của Metricbeat vào thư mục /opt.

Trở lại với hệ điều hành Centos 7, ta vào trong thư mục /opt nơi vừa chuyển file Metricbeat RPM

# cd /opt

# yum localinstall metricbeat-6.1.2-x86_64.rpm

Sau khi cài đặt xong, ta chỉnh sửa file cấu hình của Metricbeat: # vi /etc/metricbeat/metricbeat.yml

Ở mục Kibana, bỏ dấu #, thay host: “192.168.1.5:5601” Ở mục Elasticsearch, đổi host: [“192.168.1.5:9200”] Sau khi đã cấu hình xong, sử dụng các lệnh:

# systemctl start metricbeat # systemctl enable metricbeat

Hình 1: Import Index Pattern Metricbeat (1)

Chọn Next step

Hình 2: Import Index Pattern Metricbeat (2)

Trong phần Time Filter Field name ngoài chọn @timestamp có thể chọn theo nhiều kiểu khác, rồi Create Index Pattern. Vậy là quá trình này đã hoàn thành.

Chuyển qua mục Discover, ta sẽ nhìn thấy lượng log đổ về. Ở đây log sẽ đổ về là log hiệu năng của hệ thống.

Để thu thập thêm các loại log của dịch vụ web, database, ta cấu hình các file trong folder /etc/metricbeat/modules.d. Để bật các module muốn giám sát, ta đổi tên đuôi file bằng cách xóa đuôi .disabled đi.

Với database, ta cấu hình file mysql.yml, set IP, thêm username và password của database.

Với dịch vụ web, có thể lựa chọn tùy theo nhu cầu là Apache hay Nginx tương ứng là file apache.yml và nginx.yml, xóa đuôi disabled, hoàn thành việc cấu hình.

Sau đó truy cập vào các file đó cấu hình những thông tin cần thu thập. Muốn add Dashboard ta sử dụng câu lệnh sau (trên máy cài metricbeat):

# metricbeat setup --dashboards Loaded dashboards

Với Metricbeat, ta có thể kiểm soát hiệu năng các host đang giám sát bằng cách sử dụng DashboardHost overview, Database với Dashboard Mysql và dịch vụ Web với Dashboard Apache hoặc Nginx

3. Cài đặt Packetbeat giám sát lưu lượng băng thông máy chủ

Tương tự, sử dụng WinSCP đưa file RPM của Packetbeat vào thư mục /opt. Trở lại với hệ điều hành Centos 7, ta vào trong thư mục /opt nơi vừa chuyển file Packetbeat RPM

# cd /opt

# yum localinstall packetbeat-6.1.2-x86_64.rpm

Sau khi cài đặt xong, ta chỉnh sửa file cấu hình của Packetbeat: # vi /etc/packetbeat/packetbeat.yml

Ở mục Kibana, bỏ dấu #, thay host: “192.168.1.5:5601” Ở mục Elasticsearch, đổi host: [“192.168.1.5:9200”] Sau khi đã cấu hình xong, sử dụng các lệnh:

# systemctl start packetbeat # systemctl enable packetbeat

Giờ qua bên máy chủ ELK, ta import index pattern tương tự Metricbeat. Chuyển qua mục Discover, ta sẽ nhìn thấy lượng log đổ về. Log này là log về lưu lượng mạng tại các cổng của máy chủ mà ta giám sát.

Muốn add Dashboard ta sử dụng câu lệnh sau (trên máy cài Packetbeat): # packetbeat setup --dashboards

Loaded dashboards

Với Packetbeat, ta có thể kiểm soát lưu lượng băng thông các host đang giám sát bằng cách sử dụng Dashboard Flows.

Sử dụng WinSCP đưa file RPM của Filebeat vào thư mục /opt.

Trở lại với hệ điều hành Centos 7, ta vào trong thư mục /opt nơi vừa chuyển file Filebeat RPM

# cd /opt

# yum localinstall filebeat-6.1.2-x86_64.rpm

Sau khi cài đặt xong, ta chỉnh sửa file cấu hình của Filebeat: # vi /etc/filebeat/filebeat.yml

Chuyển Enable: False => True

Ở mục Kibana, bỏ dấu #, thay đổi host: “192.168.1.5:5601” Ở mục Elasticsearch, đổi host: [“192.168.1.5:9200”]

Sau khi đã cấu hình xong, sử dụng các lệnh: # systemctl start filebeat

# systemctl enable filebeat

Giờ qua bên máy chủ ELK, ta import index pattern.

Chuyển qua mục Discover, ta sẽ nhìn thấy lượng log đổ về. Ở đây log sẽ đổ về từ Folder /var/log của hệ thống CentOS 7.

Để có thể khai thác thêm log, ta cấu hình bên trong file /etc/filebeat/filebeat.yml, trong mục paths phần Filebeat prospectors, ta sẽ điền thêm các đường dẫn tới các folder chứa log.

Để add Dashboard ta sử dụng câu lệnh sau (trên máy cài filebeat): # filebeat setup --dashboards

Loaded dashboards

Vậy là Filebeat đã có thể thu thập log từ hệ điều hành Linux, hay cả những loại log khác mà các Beats kia chưa thu thập được nếu có đường dẫn tới file đó.

5. Cài đặt Winlogbeat giám sát truy cập người dùng đến Active Directory, hệ điều hành Windows, Windows Defender Antivirus.

Sau khi tải Winlogbeat về, ta giải nén file zip vừa tải và lưu nó vào thư mực mình muốn. Ở đây ta sẽ lưu tại: C:\Program Files\winlogbeat

> cd “C:\Program Files\winlogbeat” > ./install-service-winlogbeat.ps1

Hình 3: Tệp Winlogbeat sau khi giải nén

Vào trong đường dẫn đã giải nén, tiến hành cấu hình file winlogbeat.yml trong C:\Program Files\winlogbeat\winlogbeat.yml

Ở mục Kibana, bỏ dấu #, thay host: “192.168.1.5:5601” Ở mục Elasticsearch, đổi host: [“192.168.1.5:9200”]

Sau đó vào services.msc, khởi động dịch vụ winlogbeat. Qua Kibana, add index pattern. Giờ ta add dashboards:

> cd “C:\Program Files\winlogbeat” > ./winlogbeat setup --dashboards

Vậy là Winlogbeat đã có thể đẩy log hệ điều hành Windows về ELK. Về log cảnh báo virus của Windows Defender Antivirus, nó được tích hợp sẵn trong log hệ điều hành của Windows. Để có thể thu thập log, ta vào C:\Program Files\winlogbeat\winlogbeat.yml, thêm ở dưới dòng ‘- name: System’:

- name: Microsoft-Windows-Windows Defender/Operational

Vậy là Winlogbeat sẽ lấy log của Window Defender Antivirus về máy chủ ELK. ID khi phát hiện ra Virus của Windows Defense Antivirus là 1116, ta có thể search và đặt cảnh báo dựa trên ID này.

Tuy nhiên, để kiểm soát được truy cập người dùng đến dịch vụ Active Directory. Đầu tiên, ta cần có máy chủ Windows đã cài đặt dịch vụ này. Sau đó vào lại file cấu hình winlogbeat.yml:

Ở mục Logstash, bỏ dấu # phía trước và đổi host [“192.168.1.5:9200”] Đặt dấu # phía trước mục host của Elasticsearch

Vậy là giờ Winlogbeat sẽ gửi qua cho Logstash chứ không còn gửi thẳng tới Elasticsearch

Cấu hình cho Logstash, việc cấu hình các bộ lọc (Filter) để xét các hoạt động truy cập dựa trên các log ID của bên Windows:

# vi /etc/logstash/conf.d/logstash-winlogbeat-monitor-user.conf input { beats { port => 5050 tags => [ "winlogbeat" ] }} filter { if "winlogbeat" in [tags] { mutate { gsub => ["[event_data][IpAddress]", "::ffff:", ""] }}} filter {

if "winlogbeat" in [tags] and [log_name] == "Security" and [event_id] == 4624 or [event_id] == 4634 {

mutate {

remove_field => ["[message]"]

add_field => { "short_message" => "Logon Activity" }

}}}

if "winlogbeat" in [tags] and [log_name] == "Security" and [event_id] == 4625 {

mutate {

remove_field => ["[message]"]

add_field => { "short_message" => "Logon Failure Activity" }

}}}

filter {

if "winlogbeat" in [tags] and [log_name] == "Security" and [event_id] == 4648 {

mutate {

remove_field => ["[message]"]

add_field => { "short_message" => "A logon was attempted using explicit credentials" }

}}}

filter {

if "winlogbeat" in [tags] and [log_name] == "Security" and [event_id] == 4727 {

mutate {

add_field => { "short_message" => "A security-enabled global group was created" }

}}

else if [event_id] == 4728 { mutate {

add_field => { "short_message" => "A member was added to a security-enabled global group" }

}}

else if [event_id] == 4729 { mutate {

add_field => { "short_message" => "A member was removed from a security-enabled global group" }

}}

else if [event_id] == 4730 { mutate {

add_field => { "short_message" => "A security-enabled global group was deleted" }

}}

else if [event_id] == 4731 { mutate {

add_field => { "short_message" => "A security-enabled local group was created" }

}}

else if [event_id] == 4732 { mutate {

add_field => { "short_message" => "A member was added to a security-enabled local group" }

}}

else if [event_id] == 4733 { mutate {

add_field => { "short_message" => "A member was removed from a security-enabled local group" }

}}

else if [event_id] == 4734 { mutate {

add_field => { "short_message" => "A security-enabled local group was deleted" }

mutate {

add_field => { "short_message" => "A security-enabled local group was changed" }

}}

else if [event_id] == 4737 { mutate {

add_field => { "short_message" => "A security-enabled global group was changed" }

}}

else if [event_id] == 4754 { mutate {

add_field => { "short_message" => "A security-enabled universal group was created" }

}}

else if [event_id] == 4755 { mutate {

add_field => { "short_message" => "A security-enabled universal group was changed" }

}}

else if [event_id] == 4756 { mutate {

add_field => { "short_message" => "A member was added to a security-enabled universal group" }

}}

else if [event_id] == 4757 { mutate {

add_field => { "short_message" => "A member was removed from a security-enabled universal group" }

else if [event_id] == 4758 { mutate {

add_field => { "short_message" => "A security-enabled universal group was deleted" }

}}

else if [event_id] == 4764 { mutate {

add_field => { "short_message" => "A group's type was changed" }

}}}

filter {

if "winlogbeat" in [tags] and [log_name] == "Security" and [event_data][LogonType] == "2" {

mutate {

add_field => { "Method" => "Interactive - Keyboard" }

}}

else if [event_data][LogonType] == "3" { mutate {

add_field => { "Method" => "Network Logon" }

}}

else if [event_data][LogonType] == "4" { mutate {

add_field => { "Method" => "Batch - Scheduled Task" }

}}

else if [event_data][LogonType] == "5" { mutate {

add_field => { "Method" => "Service Account" }

}}

add_field => { "Method" => "Unlock System" }

}}

else if [event_data][LogonType] == "8" { mutate {

add_field => { "Method" => "NetworkCleartext" }

}}

else if [event_data][LogonType] == "9" { mutate {

add_field => { "Method" => "NewCredentials" }

}}

else if [event_data][LogonType] == "10" { mutate {

add_field => { "Method" => "RemoteInteractive" }

}}

else if [event_data][LogonType] == "11" { mutate {

add_field => { "Method" => "CachedInteractive" }

}}

else if [event_data][LogonType] == "0" { mutate {

add_field => { "Method" => "System Account" }

}}}

filter {

if "winlogbeat" in [tags] and [log_name] == "Security" and [event_data][Status] == "0x0" {

mutate {

add_field => { "Statusmsg" => "Success" }

else if [event_data][Status] == "0x12" { mutate {

add_field => { "Statusmsg" => "Account: disabled,expired,locked out,logon hours" }

}}

else if [event_data][Status] == "0xB" { mutate {

add_field => { "Statusmsg" => "Request start time is later than end time" }

}}

else if [event_data][Status] == "0x17" { mutate {

add_field => { "Statusmsg" => "Password has expired" }

}}

else if [event_data][Status] == "0x18" { mutate {

add_field => { "Statusmsg" => "Bad password" }

}}

else if [event_data][Status] == "0x1b" { mutate {

add_field => { "Statusmsg" => "Server principal valid for user-to-user only" }

}}

else if [event_data][Status] == "0x1d" { mutate {

add_field => { "Statusmsg" => "A service is not available." }

}}

add_field => { "Statusmsg" => "Ticket expired- Frequently logged by computer accounts" }

}}

else if [event_data][Status] == "0x25" { mutate {

add_field => { "Statusmsg" => "Workstation’s clock out of sync with the DC" }

}}

else if [event_data][Status] == "0x6" { mutate {

add_field => { "Statusmsg" => "Username does not exist or has not replicated" }

}}

else if [event_data][Status] == "0xc000006a" { mutate {

add_field => { "Statusmsg" => "Incorrect Password" }

}}

else if [event_data][Status] == "0xc0000064" { mutate {

add_field => { "Statusmsg" => "Username Does Not Exist" }

}}

else if [event_data][Status] == "0xc0000072" { mutate {

add_field => { "Statusmsg" => "Account is disabled" }

}}

else if [event_data][Status] == "0xc0000234" { mutate {

add_field => { "Statusmsg" => "Account is Locked Out" }

else if [event_data][Status] == "0xc0000193" {

Một phần của tài liệu (LUẬN văn THẠC sĩ) nghiên cứu giải pháp tập trung và ứng dụng quản lý hệ thống mạng trường đại học hà nội (Trang 56 - 82)