HƯỚNG DẪN CẤU HÌNH ĐẨY LOG JUNIPE SRX
Môi trường LAB như sau:
- IP của thiết bị JUNIPER SRX cần đẩy log: 10.121.254.252
- Cần đẩy log tới: 10.72.144.85(Log server)
- Traffic log (Security Policy Logs): Sử dụng UDP:5515 để đẩy log tới Log server.
- Syslog: Sử dụng UDP:5525 để đẩy log tới Log Server.
- Date and time of the message
- Message type (session-init or session-close)
- Source address and port number
- Destination address and port number
- IP information
- Session index (sid)
- Policy index (pid)
- Bytes sent and received
- Session duration
1.Kiểm tra trước khi tiến hành cấu hình
Trước khi thực hiện cấu hình đẩy log, sử dụng một số câu lệnh sau để kiểm tra cấu hình đã có trên Juniper SRX.
Kiểm tra cấu hình syslog
>show configuration system syslog
![1625458712576.png 1625458712576.png](https://cdn-test.securityzone.vn/2021/07/3033_61b0c058e1485dd56e3fd582c7f77620.png)
Kiểm tra cấu hình traffic log(security log):
>show configuration security log
![1625458722796.png 1625458722796.png](https://cdn-test.securityzone.vn/2021/07/3034_86253b4384c1380a2e418688c99f8341.png)
Kiểm tra kết nối trước khi tiến hành cấu hình đẩy log:
>ping 10.72.144.185 source 10.121.254.252
![1625458730865.png 1625458730865.png](https://cdn-test.securityzone.vn/2021/07/3035_059c01c830a059e52e68b3aca8b59551.png)
Nếu kết nối thành công từ SRX tới Log Server, tiến hành thực hiện cấu hình đẩy log từ SRX về Log Server
2.Cấu hình Traffic log(Security Policy Logs)
2.1 Cấu hình đẩy Traffic log
Để thực hiện cấu hình, vào mode configure:
>configure
![1625458748964.png 1625458748964.png](https://cdn-test.securityzone.vn/2021/07/3036_2ef49865ff0372bf9a03f1d284199cc0.png)
Active Security Log:
#activate security log
![1625458757925.png 1625458757925.png](https://cdn-test.securityzone.vn/2021/07/3037_5031e04b62f3e8521048b0215c8ff273.png)
Sử dụng các câu lệnh dưới đây để cấu hình đẩy Traffic log (security policy logs):
#set security log mode stream
#set security log format sd-syslog
#set security log source-address 10.121.254.252
#set security log stream securitylog host 10.72.144.185 port 5515
![1625458770542.png 1625458770542.png](https://cdn-test.securityzone.vn/2021/07/3038_cca73b087d408950c0a990402b9c2afa.png)
2.2 Kiểm tra và Commit cấu hình
Kiểm tra trước khi commit:
#commit check
![1625458783337.png 1625458783337.png](https://cdn-test.securityzone.vn/2021/07/3039_7f4190b9b580163da46d69bac1bf21db.png)
Sau khi commit check thành công, tiến hành Commit confirm 5 phút:
#commit confirm 5
![1625458792680.png 1625458792680.png](https://cdn-test.securityzone.vn/2021/07/3040_76656cd01c0018ba4c339321287304ee.png)
Trong quá trình Comit confirm, theo dõi hệ thống, nếu không xảy ra lỗi, tiến hành commit cấu hình:
#commit
![1625458800269.png 1625458800269.png](https://cdn-test.securityzone.vn/2021/07/3041_6b94aad2b20fa5c6ea407663b9ff8e6e.png)
3.Cấu hình đẩy Syslog
3.1 Cấu hình đẩy Syslog
Để thực hiện cấu hình, vào mode configure:
>configure
![1625458809465.png 1625458809465.png](https://cdn-test.securityzone.vn/2021/07/3042_61b2417d0541b0acfe7a6c69f044d46f.png)
Active Syslog Log:
#activate system syslog
![1625459037905.png 1625459037905.png](https://cdn-test.securityzone.vn/2021/07/3043_dd711fd582933da467c9d7744cf4c7f0.png)
Sử dụng các câu lệnh dưới đây để cấu hình đẩy Traffic log (security policy logs):
#set system syslog host 10.72.144.185 any any
#set system syslog host 10.72.144.185 port 5525
#set system syslog host 10.72.144.185 source-address 10.121.254.252
#set system syslog host 10.72.144.185 structured-data
![1625459042739.png 1625459042739.png](https://cdn-test.securityzone.vn/2021/07/3044_031c6daea30113468aae9b0f71bb5954.png)
3.2 Kiểm tra và Commit cấu hình
Kiểm tra trước khi commit:
#commit check
![1625459048300.png 1625459048300.png](https://cdn-test.securityzone.vn/2021/07/3045_cac18203ed55804416f3a496a62cada4.png)
Sau khi commit check thành công, tiến hành Commit confirm 5 phút:
#commit confirm 5
![1625459055661.png 1625459055661.png](https://cdn-test.securityzone.vn/2021/07/3046_8519bc6f0cf8571faf753cd12c5459b3.png)
Trong quá trình Comit confirm, theo dõi hệ thống, nếu không xảy ra lỗi, tiến hành commit cấu hình:
#commit
![1625459065208.png 1625459065208.png](https://cdn-test.securityzone.vn/2021/07/3047_66e287156b646b335e56d6ef316b958e.png)
4.Một số câu lệnh hỗ trợ kiểm tra cấu hình
Hiển thị toàn bộ các câu lệnh đã được sử dụng để cấu hình thiết bị:
>show configuration | display set
![1625459092933.png 1625459092933.png](https://cdn-test.securityzone.vn/2021/07/3050_db56929c212e288453078d0c7b0bf205.png)
Nếu cấu hình dài, để thoát, ấn tổ hợp phím (Ctrl + C)
Hiển thị cấu hình Syslog:
>show configuration system syslog
![1625459103973.png 1625459103973.png](https://cdn-test.securityzone.vn/2021/07/3051_3585b16e809d92b393a9084387328d10.png)
Hiển thị cấu hình Traffic log(Security Policy log):
>show configuration security log
![1625459114451.png 1625459114451.png](https://cdn-test.securityzone.vn/2021/07/3052_e56445e0491035ab7e3c55b99cd88b7f.png)