System integration and
analysis
By José M. Román
FiberCli
We are pure fiber
• (Now)CEOatFibercli
• (2015–Now)CEO@WISPCloudNetworkingSpain
• (2008–Now)SecurityConsultantandAnalyst
• (2000–2007)Networking,securityanditilteacher.
17yearsexperience,MikrotikCertifiedConsultantandTrainer.MTCNA,
MTCRE,MTCTCE,MTCUME,MTCWE,MTCINE,CISA,CISSP,MasterITIL
@ M A F I A S O L E H
M A D R I D / P R A G U E
J o s e . r o m a n @ f i b e r c l i . c o m
+ 3 4 6 5 2 2 4 1 4 3 1
JOSE MANUEL ROMAN
2José Manuel Román para FiberCli
FAJAR NUGROHO
• (2015–2016) Infrastucture(System,Network&Security)Engineer.@
TechnologyandInformationDepartmentofJakartaCapital
CityandJakartaSmartCity
• (2012–Now)Freelancer@SMBtoEnterprisecustomers
• (2008–2012)Helpdesk,NOC(NetworkOperatorCenter).@Wireless
InternetServiceProviderandTriplePlay(CaTV,VoIPand
Internet)ServiceProvider
Network Engineer by Job and Troublemaker by Act, currently
focusing on MikroTik, Juniper, Arista, UBNT, Vmware Virtualization,
Linux/Unix (Debian & FreeBSD). CCNA, MTCNA, MTCRE, MTCTCE,
JNCIA,JNCIS-ENT, JNCIS-SP, JNCIP-SP,MikroTikCertifiedTrainer.
@ M A F I A S O L E H
T O L E D O / J A K A R T A
f a j a r @ f i b e r c l i . c o m
+ 6 2 8 1 3 1 7 7 7 1 4 5 5
3José Manuel Román para FiberCli
Fiber optic key projects
Level 3 support 24 x 7 for ISP’s
Mikrotik certifications
System and software integration
4José Manuel Román para FiberCli
20% Disccount for
MUM assistant
5José Manuel Román para FiberCli10/17/2016
Problem
Multipleeventsonthenetworkas a systemadministratorornetwork
administratorwe don’tknow locatethesource.
6José Manuel Román , Fibercli
Symptom
Multipleincidentsthatare notmanaged.
Feelingof lack of controloverthe network.
7José Manuel Román para FiberCli
Solution
Centralized system to collect, normalize,
visualization and analysis
8José Manuel Román para FiberCli
AGENDA
 Intro
 Architecture
 ELK (ElasticSearch, Logstash, Kibana)
 Mkt + AAA+ with Freeradius and DB centralized
 Mkt + Centralized Log and ELK
 Mkt + Monitoring and ELK
 Mkt + Netflow and ELK
 Q and A
