SIEM/Log Management [SIEM/Log Management] Wazuh tích hợp Opensearch + Vector thu thập log Sophos Firewall

1. Cài Sophos Firewall thông qua ovf
Link tải: https://www.sophos.com/en-us/support/downloads/firewall-installers
Sử dụng 4 file như trên hình:

1758251906615.png


Chọn Deploy OVF Templates:

1758251934979.png


Upload 4 file vào:

1758251950694.png


Tiếp theo cứ chọn mặc định
Khi cài xong lần đầu đăng nhập với password mặc định là: admin
Ấn “a” để tiếp tục

1758251974881.png


Chọn 1 để cấu hình lại địa chỉ IP LAN để cấu hình thông qua web:

1758251997282.png


Nhập “y” để set địa chỉ IPv4 cho port LAN:

1758252030773.png


Đặt lại mật khẩu mới để đăng nhập:

1758252047508.png


Chọn Continue offline:

1758252081792.png


Set Name và Time Zone:

1758252095421.png


Tick “Opt in …”

1758252115375.png


Tắt DHCP:

1758252133772.png


1758252145000.png


1758252156901.png


Đợi restart, sau đó đăng nhập với username và password đã đặt lại:

1758252187102.png


1758252205443.png


Tiến hành tạo rule để LAN có thể ra ngoài Internet: Rules and policies > Add firewall rule > New firewall rule

1758252250276.png


Chọn “Create linked NAT rule”: Chỉnh Translated source (SNAT) là MASQ

1758252275392.png


Sau đó ấn Save và rule được tạo thành công.
Trên máy Client đặt default gateway thành địa chỉ IP LAN của firewall:

1758252311165.png


Test ping đến google.com:

1758252328368.png


Cấu hình cơ bản thành công.

2. Thu thập log Firewall

Vào System services > Log settings > Add

1758252383705.png


File vector.yaml:

data_dir: "/vector-data-dir"

api:
enabled: true
address: "0.0.0.0:8686"

sources:
wazuh_logs:
type: file
include:
- "/var/log/wazuh/archives.json"
ignore_older: 0

sophos_syslog:
type: socket
mode: udp
address: "0.0.0.0:514"

transforms:
parse_json_message:
type: remap
inputs: ["wazuh_logs"]
source: |
. = parse_json!(.message)

ensure_index_and_tags:
type: remap
inputs: ["parse_json_message"]
source: |
.index_name = "wazuh-manager"
.received_at = now()
if !exists(.source_type) { .source_type = "agent" }

parse_sophos_logs:
type: remap
inputs:
- sophos_syslog
source: |
.raw_message = to_string!(.message)

.index_name = "sophos_firewall"
.received_at = now()
.source_type = "sophos"

match, err = parse_regex(.raw_message, r'src_ip="?(?P<src_ip>\S+)"?')
if err == null { .src_ip = match.src_ip }

match2, err = parse_regex(.raw_message, r'dst_ip="?(?P<dst_ip>\S+)"?')
if err == null { .dst_ip = match2.dst_ip }

match3, err = parse_regex(.raw_message, r'protocol="?(?P<protocol>\S+)"?')
if err == null { .protocol = match3.protocol }

match4, err = parse_regex(.raw_message, r'fw_rule_name="(?P<rule_name>[^"]+)"')
if err == null { .fw_rule_name = match4.rule_name }

sinks:
# Sink cho cả Wazuh & Sophos
opensearch_sink:
type: elasticsearch
inputs: ["ensure_index_and_tags", "parse_sophos_logs"]
endpoints:
- "https://opensearch-node1:9200"
- "https://opensearch-node2:9200"
api_version: "v7"
bulk:
index: "{{ index_name }}"
request:
concurrency: 2
auth:
strategy: basic
user: admin
password: "Chinh123@"
tls:
verify_certificate: false
verify_hostname: false

console_out:
type: console
inputs: ["ensure_index_and_tags", "parse_sophos_logs"]
encoding:
codec: json

Sau đó restart lại container vector đã thấy log firewall:

1758252433781.png
 

Đính kèm

  • 1758252009434.png
    1758252009434.png
    95.4 KB · Lượt xem: 0
Back
Top