stratosphereips / StratosphereLinuxIPS

Slips, a free software behavioral Python intrusion prevention system (IDS/IPS) that uses machine learning to detect malicious behaviors in the network traffic. Stratosphere Laboratory, AIC, FEL, CVUT in Prague.
Other
701 stars 175 forks source link

Need to find a better format to report Evidences and Alerts since the IDEA0 format does not have all the options #839

Closed eldraco closed 1 month ago

eldraco commented 3 months ago

Describe the bug The IDEA0 format does not have all the options we need to report an alert correctly. In particular IDEA0 still wants each alert to have a Source and a Destination of the attack, when sometimes this is not possible.

For example, if a command and control is detected, Slips creates two evidences. One for the source because it is an infected machine that needs to be contained, and another for the destination, that is the C&C server that needs to be blocked and shared as an IoC.

However, IDEA0 forces us to have a Source and Destination on each alert. In this case what we need is a better way to put the 'reasons' for the evidence. The problem is that the source and destination of the C&C channel are the same, but one evidence is for the source, and one for the destination.

This situation is not clear when you look at the IDEA0 evidences.

Example:

{
  "Format": "IDEA0",
  "ID": "576f848c-2026-4856-b3aa-8be4c92fe734",
  "DetectTime": "2024-07-01T13:00:27.087793+00:00",
  "EventTime": "2024-07-01T13:00:27.087810+00:00",
  "Category": [
    "Intrusion.Botnet"
  ],
  "Confidence": 0.03,
  "Source": [
    {
      "IP4": [
        "209.205.188.238"
      ],
      "Type": [
        "CC"
      ]
    },
    {
      "IP4": [
        "209.205.188.238"
      ],
      "Type": [
        "CC"
      ],
      "Port": [
        449
      ],
      "Proto": [
        "TCP"
      ]
    }
  ],
  "Target": [
    {
      "IP4": [
        "192.168.1.113"
      ]
    }
  ],
  "Attach": [
    {
      "Content": "C&C channel, client IP: 192.168.1.113 server IP: 209.205.188.238 port:  449/tcp score: 0.9910.  AS: NTSC-ASN2, US AS4314 threat level: high.",
      "ContentType": "text/plain"
    }
  ],
  "ConnCount": 1,
  "uids": [
    "C24JPO2CqlIQeGX5B3"
  ],
  "accumulated_threat_level": 0,
  "timewindow": 1
}

Expected behavior To be able to say that each evidence is assigned to an 'IP'. And that IP can be destination or source. The key part is to say that the evidence was generated for a connection going to that IP, or coming from that IP.

Branch Master, 1.0.15

eldraco commented 3 months ago

Sometimes we put the target of the evidence as 'source' even though it was not the source in the traffic. This is a little better.

{
  "Format": "IDEA0",
  "ID": "d32f2a78-a44a-46e9-bb15-d8c1d42e7867",
  "DetectTime": "2024-03-11T14:29:20.299544+00:00",
  "EventTime": "2024-03-11T14:29:20.299562+00:00",
  "Category": [
    "Anomaly.Traffic"
  ],
  "Confidence": 1,
  "Source": [
    {
      "IP4": [
        "73.252.252.62"
      ],
      "Type": [
        "BlacklistedIP"
      ]
    }
  ],
  "Attach": [
    {
      "Content": "connection to blacklisted IP: 73.252.252.62 from 192.168.1.113. AS: COMCAST-7922, US AS7922rDNS: c-73-252-252-62.hsd1.ca.comcast.net Description: IP address should not -according to the ISP controlling it- be delivering unauthenticated SMTP email to any Internet mail server. Source: PBL ISP Maintained, spamhaus. threat level: medium.",
      "ContentType": "text/plain"
    }
  ],
  "ConnCount": 1,
  "uids": [
    "CAThdI1wn2jWrdou31"
  ],
  "accumulated_threat_level": 0,
  "timewindow": 1
}
AlyaGomaa commented 2 months ago
AlyaGomaa commented 2 months ago

Here's the plan for IDMEFv2 (https://www.ietf.org/id/draft-lehmann-idmefv2-03.html)

TLDR;

There's a place for all evidence details that Slips supports except for:

It also supports:


eldraco commented 2 months ago

This is good. I like it. We can use several notes maybe? or only one note?

AlyaGomaa commented 2 months ago

Only one note because the alerts are dictionaries, but we can use a dictionary in the Note field, and have as many keys in that dict as we want

AlyaGomaa commented 2 months ago

Also we can have a Note field for the source, the target, the attachment etc.

AlyaGomaa commented 2 months ago