얼마전 SOC 플랫폼 고도화를 고민중 심플하게 보안 이벤트 발생시 게시판에 자동으로 등록되도록 하는 방법을 고민하다 Nodebb라는 오픈소스를 알아보게 되었습니다.
하기 설정은 Elasticsearch 에 보안이벤트가 저장되고 Elastalert으로 알람을 설정후 API를 통해 Nodebb Topic 게시판에 자동으로 글을 쓰게 하는 방법입니다.
Elastalert .yaml 설정 핵심
alert:
– post2
post2:
http_post2_url: “http://10.x.x.5:4567/api/v3/topics”
http_post2_ignore_ssl_errors: true
http_post2_payload: |
{
“title”: “APT Nodebb 테스트 Rule”,
“content”: {{
(
“Count : ” ~ (num_matches | default(“N/A”)) ~ “\n\n” ~
“Time Stamp : ” ~ (match[‘@timestamp’] | default(“N/A”)) ~ “\n” ~
“Device Hostname : ” ~ (deviceHostName | default(“N/A”)) ~ “\n\n” ~
“threatType : ” ~ (threatType | default(“N/A”)) ~ “\n” ~
“threatAction : ” ~ (threatAction | default(“N/A”)) ~ “\n” ~
“detectName : ” ~ (detectName | default(“N/A”)) ~ “\n\n” ~
“Source Country : ” ~ (source.country_code2 | default(“N/A”)) ~ “\n” ~
“Source Address : ” ~ (sourceAddress | default(“N/A”)) ~ “\n” ~
“Source Port : ” ~ (sourcePort | default(“N/A”)) ~ “\n\n” ~
“Destination Country: ” ~ (destination.country_code2 | default(“N/A”)) ~ “\n” ~
“Destination Address: ” ~ (destinationAddress | default(“N/A”)) ~ “\n” ~
“Destination Port : ” ~ (destinationPort | default(“N/A”)) ~ “\n\n” ~
“Protocol : ” ~ (applicationProtocol | default(“N/A”)) ~ “\n” ~
“Rule Name : ” ~ (name | default(“N/A”)) ~ “\n” ~
“Request URL : ” ~ (requestUrl | default(“N/A”)) ~ “\n\n” ~
“Response : ” ~ “http://10.100.112.55:4567/topic/17/apt-%EC%9C%84%ED%98%91-%ED%83%90%EC%A7%80-%EC%95%85%EC%84%B1%EC%BD%94%EB%93%9C-%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-%ED%83%90%EC%A7%80-rule-%EC%A0%95%EC%9D%98-%EB%B0%8F-%EB%8C%80%EC%9D%91-%EB%B0%A9%EB%B2%95”
) | tojson
}},
“cid”: 2
}
http_post2_headers: |
{
“Authorization”: “Bearer f567a3xx-xxxx-4aad-xxxx-01aff27d0dcc”,
“Content-Type”: “application/json”
}
위와 같이 설정을 완벽하게 한다면 다음과 같이 Nodebb 게시판에 보안 이벤트 알람이 자동으로 등록되게 됩니다.

이와 같이 중요한 보안 알람 이벤트에 대해서 자동으로 게시판에 등록되도록 하고 처리 과정은 댓글 형태로 이력을 남긴다면 자동으로 티켓 형태로도 관리가 가능하며, 일별 주별 월별 처리 통계 자료도 확보할수 있습니다.