Replies: 5 comments 13 replies
|
You have a couple of options. You can run either of the following scripts to remove the detection and have 0 tunings or you can run the second option and remove the detection with the tunings. Just make sure and replace the Stay in Detections with 0 tunings /sbin/so-elasticsearch-query '*so-detection/_update_by_query' -d '{
"query": {
"match": {
"so_detection.publicId": "2066594"
}
},
"script": {
"source": "ctx._source[\"so_detection.overrides\"] = []",
"lang": "painless"
}
}'Remove from Detections /sbin/so-elasticsearch-query '*so-detection/_update_by_query' -d '{
"query": {
"match": {
"so_detection.publicId": "2066594"
}
},
"script": {
"source": "ctx._source.so_detection.remove(\"overrides\")",
"lang": "painless"
}
}' |
|
So, just to be clear: Do both of the options you mentioned work only on the detection with overrides, i.e. the ones defined in the Detections tab - or do they work on all detections globally? In case the work globally, i.e. on all detections/signatures - how would I get a signature back in case it gets deleted inadvertently? |
Sorry - my bad - forgot to attach the log - attaching it this time. so-detection-search-result.json
I've got 31 rules with overrides configured via the Detections interface in total. Speaking of
|
So in fact I just want to remove all the overrides in the Detections interface reverting the corresponding rules back to their default behavior. |
|
Worth separating two states before you clean these up, because your own log already says they disagree. Cheap way to tell which one the script above actually changed: pull the Suricata startup block out of /opt/so/log/suricata/suricata.log before and after, and compare the rules-successfully-loaded and failed counts plus the threshold-config lines. Counts unchanged means you fixed bookkeeping in the index. Counts changed means the sensor ruleset moved. That still only tells you the rule loaded, not that it fires. Replaying traffic that should hit 2001581 is the only check I trust for that. On the stacks I have measured, threshold and suppression state are where the console and the engine drift furthest apart. |


Uh oh!
There was an error while loading. Please reload this page.
Version
3.1.0
Installation Method
Security Onion ISO image
Description
configuration
Installation Type
Distributed
Location
on-prem with Internet access
Hardware Specs
Exceeds minimum requirements
CPU
32
RAM
512GB
Storage for /
4TB
Storage for /nsm
4TB
Network Traffic Collection
span port
Network Traffic Speeds
1Gbps to 10Gbps
Status
Yes, all services on all nodes are running OK
Salt Status
No, there are no failures
Logs
No, there are no additional clues
Detail
Hi,
Just wanted to delete a bunch of overrides for Suricata rules via the GUI, but whenever I tried to change any rule/override it resulted in an error message "A detection with this public Id already exists. Please choose a different public Id."
Here's an example:
Tried to modify (i.e. delete the override) on Rule 2001581 since it refers to a variable $DA_NODES that's no longer defined. First I deleted the corresponding variable definition via Administration > Configuration > Adv > Suricata > Advanced and then tried to remove the rule override mentioning that variable by clicking on the "x"
Instead of the override being deleted I got an error message like
Please note that this happens with every signature I try to delete the tuning from, not just this one :-(
BTW,
/opt/so/log/suricata/suricata.logon the sensor just shows entries like the ones below, but no other clue relating to the error messageA detection with this public Id already exists. Please choose a different public Id.:Any ideas as to what's wrong here and how I can delete those overrides?
Guidelines
All reactions