Commit Graph

76 Commits (suricata-7.0.8)

Author SHA1 Message Date
Victor Julien c4d8790db8 eve/flow: add per flow TCP oob urg data counter
If TCP urgent handling is set to the OOB processing, the number of OOB
bytes is tracked for SEQ offset calculations. If this offset is
non-zero, add the field to the flow record.

Ticket: #7411.
(cherry picked from commit 779f9d8ba3)
8 months ago
Victor Julien 870fe6ea19 stream: add TCP urgent handling options
TCP urgent handling is a complex topic due to conflicting RFCs and
implementations.

Until now the URG flag and urgent pointer values were simply ignored,
leading to an effective "inline" processing of urgent data. Many
implementations however, do not default to this behavior.

Many actual implementations use the urgent mechanism to send 1 byte of
data out of band to the application.

Complicating the matter is that the way the urgent logic is handled is
generally configurable both of the OS and the app level. So from the
network it is impossible to know with confidence what the settings are.

This patch adds the following policies:

`stream.reassembly.urgent.policy`:

- drop: drop URG packets before they affect the stream engine

- inline: ignore the urgent pointer and process all data inline

- oob (out of band): treat the last byte as out of band

- gap: skip the last byte, but do no adjust sequence offsets, leading to
       gaps in the data

For the `oob` option, tracking of a sequence number offset is required,
as the OOB data does "consume" sequence number space. This is limited to
64k. For this reason, there is a second policy:

`stream.reassembly.urgent.oob-limit-policy`:

- drop: drop URG packets before they affect the stream engine

- inline: ignore the urgent pointer and process all data inline

- gap: skip the last byte, but do no adjust sequence offsets, leading to
       gaps in the data

Bug: #7411.
(cherry picked from commit 6882bcb3e5)
8 months ago
Victor Julien d6cede34cc decode/tcp: count urg flag
(cherry picked from commit ac02a71479)
8 months ago
Jason Ish 5edb84fe23 eve/dns: add truncation flags for fields that are truncated
If rrname, rdata or mname are truncated, set a flag field like
'rrname_truncated: true' to indicate that the name is truncated.

Ticket: #7280

(cherry picked from commit 37f4c52b22)
8 months ago
Philippe Antoine 19a638611b detect: log app-layer metadata in alert with single tx
Ticket: 7199

Uses a config parameter detect.guess-applayer-tx to enable
this behavior (off by default)

This feature is requested for use cases with signatures not
using app-layer keywords but still targetting application
layer transactions, such as pass/drop rule combination,
or lua usage.

This overrides the previous behavior of checking if the signature
has a content match, by checking if there is only one live
transaction, in addition to the config parameter being set.

(cherry picked from commit f2c3776314)
8 months ago
Jason Ish 10225bdee2 eve/schema: add missing field "code" anomaly events
(cherry picked from commit b44fc62e60)
9 months ago
Juliana Fajardini 490931c166 schema/tls: add missing custom fields chain/cert
Task #7287

(cherry picked from commit 2eefc4dac8)
9 months ago
Jason Ish 03844b4291 eve/dns: make version required
The "eve.version" field is not always logged. Update the schema to
enforce that it is, and fix it for records that don't log it.

Ticket: #7167
(cherry picked from commit fcc1b1067b)
11 months ago
Philippe Antoine b9cd802e86 eve/schema: complete and reorder smtp fields
received and cc were missing

(cherry picked from commit 8d4699fbba)
1 year ago
Sascha Steinbiss 93fd349b3f ja4: implement for TLS and QUIC
Ticket: OISF#6379
(cherry picked from commit 120313f4da)
1 year ago
Arne Welzel ba46f2ff3e schema: Add stats.capture and in_iface properties
New suricata-verify test listens on loopback interface, resulting
in the capture and in_iface fields in the stats and event objects.

(cherry picked from commit f9cf87a003)
1 year ago
Jason Ish 6e9d790581 stats: add rules skipped
Rule skipped is a count of the number of rules that are skipped due to
missing requirements.

Feature: #6637
(cherry picked from commit b453eea150)
2 years ago
Juliana Fajardini dda79c689c pgsql: add cancel request message
A CanceldRequest can occur after any query request, and is sent over a
new connection, leading to a new flow. It won't take any reply, but, if
processed by the backend, will lead to an ErrorResponse.

Task #6577

(cherry picked from commit 30ac77ce65)
2 years ago
Jeff Lucovsky 904f0ddeee stats: Track stream reassembly drops
Issue: 6235
2 years ago
Yatin Kanetkar b67ff4badf dhcp: Log Vendor Client Identifier (dhcp option 60)
* Log vendor client identifier (dhcp option 60) if extended dhcp
logging is turned on. This required the `vendor_client_identifier` to
be added to the json schema. Validation done using an SV Test
* Added `requested_ip` to the json schema as well, since it was
missed. My SV test failed without it.

Feature #4587
2 years ago
Jason Ish 3802a51552 eve/schema: add host
The "host" field is added to EVE events if the "sensor-name" field is
configured in suricata.yaml.
2 years ago
Jeff Lucovsky 424f12d1b3 schema: Add memcap pressure values
Issue: 6094

This commit extends the EVE schema with memcap_pressure values; these
are included in the stat event type records.
2 years ago
Philippe Antoine b12a35c3cf output: add storing boolean for files
When filestore keyword is triggered, the file is not yet stored,
when the alert is generated, but only marked for storing.

