-
Notifications
You must be signed in to change notification settings - Fork 1.6k
detect/entropy: Unique flowvar names #14009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Issue: 7814 Support unique flow variable names for entropy-related values. Since this is a breaking change from Suricata 8, unique names are configurable (default value off) with this setting logging: entropy: make-unique: on When `make-unique` is on, entropy-related flow variable names are structured as: sid:<sid>;buffer:<buffer>;instance:<instance> Instance is a small integer value corresponding to the number of entropy values in the rule. The first entropy usage will create a flow variable with an instance value of 1; the second will use 2, and so on. This is necessary to disambiguate the flow variable names. When `make-unique` is off (default = off), this format is used: <sticky_buffer>
Discuss the new configuration variable that provides unique names for entropy values in logging output: logging.entropy.make-unique Issue: 7814
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14009 +/- ##
==========================================
- Coverage 83.87% 83.85% -0.02%
==========================================
Files 1011 1011
Lines 275671 275728 +57
==========================================
+ Hits 231207 231214 +7
- Misses 44464 44514 +50
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
WARNING:
Pipeline = 27963 |
Was still unclear to me :-/ So, I have been adding to test.rules in entropy-02 SV I get {
"pcap_cnt": 8,
"event_type": "alert",
"metadata": {
"entropy": [
{
"sid": 20,
"buffer": "http_request_header",
"instance": 2,
"value": 5.061669357173793
},
{
"sid": 20,
"buffer": "http_request_header",
"instance": 1,
"value": 3.8136606896881853
}
]
}, And with some logging, I see that the entropy 5.06 is about the user agent ( |
So, this is now good for uniqueness, but it will not be if you add something like |
There is a sid field in the key, but the record is part of an alert which is locked to a sid too. Is there value in having it in the key then? |
Yes -- because all of the flow's flowbits are included in the alert; other rules may cause the entropy to be calculated -- see s-v's entropy-02 test for an example |
Continuation of #14008
Use unique variable names for each flowvar as they come from a global
namespace. The chosen name is:
sid:<signature_id>;buffer:<buffer-name>;instance:<instance#>
Describe changes:
Entropy values will be logged into an array named
entropy
.Each array element will look like this:
Updates:
logging.entropy.make-unique
sid:<signature_id>;buffer:<buffer-name>;instance:<instance#>
Issue: 7814
Link to ticket: https://redmine.openinfosecfoundation.org/issues/7814
Provide values to any of the below to override the defaults.
link to the pull request in the respective
_BRANCH
variable.SV_REPO=
SV_BRANCH=OISF/suricata-verify#2588
SU_REPO=
SU_BRANCH=