[Beats] Install Packetbeat and run on Ubuntu

Packetbeat란?

네트워크 트래픽을 모니터링하는 것은 통합 가시성을 확보하고 환경 보안을 유지하여 높은 수준의 성능과 보안을 보장하는 데 있어 매우 중요합니다. Packetbeat는 호스트와 컨테이너의 데이터를 Logstash 또는 Elasticsearch로 전송하는 경량 네트워크 패킷 분석기입니다. 


설치

공개 서명 키를 다운로드하고 설치

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

apt-transport-https Debian에 패키지 를 설치

sudo apt-get install apt-transport-https

저장소 정의를 /etc/apt/sources.list.d/elastic-7.x.list으로 저장

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

packetbeat 설치

sudo apt-get update && sudo apt-get install packetbeat

파일 수정

경로

nano /etc/packetbeat/packetbeat.yml

밑에 kibana 부분 주석 해체 수정

# =================================== Kibana ===================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  host: "localhost:5601" # 주석 해체

  # Kibana Space ID
  # ID of the Kibana Space into which the dashboards should be loaded. By default,
  # the Default Space will be used.
  #space.id:

만약 elasticsearch 보안기능이 활성화 되어 있을 경우 username, password 입력

# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["localhost:9200"]

  # Protocol - either `http` (default) or `https`.
  #protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  #username: "elastic"
  #password: "password"

packetbeat 서비스 시작 및 서버 부팅시 동시 시작하기

systemctl start packetbeat && systemctl enable packetbeat

Kibana 접속후 확인

Kibana -> Dashborad

원하는 네트워크 패킷 다양한 차트, 표를 통해 분석

답글 남기기

이메일 주소는 공개되지 않습니다.