본문 바로가기
OffSec

[Blue Teams Academy] 모듈 23 - Azure Sentinel - Filebeat 및 Logstash로 이벤트 전송

by 10th doctrine 2021. 3. 19.
728x90

Azure Sentinel에 대한 파일비트 로그스트

이 새로운 게시물에서는 Filebeat와 Logstash를 사용하여 Azure Sentinel에 이벤트/로그를 보내는 방법에 대해 알아보려고 한다.

 

 

파일비트 설치 및 구성 방법:

 

 

파일 비트는 여기에서 다운로드할 수 있다: https://www.elastic.co/downloads/beats/filebeat

파일 비트를 설치하려면 다음 명령을 실행하십시오(내 경우 Ubuntu 18에서).

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list sudo apt update sudo apt install filebeat

파일 비트는 다음과 같은 일부 로그 모듈과 함께 제공됨

예를 들어 시스템 모듈을 활성화하십시오.

sudo filebeat modules enable system

구성 파일 편집:

sudo vi /etc/filebeat/filebeat.yml

주석 Elasticsearch Output 섹션 및 압축 해제 로그스타시 출력:

파일비트 시작

sudo service filebeat start

상태 유형을 확인하려면:

sudo service filebeat status

Logstash 설치 및 구성 방법

Logstash는 다양한 소스에서 데이터를 수집하여 변환한 다음 즐겨찾는 "스태시"로 전송하는 무료 오픈 서버 측 데이터 처리 파이프라인(소스: 탄성.하와이 말똥가리)

로그스타시는 https://www.elastic.co/downloads/logstash에서 다운로드할 수 있다.

sudo apt install -y openjdk-8-jdk sudo apt-get install logstash

/etc/logstash/conf.d/ 입력

cd /etc/logstash/conf.d/

새 구성 파일 생성:

sudo vi Azure-Sentinel.conf

다음 내용을 추가하다.

input { beats { port => "5044" } } filter { } output { microsoft-logstash-output-azure-loganalytics { workspace_id => "<your workspace id>" workspace_key => "<your workspace key>" custom_log_table_name => "tableName" } }

자세한 구성은 https://docs.microsoft.com/en-us/azure/sentinel/connect-logstash에서 확인할 수 있다.

로그스트래시 시작

sudo service logstash start

이제 테이블 이름을 선택하여 이벤트를 쿼리할 수 있음

 

더보기

Module 23 - Azure Sentinel - Send Events with Filebeat and Logstash

Filebeat Logstash to Azure Sentinel

In this new post we are going to explore how to send events/logs to Azure Sentinel using Filebeat and Logstash.

 

 

How to install and Configure Filebeat:

 

 

Filebeat can be downloaded from here: https://www.elastic.co/downloads/beats/filebeat

To install filebeat run the following commands (on Ubuntu 18 in my case)

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list sudo apt update sudo apt install filebeat

Filebeat comes with some available log modules such as the following modules

For example, let's enable the system module:

sudo filebeat modules enable system

Edit the config file:

sudo vi /etc/filebeat/filebeat.yml

Comment Elasticsearch Output section and uncomment Logstash output:

Start Filebeat

sudo service filebeat start

To check its status type:

sudo service filebeat status

How to install and Configure Logstash

Logstash is a free and open server-side data processing pipeline that ingests data from a multitude of sources, transforms it, and then sends it to your favorite "stash." (Source: Elastic.io)

Logstash can be downloaded from here: https://www.elastic.co/downloads/logstash

sudo apt install -y openjdk-8-jdk sudo apt-get install logstash

Enter /etc/logstash/conf.d/

cd /etc/logstash/conf.d/

Create a new config file:

sudo vi Azure-Sentinel.conf

add the folllowing content

input { beats { port => "5044" } } filter { } output { microsoft-logstash-output-azure-loganalytics { workspace_id => "<your workspace id>" workspace_key => "<your workspace key>" custom_log_table_name => "tableName" } }

More configurations can be found here: https://docs.microsoft.com/en-us/azure/sentinel/connect-logstash

Start logstash

sudo service logstash start

Now you can query events by selecting the table name

 

 

※ 출처 : Blue Teams Academy | www.blueteamsacademy.com/filebeat/

반응형

댓글