SlideShare a Scribd company logo
writeimtiaz@gmail.com
https://imtiazrahman.com
12-14 October, 2020
Virtual Event
12
Log analysis with
stack
Logs
syslog
NETFLOW
METRIC
SNMP
Audit
DNS
http
ids
What is Elastic Stack ?
User Interface
Store, Analyze
Ingest
Log analysis with elastic stack
a full-text based, distributed NoSQL database.
Written in Java, built on Apache Lucene
Commonly used for log analytics, full-text search, security
intelligence, business analytics, and operational intelligence
use cases.
Use REST API (GET, PUT, POST, and DELETE ) for storing and searching data
Data is stored as documents
Data is separated into fields
(rows in relational database)
(columns in relational database)
Relational Database Elasticsearch
Database Index
Table Type
Row/Record Document
Column Name Field
Terminology
Cluster: A cluster consists of one or more nodes
which share the same cluster name.
Node: A node is a running instance of elasticsearch
which belongs to a cluster.
Terminology
Index: Collection of documents
Shard: An index is split into elements known as
shards that are distributed across multiple nodes.
There are two types of shard, Primary and replica.
By default elasticsearch creates 1 primary shard
and 1 replica shard for each index.
Terminology
Shard 1
Replica 2
Replica 1
Shard 2
Node 1 Node 2
cluster
Documents
• Indices hold documents in
serialized JSON objects
• 1 document = 1 log entry
• Contains "field : value" pairs
• Metadata
• _index – Index the document
belongs to
• _id – unique ID for that log
• _source – parsed log fields
Terminology
{
"_index": "netflow-2020.10.08",
"_type": "_doc",
"_id": "ZwkiB3UBULotwSOX3Bdb",
"_version": 1,
"_score": null,
"_source": {
"@timestamp": "2020-10-08T07:35:32.000Z”,
"host": "172.20.0.1",
"netflow": {
"ipv4_dst_addr": "103.12.179.136",
"l4_dst_port": 80,
"src_tos": 0,
"l4_src_port": 53966,
"ipv4_src_addr": ”192.168.110.18",
"application_id": "13..0",
"version": 9,
Index creation
netflow-2020.10.08 netflow-2020.10.09
syslog-2020.10.08 syslog-2020.10.09
Shards and Documents
Index Shards Documents
Installation
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch
| sudo apt-key add -
Install JAVA
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 elasticsearch
configuration
/usr/share/elasticsearch/config/elasticsearch.yml
Location and the config file
Key configuration elements
node.name: es01
cluster.name: training
discovery.seed_hosts: es02
cluster.initial_master_nodes: es01,es02
network.host: 0.0.0.0
[root@4f8cd6658b1b elasticsearch]# curl http://localhost:9200
{
"name" : "es01",
"cluster_name" : ”training",
"cluster_uuid" : "vE9SZr8oRFK0A0HTq9U_oA",
"version" : {
"number" : "7.7.0",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "81a1e9eda8e6183f5237786246f6dced26a10eaf",
"build_date" : "2020-05-12T02:01:37.602180Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
[root@4f8cd6658b1b elasticsearch]#
Log analysis with elastic stack
Free, developed and maintained by Elastic
Integrates with Beats
Integrates with Elasticsearch
Tons of plugins
Logstatsh has three stages
INPUT
FILTER
OUTPUT
input {
tcp {
port => 5002
type => "syslog"
}
}
filter {
if [type] == "syslog" {
grok {
}
}
}
output {
if [type] == "syslog" {
elasticsearch {
hosts => "http://es01:9200"
index => "syslog-%{+YYYY.MM.dd}"
}
}
}
beats, file, syslog,
udp, snmp,
etc…
http, kv,
xml, json,
etc…
csv, file,
http, stdout,
etc….
.conf
Grok is a great way to parse unstructured log data into
something structured and queryable.
The syntax for a grok pattern is %{SYNTAX:SEMANTIC}
SYNTAX: is the name of the pattern that will match your text
SEMANTIC: is the identifier to the piece of text being matched
Grok Example
192.168.8.1 GET /index.html 15824 0.04
%{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes} %{NUMBER:duration}
{
"duration": "0.04",
"request": "/index.html",
"method": "GET",
"bytes": "15824",
"client": "192.168.8.1"
}
raw log
grok pattern
output
Grok Debugger
Installation
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch
| sudo apt-key add -
Install JAVA
sudo apt-get install apt-transport-https
sudo apt update
sudo apt install logstash
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main"
| sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
Log analysis with elastic stack
Logs for single host
Command line logs
• cat
• tail
• grep
• vi/ vim/ nano /event viewer
Log analysis with elastic stack
• Multiple source
• Corelating
• Seraching, filtering
• Visualize
Not available on cli
is for visualization
Installation
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch
| sudo apt-key add -
sudo apt-get install apt-transport-https
sudo apt update
sudo apt install kibana
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main"
| sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
/usr/share/kibana/config/kibana.yml
Location and the config file
Key configuration elements
server.name: kibana
server.host: "0"
elasticsearch.hosts:
- http://es01:9200
- http://es02:9200
configuration
http://<YOUR_KIBANA_HOST>:5601
Security (TLS, RBAC)
vim /usr/share/elasticsearch/config/elasticsearch.yml
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.keystore.type: PKCS12
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.type: PKCS12
bin/elasticsearch-certutil ca
bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 PKCS12
bin/elasticsearch-setup-passwords auto/interactive
Setup password for built-in users
Changed password for user apm_system
PASSWORD apm_system = JreXXXXXXXXXXXXXDm2F
Changed password for user kibana
PASSWORD kibana = YKvXXXXXXXXXXXXXiCZ
Changed password for user logstash_system
PASSWORD logstash_system = jUcXXXXXXXXXXXXXNkP
Changed password for user beats_system
PASSWORD beats_system = uAkXXXXXXXXXXXXXv42
Changed password for user remote_monitoring_user
PASSWORD remote_monitoring_user = 9LdXXXXXXXXXXXXXlKC
Changed password for user elastic
PASSWORD elastic = GUdXXXXXXXXXXXXX8Ze
Security (TLS, RBAC)
Security
#elasticsearch.username: “kibana”
#elasticsearch.password: “password”
vim config/kibana.yml
http://<YOUR_KIBANA_HOST>:5601
Log analysis with elastic stack
Lightweight data shippers
install as agents on your servers
Available in Linux/Windows/Mac
Auditbeat
Filebeat
Heartbeat
Metricbeat
Packetbeat
Winlogbeat
Installation (Auditbeat)
curl -L -O https://artifacts.elastic.co/downloads/beats/auditbeat/auditbeat-
7.7.0-amd64.deb
sudo dpkg -i auditbeat-7.7.0-amd64.deb
output.elasticsearch:
hosts: ["es_host:9200"]
username: "elastic"
password: "<password>"
setup.kibana:
host: ”http://kibana_host:5601"
Download and install
Edit configuration (/etc/auditbeat/auditbeat.yml)
Installation (Auditbeat)
sudo auditbeat setup
sudo service auditbeat start
Start auditbeat
Alerting
Elastalert
Elastalert
ElastAlert is a simple framework for alerting on anomalies, spikes,
or other patterns of interest from data in Elasticsearch.
X events in Y time (frequency type)
rate of events increases or decreases" (spike type)
matches a blacklist/whitelist" (blacklist and whitelist type)
less than X events in Y time" (flatline type)
Email, JIRA, HipChat, MS Teams, Slack, Telegram etc..
Elastalert Installation
sudo git clone https://github.com/Yelp/elastalert.git
sudo pip install "setuptools>=11.3"
sudo python setup.py install
sudo pip install "elasticsearch>=5.0.0"
sudo apt-get install python-minimal
sudo apt-get install python-pip python-dev libffi-dev libssl-dev
Elastalert configuration
vim /opt/elastalert/config.yaml
es_host: elk-server
es_port: 9200
es_username: es_user
es_password: password
sudo elastalert-create-index
Demo
1. Run and explore Elastic Stack with docker-compose
2. Install, configure “Auditbeat” and send the logs to the Elastic SIEM
3. Configure FIM in Auditbeat
4. Alerting log event using elastalert to slack channel
Thank You
writeimtiaz@gmail.com
https://imtiazrahman.com
? ? ?

More Related Content

PPTX
Elastic stack Presentation
PDF
Introduction to elasticsearch
PPTX
Elastic Stack Introduction
PPTX
Centralized log-management-with-elastic-stack
PPTX
The Elastic ELK Stack
ODP
Deep Dive Into Elasticsearch
PDF
Elk - An introduction
PPTX
Introduction to Elasticsearch with basics of Lucene
Elastic stack Presentation
Introduction to elasticsearch
Elastic Stack Introduction
Centralized log-management-with-elastic-stack
The Elastic ELK Stack
Deep Dive Into Elasticsearch
Elk - An introduction
Introduction to Elasticsearch with basics of Lucene

What's hot (20)

PPTX
PPTX
ElasticSearch Basic Introduction
PPTX
ELK Stack
PDF
Introduction to elasticsearch
PDF
What Is ELK Stack | ELK Tutorial For Beginners | Elasticsearch Kibana | ELK S...
PDF
ELK Stack
PPTX
Elastic search overview
PPTX
Log analysis using elk
PPTX
quick intro to elastic search
PPTX
Elastic - ELK, Logstash & Kibana
PDF
Elasticsearch in Netflix
PDF
Introduction to Elasticsearch
PPTX
Introduction to ELK
PDF
OSMC 2021 | Introduction into OpenSearch
PPTX
ElasticSearch : Architecture et Développement
PPTX
Log management with ELK
PPTX
Leveraging Neo4j With Apache Spark
PDF
Log analysis with the elk stack
PDF
Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...
PDF
ELK introduction
ElasticSearch Basic Introduction
ELK Stack
Introduction to elasticsearch
What Is ELK Stack | ELK Tutorial For Beginners | Elasticsearch Kibana | ELK S...
ELK Stack
Elastic search overview
Log analysis using elk
quick intro to elastic search
Elastic - ELK, Logstash & Kibana
Elasticsearch in Netflix
Introduction to Elasticsearch
Introduction to ELK
OSMC 2021 | Introduction into OpenSearch
ElasticSearch : Architecture et Développement
Log management with ELK
Leveraging Neo4j With Apache Spark
Log analysis with the elk stack
Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...
ELK introduction
Ad

Similar to Log analysis with elastic stack (20)

PPTX
Attack monitoring using ElasticSearch Logstash and Kibana
PDF
Null Bachaav - May 07 Attack Monitoring workshop.
PPTX
Managing Your Security Logs with Elasticsearch
PPTX
The Elastic Stack as a SIEM
PDF
The elastic stack on docker
PDF
ELK stack introduction
PDF
2015 03-16-elk at-bsides
PPT
How ElasticSearch lives in my DevOps life
PDF
Setting ELK in 10 minutes on Windows locally
PPTX
It Shore Beats Working: Configuring Elasticsearch to get the Most out of Clo...
PPT
Elk presentation1#3
PPTX
Log analysis using Logstash,ElasticSearch and Kibana
PPTX
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014
PPT
'Scalable Logging and Analytics with LogStash'
PPTX
ELK-Stack-Grid-KA-School.pptx
PPTX
Intro elasticsearch taswarbhatti
PDF
Elastic 101 tutorial - Percona Europe 2018
PDF
Elastic101tutorial Percona Live Europe 2018
PDF
elkstack-161217091231.pdf
PPTX
Deploying E.L.K stack w Puppet
Attack monitoring using ElasticSearch Logstash and Kibana
Null Bachaav - May 07 Attack Monitoring workshop.
Managing Your Security Logs with Elasticsearch
The Elastic Stack as a SIEM
The elastic stack on docker
ELK stack introduction
2015 03-16-elk at-bsides
How ElasticSearch lives in my DevOps life
Setting ELK in 10 minutes on Windows locally
It Shore Beats Working: Configuring Elasticsearch to get the Most out of Clo...
Elk presentation1#3
Log analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and Kibana - Desert Code Camp 2014
'Scalable Logging and Analytics with LogStash'
ELK-Stack-Grid-KA-School.pptx
Intro elasticsearch taswarbhatti
Elastic 101 tutorial - Percona Europe 2018
Elastic101tutorial Percona Live Europe 2018
elkstack-161217091231.pdf
Deploying E.L.K stack w Puppet
Ad

More from Bangladesh Network Operators Group (20)

PDF
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
PDF
IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)
PDF
Fast Reroute in SR-MPLS by Md Abdullah Al Naser
PDF
DDoS Mitigation Strategies by Md. Abdul Awal
PDF
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
PDF
Optics101 for non-Optical (IP) folks by Tashi Phuntsho
PPTX
The Internet Service Providers and Connectivity Providers of ICANN
PPTX
Integration of AI and GenAI in Education and beyond
PPTX
Strengthening Cyber Security with Tools and Human Expertise
PDF
Mental Health and Workplace Culture in Tech:A Personal Perspective
PDF
Network Efficiency:The LLM Advantage on network infrastructures
PDF
Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...
PPTX
BDNOG17 Plenary Session, Security Concerns: A perspective in Smart Bangladesh
PPTX
Maximizing Network Efficiency with Large Language Models (LLM)
PPTX
Geolocation and Geofeed Implementation bdNOG18
PDF
Data Centre Design Consideration for Bangladesh
PDF
DNS Troubleshooting - Assumptions and Problem Breakdown
PPTX
Team Cymru Community Services,Overview of all public services
PPTX
Open Source TCP or Netflow Log Server Using Graylog
PPTX
Enhancing seamless access using TIGERfed
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
IPv6 Mostly Experience at APRICOT by Yoshinobu Matsuzaki (IIJ)
Fast Reroute in SR-MPLS by Md Abdullah Al Naser
DDoS Mitigation Strategies by Md. Abdul Awal
DNS & DNSSEC operational best practices - Sleep better at night with KINDNS i...
Optics101 for non-Optical (IP) folks by Tashi Phuntsho
The Internet Service Providers and Connectivity Providers of ICANN
Integration of AI and GenAI in Education and beyond
Strengthening Cyber Security with Tools and Human Expertise
Mental Health and Workplace Culture in Tech:A Personal Perspective
Network Efficiency:The LLM Advantage on network infrastructures
Utilizing Free and open-source Technology and Achieve Next Generation Enterpr...
BDNOG17 Plenary Session, Security Concerns: A perspective in Smart Bangladesh
Maximizing Network Efficiency with Large Language Models (LLM)
Geolocation and Geofeed Implementation bdNOG18
Data Centre Design Consideration for Bangladesh
DNS Troubleshooting - Assumptions and Problem Breakdown
Team Cymru Community Services,Overview of all public services
Open Source TCP or Netflow Log Server Using Graylog
Enhancing seamless access using TIGERfed

Recently uploaded (20)

PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
PPTX
Funds Management Learning Material for Beg
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPT
tcp ip networks nd ip layering assotred slides
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
Internet___Basics___Styled_ presentation
PDF
Testing WebRTC applications at scale.pdf
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPTX
innovation process that make everything different.pptx
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPTX
Digital Literacy And Online Safety on internet
DOCX
Unit-3 cyber security network security of internet system
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Unit-1 introduction to cyber security discuss about how to secure a system
Decoding a Decade: 10 Years of Applied CTI Discipline
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Module 1 - Cyber Law and Ethics 101.pptx
Triggering QUIC, presented by Geoff Huston at IETF 123
Funds Management Learning Material for Beg
Introuction about ICD -10 and ICD-11 PPT.pptx
tcp ip networks nd ip layering assotred slides
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
522797556-Unit-2-Temperature-measurement-1-1.pptx
Internet___Basics___Styled_ presentation
Testing WebRTC applications at scale.pdf
Introuction about WHO-FIC in ICD-10.pptx
innovation process that make everything different.pptx
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Digital Literacy And Online Safety on internet
Unit-3 cyber security network security of internet system
international classification of diseases ICD-10 review PPT.pptx
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx

Log analysis with elastic stack

  • 3. What is Elastic Stack ? User Interface Store, Analyze Ingest
  • 5. a full-text based, distributed NoSQL database. Written in Java, built on Apache Lucene Commonly used for log analytics, full-text search, security intelligence, business analytics, and operational intelligence use cases. Use REST API (GET, PUT, POST, and DELETE ) for storing and searching data
  • 6. Data is stored as documents Data is separated into fields (rows in relational database) (columns in relational database)
  • 7. Relational Database Elasticsearch Database Index Table Type Row/Record Document Column Name Field
  • 8. Terminology Cluster: A cluster consists of one or more nodes which share the same cluster name. Node: A node is a running instance of elasticsearch which belongs to a cluster.
  • 9. Terminology Index: Collection of documents Shard: An index is split into elements known as shards that are distributed across multiple nodes. There are two types of shard, Primary and replica. By default elasticsearch creates 1 primary shard and 1 replica shard for each index.
  • 10. Terminology Shard 1 Replica 2 Replica 1 Shard 2 Node 1 Node 2 cluster
  • 11. Documents • Indices hold documents in serialized JSON objects • 1 document = 1 log entry • Contains "field : value" pairs • Metadata • _index – Index the document belongs to • _id – unique ID for that log • _source – parsed log fields Terminology { "_index": "netflow-2020.10.08", "_type": "_doc", "_id": "ZwkiB3UBULotwSOX3Bdb", "_version": 1, "_score": null, "_source": { "@timestamp": "2020-10-08T07:35:32.000Z”, "host": "172.20.0.1", "netflow": { "ipv4_dst_addr": "103.12.179.136", "l4_dst_port": 80, "src_tos": 0, "l4_src_port": 53966, "ipv4_src_addr": ”192.168.110.18", "application_id": "13..0", "version": 9,
  • 13. Shards and Documents Index Shards Documents
  • 14. Installation curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - Install JAVA 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 elasticsearch
  • 15. configuration /usr/share/elasticsearch/config/elasticsearch.yml Location and the config file Key configuration elements node.name: es01 cluster.name: training discovery.seed_hosts: es02 cluster.initial_master_nodes: es01,es02 network.host: 0.0.0.0
  • 16. [root@4f8cd6658b1b elasticsearch]# curl http://localhost:9200 { "name" : "es01", "cluster_name" : ”training", "cluster_uuid" : "vE9SZr8oRFK0A0HTq9U_oA", "version" : { "number" : "7.7.0", "build_flavor" : "default", "build_type" : "docker", "build_hash" : "81a1e9eda8e6183f5237786246f6dced26a10eaf", "build_date" : "2020-05-12T02:01:37.602180Z", "build_snapshot" : false, "lucene_version" : "8.5.1", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" } [root@4f8cd6658b1b elasticsearch]#
  • 18. Free, developed and maintained by Elastic Integrates with Beats Integrates with Elasticsearch Tons of plugins
  • 19. Logstatsh has three stages INPUT FILTER OUTPUT input { tcp { port => 5002 type => "syslog" } } filter { if [type] == "syslog" { grok { } } } output { if [type] == "syslog" { elasticsearch { hosts => "http://es01:9200" index => "syslog-%{+YYYY.MM.dd}" } } } beats, file, syslog, udp, snmp, etc… http, kv, xml, json, etc… csv, file, http, stdout, etc…. .conf
  • 20. Grok is a great way to parse unstructured log data into something structured and queryable. The syntax for a grok pattern is %{SYNTAX:SEMANTIC} SYNTAX: is the name of the pattern that will match your text SEMANTIC: is the identifier to the piece of text being matched
  • 21. Grok Example 192.168.8.1 GET /index.html 15824 0.04 %{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes} %{NUMBER:duration} { "duration": "0.04", "request": "/index.html", "method": "GET", "bytes": "15824", "client": "192.168.8.1" } raw log grok pattern output
  • 23. Installation wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - Install JAVA sudo apt-get install apt-transport-https sudo apt update sudo apt install logstash echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
  • 26. Command line logs • cat • tail • grep • vi/ vim/ nano /event viewer
  • 28. • Multiple source • Corelating • Seraching, filtering • Visualize Not available on cli
  • 30. Installation wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - sudo apt-get install apt-transport-https sudo apt update sudo apt install kibana echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
  • 31. /usr/share/kibana/config/kibana.yml Location and the config file Key configuration elements server.name: kibana server.host: "0" elasticsearch.hosts: - http://es01:9200 - http://es02:9200 configuration
  • 33. Security (TLS, RBAC) vim /usr/share/elasticsearch/config/elasticsearch.yml xpack.security.enabled: true xpack.security.transport.ssl.enabled: true xpack.security.transport.ssl.keystore.type: PKCS12 xpack.security.transport.ssl.verification_mode: certificate xpack.security.transport.ssl.keystore.path: elastic-certificates.p12 xpack.security.transport.ssl.truststore.path: elastic-certificates.p12 xpack.security.transport.ssl.truststore.type: PKCS12 bin/elasticsearch-certutil ca bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 PKCS12
  • 34. bin/elasticsearch-setup-passwords auto/interactive Setup password for built-in users Changed password for user apm_system PASSWORD apm_system = JreXXXXXXXXXXXXXDm2F Changed password for user kibana PASSWORD kibana = YKvXXXXXXXXXXXXXiCZ Changed password for user logstash_system PASSWORD logstash_system = jUcXXXXXXXXXXXXXNkP Changed password for user beats_system PASSWORD beats_system = uAkXXXXXXXXXXXXXv42 Changed password for user remote_monitoring_user PASSWORD remote_monitoring_user = 9LdXXXXXXXXXXXXXlKC Changed password for user elastic PASSWORD elastic = GUdXXXXXXXXXXXXX8Ze Security (TLS, RBAC)
  • 38. Lightweight data shippers install as agents on your servers Available in Linux/Windows/Mac
  • 40. Installation (Auditbeat) curl -L -O https://artifacts.elastic.co/downloads/beats/auditbeat/auditbeat- 7.7.0-amd64.deb sudo dpkg -i auditbeat-7.7.0-amd64.deb output.elasticsearch: hosts: ["es_host:9200"] username: "elastic" password: "<password>" setup.kibana: host: ”http://kibana_host:5601" Download and install Edit configuration (/etc/auditbeat/auditbeat.yml)
  • 41. Installation (Auditbeat) sudo auditbeat setup sudo service auditbeat start Start auditbeat
  • 43. Elastalert ElastAlert is a simple framework for alerting on anomalies, spikes, or other patterns of interest from data in Elasticsearch. X events in Y time (frequency type) rate of events increases or decreases" (spike type) matches a blacklist/whitelist" (blacklist and whitelist type) less than X events in Y time" (flatline type) Email, JIRA, HipChat, MS Teams, Slack, Telegram etc..
  • 44. Elastalert Installation sudo git clone https://github.com/Yelp/elastalert.git sudo pip install "setuptools>=11.3" sudo python setup.py install sudo pip install "elasticsearch>=5.0.0" sudo apt-get install python-minimal sudo apt-get install python-pip python-dev libffi-dev libssl-dev
  • 45. Elastalert configuration vim /opt/elastalert/config.yaml es_host: elk-server es_port: 9200 es_username: es_user es_password: password sudo elastalert-create-index
  • 46. Demo 1. Run and explore Elastic Stack with docker-compose 2. Install, configure “Auditbeat” and send the logs to the Elastic SIEM 3. Configure FIM in Auditbeat 4. Alerting log event using elastalert to slack channel