9José Manuel Román para FiberCli
¿What is?
ELK
10José Manuel Román para FiberCli
Elasticsearch
Elasticsearch is a search engine based on Lucene. It provides a
distributed, multitenant-capable full-text search engine with an
HTTP web interface and schema-free JSON documents.
11José Manuel Román para FiberCli
Elasticsearch
Elasticsearch is developed in Java and is released as open source
under the terms of the Apache License
12José Manuel Román para FiberCli
Elasticsearch
• Distributed, scalable, and highly available
• Real-time search and analytics capabilities
• Sophisticated RESTful API
•https://www.elastic.co/products/elasticsearch
13José Manuel Román para FiberCli
Elasticsearch
14José Manuel Román para FiberCli
• Schema-free, REST & JSON based
distributed search engine
• Open Source: Apache License 2.0
• Easy to understand, yet very powerful query
language
Full text search (phrase, fuzzy)
Numeric search (support ranges, dates, ipv4
addresses)
Highlighting
Aggregations
Suggestions
Logstash
Logstash is a tool to collect, process, and forward events and log
messages. Collection is accomplished via configurable input
plugins including raw socket/packet communication, file tailing,
and several message bus clients.
15José Manuel Román para FiberCli
Logstash
• Centralize data processing of all types
• Normalize varying schema and formats
• Quickly extend to custom log formats
• Easily add plugins for custom data sources
•https://wikitech.wikimedia.org/wiki/Logstash
16José Manuel Román para FiberCli
Logstash
• Inputs: collect data from variety of
sources
• Filters: parse, process and enrich data
• Outputs: push data to a variety of
destinations
17José Manuel Román para FiberCli
Kibana
• Execute queries on your data &
visualize results
• Add/remove widgets
• Share/Save/Load dashboards
• Open Source: Apache License 2.0
18José Manuel Román para FiberCli
Big Picture
•
19José Manuel Román para FiberCli
KIBANAELASTICSEARCHLOGSTASH
RSYSLOG
RADIUS
DATABASE BACKEND
20José Manuel Román para FiberCli
AAA System
21José Manuel Román para FiberCli
Radius
RADIUS is an application level protocol that carries
Authentication, Authorization and Accounting (AAA)
configuration information between a Network Access Server
(NAS) and a Shared Authentication Server. Radius defined in RFC
2865
22José Manuel Román para FiberCli
Radius
In MikroTik RouterOS itself support RADIUS for Hotspot, PPP,
DHCP, Wireless and Login. RADIUS using transport protocol
UDP.
UDP Port 1812 – Authentication
UDP Port 1813 – Accounting
23José Manuel Román para FiberCli
Radius
RADIUS operation typically split into three type :
 Dial-In User : User who requesting for login and password
 Network Access Server (NAS) / RADIUS Client : Device who accept the request from dial-in user
