Skip to content

Conversation

jasonish
Copy link
Member

Ticket: https://redmine.openinfosecfoundation.org/issues/7902

SV_BRANCH=OISF/suricata-verify#2665

Also:

  • Don't log empty "ike" server objects

Previous PR: #13907

Changes:

  • Add ike log record version specifier

IKE attributes are an array of TLV style objects, this means there can
be duplicate types seen on the wire. However, Suricata logs these as a
mapping with the type as the key. This can result in the JSON
containing duplicate keys.

To address this, log the attributes as an array of objects, allow
duplicates to exist, for example:

  "client": {
    "proposals": [
      {
        "sa_life_duration": "Unknown",
        "sa_life_duration_raw": 86400,
      }
    }
  }

is now logged as:

  "client": {
    "proposals": [
      {"key": "sa_life_duration", "value": "Unknown", "raw": 86400}
    ]
  }

Also adds `"version": 2` to each IKE record to note the change of
format from previous versions.

Ticket: OISF#7902
Update EVE documentation script to handle union types like:

    "type": ["string", "number"]
"type": "string"
},
"sa_life_type_raw": {
"version": {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a little confusing with the 2 versions below.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we discussed this before for other records.

suricata_record_version:2
srv:2

suricata:{
   version:2
}

other ideas?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not, srv, thats a little ambiguous in DNS events. So I think we need something completely unambiguous.

suricata_record_version works, but I 'd prefer the object approach.

"suricata": {
  "version": 2
}

could work, but we've also talked about adding the Suricata version to each record before, and this should go in a similar object, but would have a different schema, so something like:

"suricata": {
    "version": "8.0.2"
    "major": 8
}

or something like that, but that doesn't work as well for the "ike" record format.

Ideally the suricata object would have the same schema no matter where, but not strictly necessary, so I could be swayed either way.

I've also really come to appreciate how Elastic underscore prefixes fields that are part of their system, and not the payload, and that might be worth exploring as well, something like:

"ike": {
    "_v": 2   // IKE record version (could also use _rv, or _sv for schema version)
}

Other systems will use a @ prefix which is fine as well, just a little less friendly when working with parsed JSON in Javascript.

Any of these jump out at you? Repel you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of easily marking and identifying fields that are not part of the payload. And, for what you've said, tend to prefer the underscore approach.

Could it happen that we have both record version and schema version, for some development decision?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it happen that we have both record version and schema version, for some development decision?

No. It better not. We might have a top level schema version. But really the Suricata version can serve that role just as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even the "suricata" object is not future proof. There could be a Suricata protocol out there in the future. So "_suricata" would be the better object name.

Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.81%. Comparing base (096ba42) to head (52482af).
⚠️ Report is 40 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13927      +/-   ##
==========================================
- Coverage   83.81%   83.81%   -0.01%     
==========================================
  Files        1011     1011              
  Lines      275479   275474       -5     
==========================================
- Hits       230905   230882      -23     
- Misses      44574    44592      +18     
Flag Coverage Δ
fuzzcorpus 63.48% <100.00%> (-0.01%) ⬇️
livemode 19.02% <0.00%> (+<0.01%) ⬆️
pcap 44.75% <93.10%> (-0.06%) ⬇️
suricata-verify 65.16% <93.10%> (-0.02%) ⬇️
unittests 59.17% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline = 27759

@jasonish
Copy link
Member Author

jasonish commented Oct 1, 2025

Replaced by #13948

@jasonish jasonish closed this Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants