Git Product home page Git Product logo

bro-elk's Introduction

Bro-ELK

安装配置

具体的安装过程就不在描述了,官网上面的文档很详细,这里主要就是讲讲如何把bro解析的日志导出到ELK里面,之前在github搜别人贴的配置文件发现还是有一些坑。

禁用协议

在安装bro后实际我们用不着那么多协议解析,尤其是在大流量环境下很费性能 在/usr/local/bro/share/bro/site/目录下创建disable_analyzer.bro

event bro_init()
    {
    Log::disable_stream(X509::LOG);
    Log::disable_stream(Weird::LOG);
    Log::disable_stream(Files::LOG);
    }
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_AYIYA };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_DCE_RPC };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_DHCP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_DNP3_TCP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_IRC };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_IRC_DATA };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_MODBUS };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_XMPP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_SYSLOG };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_SIP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_RFB };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_RADIUS };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_NCP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_SNMP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_TEREDO };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_FTP_DATA };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_FTP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_BACKDOOR };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_DNP3_UDP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_FINGER };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_GNUTELLA };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_GSSAPI };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_GTPV1 };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_IDENT };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_NVT };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_PIA_TCP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_PIA_UDP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_SIP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_NCP };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_NFS };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_BITTORRENTTRACKER };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_FTP_ADAT };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_POP3 };
redef Analyzer::disabled_analyzers += { Analyzer::ANALYZER_STEPPINGSTONE };

然后在local.bro添加

@load disable_analyzer.bro

安装配置

在安装bro与elk后,首先我们要将bro的日志改成json格式,默认是以TAB分隔

在/usr/local/bro/share/bro/policy/tuning下面新建json-logs.bro

redef LogAscii::use_json=T;

然后在/usr/local/bro/share/bro/site/local.bro里面添加

 @load policy/tuning/json-logs.bro

将logstash.conf配置文件放到/etc/logstash/conf.d/bro.conf,然后运行logstash -f 加载配置文件

参考来源

https://www.bro.org

https://doc.yonyoucloud.com/doc/logstash-best-practice-cn/index.html

https://github.com/timmolter/logstash-dfir/tree/master/conf_files/bro

bro-elk's People

Contributors

al0ne avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.