and
: Forward into RADIUS Server.
 Shared Authentication Server / RADIUS Server : Device who make a decision for request (Accept,
: Reject or Challenge)
24José Manuel Román para FiberCli
25José Manuel Román para FiberCli
Link-Establishment Link-Establishment
Dial-In User try to connect (username & password) RADIUS Access-Request
RADIUS Access-Challange
RADIUS Access-Request
RADIUS Access-Reject
RADIUS Access-Accept
Accounting-Request (Start)
Accounting-Response
OROR
Disconnect
Session Start
Accounting-Request (Stop)
Accounting-Response
Disconnect
Topology
26José Manuel Román para FiberCli
27José Manuel Román para FiberCli
MIKROTIK SITE 1
RADIUS
DATABASE BACKEND
MIKROTIK SITE 3
MIKROTIK SITE 2
28José Manuel Román, FiberCli
29José Manuel Román para FiberCli
service (ppp|login|hotspot|wireless|dhcp; Default: )
• hotspot - HotSpot authentication service
• login - router's local user authentication
• ppp - Point-to-Point clients authentication
• wireless - wireless client
• dhcp - DHCP protocol client authentication
Address (IPv4/IPv6 address; Default: 0.0.0.0) IPv4 or IPv6
address of RADIUS server.
Secret (string; Default: ) Shared secret used to access
the RADIUS server.
Freeradius produces several logs
that we can process with logstash
http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/
José Manuel Román para FiberCli 30
# Tue Mar 10 15:32:24 2015
12# Packet-Type = Access-Request
13# User-Name = "test@example.com"
14# Calling-Station-Id = "01-02-03-04-05-06"
15# Called-Station-Id = "aa-bb-cc-dd-ee-ff:myssid"
16# NAS-Port = 10
17# NAS-IP-Address = 10.9.0.4
18# NAS-Identifier = "Wireless-Controller-1"
19# Service-Type = Framed-User
20# NAS-Port-Type = Wireless-802.11
21#
http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/
José Manuel Román para FiberCli 31
26input {
27 stdin {
28 type => radiusdetail
29 }
30}
http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/
José Manuel Román para FiberCli 32
filter {
34
35 if [type] == "radiusdetail"{
36
37 # join all lines of a record together
38 multiline {
39 pattern => "^[^t]"
40 negate => true
41 what => "previous"
42 }
43
44 # pull off the timestamp
45 grok {
46 match => [ "message", "^(?<timestamp>[^nt]+)[nt]" ]
47 }
48
49 # create the timestamp field
50 date {
51 match => [ "timestamp", "EEE MMM dd HH:mm:ss yyyy",
52 "EEE MMM d HH:mm:ss yyyy" ]
53 }
54
55 # split the attributes and values into fields
56 kv {
57 field_split => "n"
58 source => "message"
59 trim => "" "
60 trimkey => "t "
61 }
62 }
63}
http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/
José Manuel Román para FiberCli 33
65output{
66 if [type] == "radiusdetail" {
67 elasticsearch {
68 host => localhost
69 protocol => http
70 cluster => elasticsearch
71 index_type => "detail"
72 index => "radius-%{+YYYY.MM.dd}"
73 flush_size => 1000
74 }
75 }
76}
http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/
José Manuel Román para FiberCli 34
Centralize Log
35José Manuel Román para FiberCli
RSYSLOG
RSYSLOG stand for "the rocket-fast system for log processing“ is an
open-source software utility used on UNIX and Unix-like computer
systems for forwarding log messages in an IP network. It
implements the basic syslog protocol, extends it with content-
based filtering, rich filtering capabilities, flexible configuration
options and adds features such as using TCP for transport
36José Manuel Román para FiberCli
http://www.rsyslog.com/rsyslog-8-19-0-v8-stable-released/
RSYSLOG
• Protocol supported by rsyslog are:
• ISO 8601 timestamp with millisecond granularity and timezone
information
• The addition of the name of relays in the host fields to make it
possible to track the path a given message has traversed
• Reliable transport using TCP
• Support GSS-API and TLS
37José Manuel Román para FiberCli
RSYSLOG
•Logging directly into various database engines.
• Support for RFC 5424, RFC 5425, RFC 5426
• Complete input/output support for systemd journal
38José Manuel Román para FiberCli
Topology
39José Manuel Román para FiberCli
40José Manuel Román para FiberCli
41José Manuel Román para FiberCli
KIBANAELASTICSEARCHLOGSTASH
RSYSLOG
MikroTik log Configuration
42José Manuel Román para FiberCli
43José Manuel Román para FiberCli
44José Manuel Román para FiberCli
45José Manuel Román para FiberCli
46José Manuel Román para FiberCli
Monitoring
47José Manuel Román para FiberCli
/snmp set enabled=yes contact="jose.roman@fibercli.com" location="Mum Madrid" trap-community=public trap-version=2
48José Manuel Román para FiberCli
49José Manuel Román para FiberCli
There are clients to export data to databases
like fluentdb.
https://github.com/jojohappy/zabbix-relay
50José Manuel Román para FiberCli
We can integrate Zabbix events as input in Logstach, with the
goal to have a decoupled monitorization.
Netflow
51José Manuel Román para FiberCli
NetFlow is a network protocol created by Cisco Systems to
collect information about ip traffic.
52José Manuel Román para FiberCli
53José Manuel Román para FiberCli
/ip traffic-flow set active-flow-timeout=30m cache-entries=1M
enabled=yes inactive-flow-timeout=15s interfaces=all
54José Manuel Román para FiberCli
/ip traffic-flow target add dst-address=ip.server port=5055 disabled=no
v9-template-refresh=20 v9-template-timeout=30m version=9
55José Manuel Román para FiberCli
To collect the output we need a netflow collector, for example
pmacctsonda.
56José Manuel Román para FiberCli
When we collect the logs with pcmacct we’ll send the output in json
format to ElasticSearch.
https://github.com/pierky/pmacct-to-elasticsearch/blob/master/CONFIGURATION.md
57José Manuel Román para FiberCli
https://github.com/pierky/pmacct-to-elasticsearch/blob/master/CONFIGURATION.md
58José Manuel Román para FiberCli
59José Manuel Román para FiberCli
60José Manuel Román para FiberCli
Additional resources
61José Manuel Román para FiberCli
Grafana
62José Manuel Román para FiberCli
Influxdb
63José Manuel Román para FiberCli
Fluentd
64José Manuel Román para FiberCli
65José Manuel Román para FiberCli
Thank you
66José Manuel Román para FiberCli
jose.roman@fibercli.com
www.fibercli.com
67José Manuel Román para FiberCli

