Closed maldwg closed 2 months ago
hello @maldwg i completely agree with you, we've been discussing this with @eldraco for a while now and we agreed to use a new format and add more info to the logged evidence/alerts, see #839 for more details.
@AlyaGomaa Ok great thank you for the information :) As I can see from https://github.com/stratosphereips/StratosphereLinuxIPS/issues/839 , you are planning to switch from the IDEA0 format in the future, if a good alternative has proven more effective. However, do you have a suggestion or maybe even an unofficial workaround for now that can gather all available information for one request (preferably by using automatable cli commands only) ? My goal is to use slips to analyze test datasets and I need to assign the alerts of slips to my labeled test data. The timestamp itself together with the source and (if available) destination IP has sadly proven to be insufficient for that.
So 2 options if your test data is zeek logs
Thank you for your quick reply again :)
I tried your approaches, but came across the following problems:
1: My test data are external data like the CICIDS 2017 dataset and thus not zeek logs. If you are referring to the zeek_files in the output directory, I tried mapping the requests logged there to the alerts.json, but the uid's are differently build as far as I am aware. Or is there a way to transform one format like "uid":"CHnKXz3560z0KTTbRa from a zeek log to the format of the alerts.json? "ID": "1f7ff3a2-391b-4613-8b7e-89f29dfdb20a"
2: For the second approach, I would be totally fine to just use the db entries. However, the problem is, that every entry in these 2 tables is labeled benign, even though it probably shouldn't (I am using the datasets provided like test7-malcious.pcap for quick tests). I tried mapping the DB entries to the alerts.json file anyway in the hopes that this might be just a labeling issue. Nevertheless, most of the alerts from alerts.json could not be assigned to a DB entry (IDs of the DB entries are again different from the alerts.json, and a mapping by timestamp, src-ip, and dst-ip was not successful either). So is this wanted that every dataset yields only benign labeled db entries? And is it possible to map the entries in another way to the alerts?
And one last thing: you wrote
each evidence from alerts.json
I thought alerts.json were alerts and not evidence entries, or am I mistaken? If they are only evidence, this would mean that not every entry in that file can be regarded as malicious and would need to be compared to the DB entries, right ?
Hi so to break this down
Now about the labels, if all flows in the database are labeled as benign, it means slips didn't generate an alert, it may have generated many evidence, but these evidence were not enough for an alert. and only flows that were part of an alert are marked as malicious.
Also no, not everything in alerts.json is an alert, I agree the name of the file may be a little misleading, but the file has alerts and evidence, not just alerts. this is an example of an alert in alerts.json
{"Format": "Json", "ID": "4edfc67a-dd8c-4fc6-a3be-ac294521c166", "DetectTime": "2024-08-30T22:42:13.328747+03:00", "EventTime": "2024-08-30T22:42:13.328756+03:00", "Category": "Alert", "Confidence": 1.0, "Source": [{"IP4": ["192.168.1.129"], "Type": ["BlacklistedIP"]}], "Target": [{"IP4": ["122.248.252.67"]}], "Attach": [{"Content": "2021-06-06T18:32:28.297488+03:00: Src IP 192.168.1.129 . Generated an alert given enough evidence on timewindow 1. (real time 2024/08/30 22:42:13.368528)", "ContentType": "text/plain"}], "ConnCount": 1, "uids": [], "accumulated_threat_level": 12.1, "timewindow": 1, "profileid": "profile_192.168.1.129", "threat_level": 12.1}
if you do cat alerts.json | grep -i alert
you'll get all alerts if there was any.
You can completely ignore the "ID" field of each evidence/alert in the alerts.json, there are random identifiers generated by slips required by the IDEA0 format, you can't map them to zeek logs
Ok sorry, now I know which uid you meant, thank you so much for your extensive explanation! I looked at the totally wrong place 😅
Now I can successfully assign any flow to an alert/evidence from the alerts.json and get all the metadata. Thank you so much @AlyaGomaa !
hey no problem glad you figured it out :))
Describe the bug When analyzing any file or network traffic, the logs in the alerts.json are missing the port information for the source and destination most of the times. As far as I can tell, only for requests categorized as type "Recon.Scanning", this works right now. For every other type, it does not. At least the information for the destination port is available, as the alerts.log print it into the alert message. Hence it should not be an issue of whether or not there is information about the ports, but rather that it is not included into the alerts.json.
Example logs :
alerts.json
alerts.log
As you can see, the port is only shown in the first entry of type Recon.Scanning, and even though the alerts.log show further port information, it is not displayed in alerts.json, which makes using it rather difficult.
To Reproduce Steps to reproduce the behavior:
docker run --rm -it--net=host --cap-add=NET_ADMIN --name slips stratosphereips/slips:latest
Expected behavior The alerts.json and alerts.log should display equal information about the requests. Started by a common timestamp and also regarding request attributes like IP and port information.
Environment (please complete the following information):
Additional context If the above described behavior is on purpose, then this issue should be a feature request, if not, this should remain a bug request. However, knowing the source and destination ports is important, so I classified it as a bug.