Ticket: 4881
2 years ago
Philippe Antoine f35052941d jsonschema: add missing field .files[].file_id 2 years ago
Victor Julien 1f9767a9cb stats: add drop reason counters
{
  "accepted": 296185,
  "blocked": 162,
  "rejected": 0,
  "replaced": 0,
  "drop_reason": {
    "decode_error": 0,
    "defrag_error": 0,
    "defrag_memcap": 0,
    "flow_memcap": 0,
    "flow_drop": 94,
    "applayer_error": 0,
    "applayer_memcap": 0,
    "rules": 3,
    "threshold_detection_filter": 0,
    "stream_error": 63,
    "stream_memcap": 0,
    "stream_midstream": 2,
    "nfq_error": 0,
    "tunnel_packet_drop": 0
  }
}

Ticket: #6230.
2 years ago
Victor Julien 735c37c668 eve/schema: add ips capture stats 2 years ago
Juliana Fajardini 0437173848 output/drop: add verdict field
Related to
Bug #5464
2 years ago
Juliana Fajardini 53b8defd79 output/alert: add verdict field
Related to
Bug #5464
2 years ago
Philippe Antoine 4f4651e360 output/file: http2 metdata is logged in http object
as is done for http2 events and alerts.
The http.version integer can help to determine if this is HTTP2

Ticket: #6165
2 years ago
Juliana Fajardini 05417407b3 schema: add missing flow event property: emergency 2 years ago
Jeff Lucovsky 9dc68ac59a json/schema: Add additional VLAN layer stat
Issue: 2816

This commit extends the JSON schema with the additional VLAN stat for
tracking VLAN encapsulated packets with 3 levels.
2 years ago
Eric Leblond a73c9b0e40 output: target keys have port
Update JSON schema to support signature with target keyword
2 years ago
Victor Julien a8057eeed8 eve/schema: spelling 2 years ago
Philippe Antoine 416a780f69 jsonschema: do not enforce keys for alert metadata
As this is a free field and can have any key based on a rule
2 years ago
Jason Ish 3a44197183 schema: add "message_id" to email 2 years ago
Jason Ish bf079c9214 schema: fix optional
"optional" is not part of jsonschema. Instead an array named "required"
is used to list all field names that are required.
2 years ago
Jason Ish 49ba378d38 schema: fix engines section
The definition of items is an object, not an array.
2 years ago
Lancer Cheng 08b17e9778 eve: add version and warning in ntlmssp
Bug OISF#5783
2 years ago
Victor Julien 7e6154a26f stream: add counter for acks for unseen data
This is another indicator for packet loss or strange captures.
2 years ago
Victor Julien 83a16a7a89 eve/stream: per packet stream engine logging
Debug facility to get a per packet view into the stream engine's state.

Logs after a packet has been processed in the stream engine, so the view
into the state includes the updates based on the current packet.

Marked as experimental so it can be changed w/o notice.

Bug: #5876.
2 years ago
Victor Julien 66ed3ae6e4 flow/mgr: remove flows_timeout_inuse counter 3 years ago
Jason Ish 59d9a51bad eve: remove dcerpc.interface from schema
Looks like this was due to an error in the dcerpc logging where the
interfaces should have been logged to the "interfaces" array that was
already defined.

Issue: 5814
3 years ago
Jason Ish ef48c5064f schema: add regular expression for tls date format 3 years ago
Jeff Lucovsky c1c67536b6 decode/stat: Add decode counters for unknown/arp
Issue: 5761

This commit adds statistics for ARP and unknown ethertype packets for
diagnostic purposes.
3 years ago
Shivani Bhardwaj 8e3acf1695 eve/schema: add udp.len_invalid 3 years ago
Jason Ish c98c49d4ba dns: parse and alert on invalid opcodes
Accept DNS messages with an invalid opcode that are otherwise
valid. Such DNS message will create a parser event.

This is a change of behavior, previously an invalid opcode would cause
the DNS message to not be detected or parsed as DNS.

Issue: #5444
3 years ago
Victor Julien 96dfd65b96 eve: log max regions 3 years ago
Jeff Lucovsky f8474344cd log: Add module and subsystem identifiers to log
Issue: 2497

This changeset provides subsystem and module identifiers in the log when
the log format string contains "%S". By convention, the log format
surrounds "%S" with brackets.

The subsystem name is generally the same as the thread name. The module
name is derived from the source code module name and usually consists of
the first one or 2 segments of the name using the dash character as the
segment delimiter.
3 years ago
Victor Julien 62a451a9ab eve/schema: bittorrent format fixup 3 years ago
Philippe Antoine 37af957d83 eve/schema: check that each array has at least one element
Ticket: #5167
3 years ago
Juliana Fajardini 84f9ea7254 eve/schema: pgsql - allow flexible parameters list
Pgsql's parameters - for message types like StartupMessage and
ParameterStatus, for instance, don't have a finite, definitive set, as
per their documentation. Our json schema was allow expecting a fixed set
of parameters, though, resulting in SV tests failing if different, valid
parameters appeared.

Bug #5579
3 years ago
Jason Ish e3e7d007b2 eve/schema: bittorrent-dht updates
Some values that were previously strings are now parsed down into
objects.
3 years ago
Jason Ish 0d3cfbbe3f bittorrent-dht/eve: log as bittorrent_dht 3 years ago
Jason Ish 66fc92276a eve-schema: add bittorrent-dht 3 years ago
Eric Leblond 27cdfec28a eve/schema: update following flow changes 3 years ago