MUM Middle East 2016 - System Integration Analyst

  • 1.
    System integration and analysis ByJosé M. Román FiberCli We are pure fiber
  • 2.
    • (Now)CEOatFibercli • (2015–Now)CEO@WISPCloudNetworkingSpain •(2008–Now)SecurityConsultantandAnalyst • (2000–2007)Networking,securityanditilteacher. 17yearsexperience,MikrotikCertifiedConsultantandTrainer.MTCNA, MTCRE,MTCTCE,MTCUME,MTCWE,MTCINE,CISA,CISSP,MasterITIL @ M A F I A S O L E H M A D R I D / P R A G U E J o s e . r o m a n @ f i b e r c l i . c o m + 3 4 6 5 2 2 4 1 4 3 1 JOSE MANUEL ROMAN 2José Manuel Román para FiberCli
  • 3.
    FAJAR NUGROHO • (2015–2016)Infrastucture(System,Network&Security)Engineer.@ TechnologyandInformationDepartmentofJakartaCapital CityandJakartaSmartCity • (2012–Now)Freelancer@SMBtoEnterprisecustomers • (2008–2012)Helpdesk,NOC(NetworkOperatorCenter).@Wireless InternetServiceProviderandTriplePlay(CaTV,VoIPand Internet)ServiceProvider Network Engineer by Job and Troublemaker by Act, currently focusing on MikroTik, Juniper, Arista, UBNT, Vmware Virtualization, Linux/Unix (Debian & FreeBSD). CCNA, MTCNA, MTCRE, MTCTCE, JNCIA,JNCIS-ENT, JNCIS-SP, JNCIP-SP,MikroTikCertifiedTrainer. @ M A F I A S O L E H T O L E D O / J A K A R T A f a j a r @ f i b e r c l i . c o m + 6 2 8 1 3 1 7 7 7 1 4 5 5 3José Manuel Román para FiberCli
  • 4.
    Fiber optic keyprojects Level 3 support 24 x 7 for ISP’s Mikrotik certifications System and software integration 4José Manuel Román para FiberCli
  • 5.
    20% Disccount for MUMassistant 5José Manuel Román para FiberCli10/17/2016
  • 6.
    Problem Multipleeventsonthenetworkas a systemadministratorornetwork administratorwedon’tknow locatethesource. 6José Manuel Román , Fibercli
  • 7.
    Symptom Multipleincidentsthatare notmanaged. Feelingof lackof controloverthe network. 7José Manuel Román para FiberCli
  • 8.
    Solution Centralized system tocollect, normalize, visualization and analysis 8José Manuel Román para FiberCli
  • 9.
    AGENDA  Intro  Architecture ELK (ElasticSearch, Logstash, Kibana)  Mkt + AAA+ with Freeradius and DB centralized  Mkt + Centralized Log and ELK  Mkt + Monitoring and ELK  Mkt + Netflow and ELK  Q and A 9José Manuel Román para FiberCli
  • 10.
    ¿What is? ELK 10José ManuelRomán para FiberCli
  • 11.
    Elasticsearch Elasticsearch is asearch engine based on Lucene. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. 11José Manuel Román para FiberCli
  • 12.
    Elasticsearch Elasticsearch is developedin Java and is released as open source under the terms of the Apache License 12José Manuel Román para FiberCli
  • 13.
    Elasticsearch • Distributed, scalable,and highly available • Real-time search and analytics capabilities • Sophisticated RESTful API •https://www.elastic.co/products/elasticsearch 13José Manuel Román para FiberCli
  • 14.
    Elasticsearch 14José Manuel Románpara FiberCli • Schema-free, REST & JSON based distributed search engine • Open Source: Apache License 2.0 • Easy to understand, yet very powerful query language Full text search (phrase, fuzzy) Numeric search (support ranges, dates, ipv4 addresses) Highlighting Aggregations Suggestions
  • 15.
    Logstash Logstash is atool to collect, process, and forward events and log messages. Collection is accomplished via configurable input plugins including raw socket/packet communication, file tailing, and several message bus clients. 15José Manuel Román para FiberCli
  • 16.
    Logstash • Centralize dataprocessing of all types • Normalize varying schema and formats • Quickly extend to custom log formats • Easily add plugins for custom data sources •https://wikitech.wikimedia.org/wiki/Logstash 16José Manuel Román para FiberCli
  • 17.
    Logstash • Inputs: collectdata from variety of sources • Filters: parse, process and enrich data • Outputs: push data to a variety of destinations 17José Manuel Román para FiberCli
  • 18.
    Kibana • Execute querieson your data & visualize results • Add/remove widgets • Share/Save/Load dashboards • Open Source: Apache License 2.0 18José Manuel Román para FiberCli
  • 19.
    Big Picture • 19José ManuelRomán para FiberCli KIBANAELASTICSEARCHLOGSTASH RSYSLOG RADIUS DATABASE BACKEND
  • 20.
    20José Manuel Románpara FiberCli
  • 21.
    AAA System 21José ManuelRomán para FiberCli
  • 22.
    Radius RADIUS is anapplication level protocol that carries Authentication, Authorization and Accounting (AAA) configuration information between a Network Access Server (NAS) and a Shared Authentication Server. Radius defined in RFC 2865 22José Manuel Román para FiberCli
  • 23.
    Radius In MikroTik RouterOSitself support RADIUS for Hotspot, PPP, DHCP, Wireless and Login. RADIUS using transport protocol UDP. UDP Port 1812 – Authentication UDP Port 1813 – Accounting 23José Manuel Román para FiberCli
  • 24.
    Radius RADIUS operation typicallysplit into three type :  Dial-In User : User who requesting for login and password  Network Access Server (NAS) / RADIUS Client : Device who accept the request from dial-in user and : Forward into RADIUS Server.  Shared Authentication Server / RADIUS Server : Device who make a decision for request (Accept, : Reject or Challenge) 24José Manuel Román para FiberCli
  • 25.
    25José Manuel Románpara FiberCli Link-Establishment Link-Establishment Dial-In User try to connect (username & password) RADIUS Access-Request RADIUS Access-Challange RADIUS Access-Request RADIUS Access-Reject RADIUS Access-Accept Accounting-Request (Start) Accounting-Response OROR Disconnect Session Start Accounting-Request (Stop) Accounting-Response Disconnect
  • 26.
  • 27.
    27José Manuel Románpara FiberCli MIKROTIK SITE 1 RADIUS DATABASE BACKEND MIKROTIK SITE 3 MIKROTIK SITE 2
  • 28.
  • 29.
    29José Manuel Románpara FiberCli service (ppp|login|hotspot|wireless|dhcp; Default: ) • hotspot - HotSpot authentication service • login - router's local user authentication • ppp - Point-to-Point clients authentication • wireless - wireless client • dhcp - DHCP protocol client authentication Address (IPv4/IPv6 address; Default: 0.0.0.0) IPv4 or IPv6 address of RADIUS server. Secret (string; Default: ) Shared secret used to access the RADIUS server.
  • 30.
    Freeradius produces severallogs that we can process with logstash http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/ José Manuel Román para FiberCli 30
  • 31.
    # Tue Mar10 15:32:24 2015 12# Packet-Type = Access-Request 13# User-Name = "test@example.com" 14# Calling-Station-Id = "01-02-03-04-05-06" 15# Called-Station-Id = "aa-bb-cc-dd-ee-ff:myssid" 16# NAS-Port = 10 17# NAS-IP-Address = 10.9.0.4 18# NAS-Identifier = "Wireless-Controller-1" 19# Service-Type = Framed-User 20# NAS-Port-Type = Wireless-802.11 21# http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/ José Manuel Román para FiberCli 31
  • 32.
    26input { 27 stdin{ 28 type => radiusdetail 29 } 30} http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/ José Manuel Román para FiberCli 32
  • 33.
    filter { 34 35 if[type] == "radiusdetail"{ 36 37 # join all lines of a record together 38 multiline { 39 pattern => "^[^t]" 40 negate => true 41 what => "previous" 42 } 43 44 # pull off the timestamp 45 grok { 46 match => [ "message", "^(?<timestamp>[^nt]+)[nt]" ] 47 } 48 49 # create the timestamp field 50 date { 51 match => [ "timestamp", "EEE MMM dd HH:mm:ss yyyy", 52 "EEE MMM d HH:mm:ss yyyy" ] 53 } 54 55 # split the attributes and values into fields 56 kv { 57 field_split => "n" 58 source => "message" 59 trim => "" " 60 trimkey => "t " 61 } 62 } 63} http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/ José Manuel Román para FiberCli 33
  • 34.
    65output{ 66 if [type]== "radiusdetail" { 67 elasticsearch { 68 host => localhost 69 protocol => http 70 cluster => elasticsearch 71 index_type => "detail" 72 index => "radius-%{+YYYY.MM.dd}" 73 flush_size => 1000 74 } 75 } 76} http://code.metager.de/source/xref/freeradius/server/doc/schemas/logstash/ José Manuel Román para FiberCli 34
  • 35.
    Centralize Log 35José ManuelRomán para FiberCli
  • 36.
    RSYSLOG RSYSLOG stand for"the rocket-fast system for log processing“ is an open-source software utility used on UNIX and Unix-like computer systems for forwarding log messages in an IP network. It implements the basic syslog protocol, extends it with content- based filtering, rich filtering capabilities, flexible configuration options and adds features such as using TCP for transport 36José Manuel Román para FiberCli http://www.rsyslog.com/rsyslog-8-19-0-v8-stable-released/
  • 37.
    RSYSLOG • Protocol supportedby rsyslog are: • ISO 8601 timestamp with millisecond granularity and timezone information • The addition of the name of relays in the host fields to make it possible to track the path a given message has traversed • Reliable transport using TCP • Support GSS-API and TLS 37José Manuel Román para FiberCli
  • 38.
    RSYSLOG •Logging directly intovarious database engines. • Support for RFC 5424, RFC 5425, RFC 5426 • Complete input/output support for systemd journal 38José Manuel Román para FiberCli
  • 39.
  • 40.
    40José Manuel Románpara FiberCli
  • 41.
    41José Manuel Románpara FiberCli KIBANAELASTICSEARCHLOGSTASH RSYSLOG
  • 42.
    MikroTik log Configuration 42JoséManuel Román para FiberCli
  • 43.
    43José Manuel Románpara FiberCli
  • 44.
    44José Manuel Románpara FiberCli
  • 45.
    45José Manuel Románpara FiberCli
  • 46.
    46José Manuel Románpara FiberCli Monitoring
  • 47.
    47José Manuel Románpara FiberCli /snmp set enabled=yes contact="jose.roman@fibercli.com" location="Mum Madrid" trap-community=public trap-version=2
  • 48.
    48José Manuel Románpara FiberCli
  • 49.
    49José Manuel Románpara FiberCli There are clients to export data to databases like fluentdb. https://github.com/jojohappy/zabbix-relay
  • 50.
    50José Manuel Románpara FiberCli We can integrate Zabbix events as input in Logstach, with the goal to have a decoupled monitorization.
  • 51.
  • 52.
    NetFlow is anetwork protocol created by Cisco Systems to collect information about ip traffic. 52José Manuel Román para FiberCli
  • 53.
    53José Manuel Románpara FiberCli
  • 54.
    /ip traffic-flow setactive-flow-timeout=30m cache-entries=1M enabled=yes inactive-flow-timeout=15s interfaces=all 54José Manuel Román para FiberCli
  • 55.
    /ip traffic-flow targetadd dst-address=ip.server port=5055 disabled=no v9-template-refresh=20 v9-template-timeout=30m version=9 55José Manuel Román para FiberCli
  • 56.
    To collect theoutput we need a netflow collector, for example pmacctsonda. 56José Manuel Román para FiberCli
  • 57.
    When we collectthe logs with pcmacct we’ll send the output in json format to ElasticSearch. https://github.com/pierky/pmacct-to-elasticsearch/blob/master/CONFIGURATION.md 57José Manuel Román para FiberCli
  • 58.
  • 59.
    59José Manuel Románpara FiberCli
  • 60.
    60José Manuel Románpara FiberCli
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
    65José Manuel Románpara FiberCli
  • 66.
    Thank you 66José ManuelRomán para FiberCli
  • 67.