|
| 1 | +EVE JSON Schema |
| 2 | +############### |
| 3 | + |
| 4 | +The Suricata source distribution contains a JSON schema for the EVE |
| 5 | +log files. This schema follows the `JSON Schema |
| 6 | +<https://json-schema.org/>`_ specification and can be found in |
| 7 | +``etc/schema.json``. If your distribution does not contain this file, |
| 8 | +it can be viewed online at |
| 9 | +https://github.com/OISF/suricata/blob/master/etc/schema.json, but note |
| 10 | +that it is version specific and may change between major versions of |
| 11 | +Suricata. |
| 12 | + |
| 13 | +This schema attempts to log all possible fields that may be seen in |
| 14 | +Suricata's **EVE** output, including their datatype. It also includes |
| 15 | +extensions to help map log fields to related detection keywords. |
| 16 | + |
| 17 | +Suricata Schema Extensions |
| 18 | +^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 19 | + |
| 20 | +We have extended JSON schema with a ``suricata`` object to add extra |
| 21 | +Suricata context such as detection keywords related to a log field, |
| 22 | +for example: |
| 23 | + |
| 24 | +.. code-block:: json |
| 25 | +
|
| 26 | + "rrname": { |
| 27 | + "type": "string", |
| 28 | + "suricata": { |
| 29 | + "keywords": [ |
| 30 | + "dns.answers.rrname", |
| 31 | + "dns.response.rrname" |
| 32 | + ] |
| 33 | + } |
| 34 | + } |
| 35 | +
|
| 36 | +The above shows that a field named ``rrname`` has 2 keywords that are |
| 37 | +related. Please refer to the keyword documentation to see precisely |
| 38 | +how they are used and related to the field being logged. |
| 39 | + |
| 40 | +Extension Reference |
| 41 | +=================== |
| 42 | + |
| 43 | +The ``suricata`` extension object is valid on objects inside the |
| 44 | +``properties`` object. The ``suricata`` object may accept the |
| 45 | +following fields: |
| 46 | + |
| 47 | +``keywords`` |
| 48 | +------------ |
| 49 | + |
| 50 | +**Type:** ``array`` or ``boolean`` |
| 51 | + |
| 52 | +* **When an array:** Contains keyword names that are related to this |
| 53 | + JSON property. Each keyword in the array represents a detection rule |
| 54 | + keyword that can be used to match against the corresponding field |
| 55 | + value. |
| 56 | + |
| 57 | +* **When ``false``:** Indicates that this JSON property has no |
| 58 | + applicable keyword. This is used for metadata fields that don't |
| 59 | + correspond to actual network data. For example, the ``version`` |
| 60 | + field inside a DNS object denotes the version of the log format and |
| 61 | + is unrelated to any aspect of a DNS message, therefore no keyword is |
| 62 | + applicable. |
| 63 | + |
| 64 | +.. note:: As of Suricata 8.0, mapping log fields to detection keywords |
| 65 | + is a work in progress. Any field that does not have a |
| 66 | + ``suricata.keywords`` value still needs to be evaluated. |
| 67 | + |
| 68 | +Schema Tooling |
| 69 | +^^^^^^^^^^^^^^ |
| 70 | + |
| 71 | +* `Suricata-Verify <https://github.com/OISF/suricata-verify>`_: Our |
| 72 | + own tool for verifying every Suricata pull request, validates all |
| 73 | + EVE logs generated against the schema. |
| 74 | + |
| 75 | +* ``./scripts/eve-parity.py``: Found inside the Suricata source code |
| 76 | + when checked out with ``git`` is a tool to provide information on |
| 77 | + how log fields map to keywords, or how keywords map to log entries. |
| 78 | + |
| 79 | +* ``./scripts/evedoc.py``: Generate documentation from the schema, |
| 80 | + such as the :doc:`eve-index` included in this documentation. |
0 commit comments