Giter Site home page Giter Site logo

Comments (6)

jasonish avatar jasonish commented on July 27, 2024 1

Should be fixed now. 0.17.1 pushed.

from evebox.

jasonish avatar jasonish commented on July 27, 2024

I just re-tested on 8.5.3 and can't reproduce (most of my testing has been on 8.6.0 lately). Can you tell me how you are adding the events? Any custom mappings?

from evebox.

satta avatar satta commented on July 27, 2024

Sure! This is on my private personal setup; events are received on the sensor side via syslog-ng and sent to a RabbitMQ exchange; on the Elasticsearch side there is a Logstash instance collecting data from there:

input {
    rabbitmq {
        host => "rabbit...."
        port => 5672
        heartbeat => 30
        exchange => "alerts"
        exchange_type => "fanout"
        durable => true
        queue => "alerts.elastic"
        user => "consumer"
        password => "consumer"
    }
}
output {
    elasticsearch {
        hosts => "localhost:9200"
        index => "logstash-%{+yyyy.MM.dd}"
    }
}

Here's an example event I triggered to test the alerting path, just copied from Evebox's "JSON" box (which isn't really valid JSON 🤔):

{
   _id: "9Pe3GIcB2gitsSQ5lBbt",
   _ignored: [
      "event.original.keyword",
      "alert.rule.keyword"
   ],
   _index: "logstash-2023.03.25",
   _metadata: {
      aggregate: true,
      count: 2,
      escalated_count: 0,
      max_timestamp: "2023-03-25T12:21:36.888083+0000",
      min_timestamp: "2023-03-25T12:21:36.811383+0000"
   },
   _score: null,
   _source: {
      "@timestamp": "2023-03-25T12:21:37.029914885Z",
      "@version": "1",
      alert: {
         action: "allowed",
         category: "Potentially Bad Traffic",
         gid: 1,
         metadata: {
            created_at: [
               "2012_01_31"
            ],
            updated_at: [
               "2020_09_14"
            ]
         },
         rev: 4,
         rule: "alert dns $HOME_NET any -> any any (msg:\"ET DNS Query for .su TLD (Soviet Union) Often Malware Related\"; dns.query; content:\".su\"; nocase; endswith; reference:url,www.abuse.ch/?p=3581; classtype:bad-unknown; sid:2014169; rev:4; metadata:created_at 2012_01_31, updated_at 2020_09_14;)",
         severity: 2,
         signature: "ET DNS Query for .su TLD (Soviet Union) Often Malware Related",
         signature_id: 2014169
      },
      app_proto: "dns",
      dest_ip: "8.8.8.8",
      dest_port: 53,
      dns: {
         query: [
            {
               id: 64021,
               rrname: "foo.su",
               rrtype: "AAAA",
               tx_id: 0,
               type: "query"
            }
         ]
      },
      event: {
         original: "{\"timestamp\":\"2023-03-25T12:21:36.888083+0000\",\"flow_id\":817065574305043,\"in_iface\":\"br0\",\"event_type\":\"alert\",\"src_ip\":\"192.168.178.25\",\"src_port\":56071,\"dest_ip\":\"8.8.8.8\",\"dest_port\":53,\"proto\":\"UDP\",\"tx_id\":0,\"alert\":{\"action\":\"allowed\",\"gid\":1,\"signature_id\":2014169,\"rev\":4,\"signature\":\"ET DNS Query for .su TLD (Soviet Union) Often Malware Related\",\"category\":\"Potentially Bad Traffic\",\"severity\":2,\"metadata\":{\"created_at\":[\"2012_01_31\"],\"updated_at\":[\"2020_09_14\"]},\"rule\":\"alert dns $HOME_NET any -> any any (msg:\\\"ET DNS Query for .su TLD (Soviet Union) Often Malware Related\\\"; dns.query; content:\\\".su\\\"; nocase; endswith; reference:url,www.abuse.ch/?p=3581; classtype:bad-unknown; sid:2014169; rev:4; metadata:created_at 2012_01_31, updated_at 2020_09_14;)\"},\"dns\":{\"query\":[{\"type\":\"query\",\"id\":64021,\"rrname\":\"foo.su\",\"rrtype\":\"AAAA\",\"tx_id\":0}]},\"app_proto\":\"dns\",\"flow\":{\"pkts_toserver\":1,\"pkts_toclient\":0,\"bytes_toserver\":66,\"bytes_toclient\":0,\"start\":\"2023-03-25T12:21:36.888083+0000\"},\"payload\":\"+hUBAAABAAAAAAAAA2ZvbwJzdQAAHAAB\",\"stream\":0,\"packet\":\"OBDV6YO4MCQyA+8NCABFAAA0VE4AAEARo5nAqLIZCAgICNsHADUAILwi+hUBAAABAAAAAAAAA2ZvbwJzdQAAHAAB\",\"packet_info\":{\"linktype\":1},\"src_host\":[{\"rdns\":\"BLN04NB0421.fritz.box\"}]}\n"
      },
      event_type: "alert",
      flow: {
         bytes_toclient: 0,
         bytes_toserver: 66,
         pkts_toclient: 0,
         pkts_toserver: 1,
         start: "2023-03-25T12:21:36.888083+0000"
      },
      flow_id: 817065574305043,
      in_iface: "br0",
      packet: "OBDV6YO4MCQyA+8NCABFAAA0VE4AAEARo5nAqLIZCAgICNsHADUAILwi+hUBAAABAAAAAAAAA2ZvbwJzdQAAHAAB",
      packet_info: {
         linktype: 1
      },
      payload: "+hUBAAABAAAAAAAAA2ZvbwJzdQAAHAAB",
      proto: "UDP",
      src_host: [
         {
            rdns: "redacted.internal.host.name"
         }
      ],
      src_ip: "192.168.178.25",
      src_port: 56071,
      stream: 0,
      timestamp: "2023-03-25T12:21:36.888083+0000",
      tx_id: 0
   },
   sort: [
      1679746897029
   ]
}

The only nonstandard thing I can think of is that FEVER (in between) does active reverse DNS queries to enrich internal IPs within the EVE with a src_host sub-object containing the hostname, to make it easier to tell what device in my home network triggered the alert. Not sure if that could be an issue.

from evebox.

jasonish avatar jasonish commented on July 27, 2024

I've reproduced it. I have to admit its been sometime since I've done plain Logstash->Elasticsearch, probably 7.0 days. It appears they've changed the schema in 8. It still works in SELKS which uses Logstash, but they're still on ELK 7. This is something I'll need to fix ASAP.

As for the JSON, yeah, its valid Javascript not JSON I guess, as the keys are not quoted. Visually I guess it looks better unquoted, but I should probably make it valid.

from evebox.

satta avatar satta commented on July 27, 2024

Thanks for looking into it!

from evebox.

satta avatar satta commented on July 27, 2024

Works perfectly now. Thanks for addressing this quickly!

from evebox.

Related Issues (20)

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.