Commit Graph

97 Commits (e56afc6d522fbc8e124bf91bb77748b16fa43ae1)

Author SHA1 Message Date
Victor Julien 4e6f9e4a91 exception-policy: add 'reject-both' option
Allow rejecting both sides of a connection. Has the same support
as regular reject (which is essentially rejectsrc).

Ticket: #5974.
(cherry picked from commit 4905f38470)
4 months ago
Juliana Fajardini dea701b9d2 schema: add descriptions to global memcaps/memuses
For FTP and HTTP.

Related to
Task #6434
5 months ago
Juliana Fajardini c918835026 schema: add additional properties to stats.capture
The `stats.capture` object may have different properties based on the
capture method used.

This adds the ones pertaining to AF_PACKET capture.

Related to
Task #6434

(cherry-picked from commit 2855574a2c)
5 months ago
Juliana Fajardini 81f88d4fdb schema: add desc for each main stats module
Part of the schema documentation effort.

Related to
Task #6434

(cherry-picked from commit 12e0e51864)
5 months ago
Juliana Fajardini c67357f382 schema: allow stats.stream event counters
While the counters exist, they're not present in the schema, causing
validation to fail if stats.stream-events is enabled.

Task #7858

(cherry picked from commit 025ffa6135)
5 months ago
Juliana Fajardini 9307b63c8f schema/stats: flow_mgr is actually flow.mgr
The schema accounts for a stats counters group that is a subgroup of the
flows stats counters. Remove `flow_mgr`, thus.

(cherry-picked from commit 173fec81f8)
5 months ago
Juliana Fajardini 6186996ba7 flow/output: log triggered exception policies
To accompany the Exception Policy stats, also add information about any
Exception Policy triggered and for which target to the flow log event.

Task #6215

(cherry picked from commit 08e928988f)
7 months ago
Juliana Fajardini 68178749c6 exceptions: move midstream stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185

(cherry picked from commit 78b16a9b76)
8 months ago
Juliana Fajardini de657a65ce exceptions: move reassembly memcap stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185

(cherry picked from commit 9a3b1553cc)
8 months ago
Juliana Fajardini b3f4616b91 exceptions: move ssn memcap stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185

(cherry picked from commit 3e83ae9a5f)
8 months ago
Juliana Fajardini a567afb2eb exceptions: move flow memcap stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185

(cherry picked from commit 0f81190d2a)
8 months ago
Juliana Fajardini 538d8e05a0 exceptions: move defrag stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185

(cherry picked from commit b4c216a4ba)
8 months ago
Juliana Fajardini 2e77f23ab8 exceptions: move app_layer stats to common counter
Part of making the exception policy stats counters more search
friendly.

Task #7185

(cherry picked from commit 6c484064d8)
8 months ago
Juliana Fajardini 29731bbf2b stream/midstream: add counter for exception policy
Add stats counters for when there is an exception policy applied in case
of a session picked up midstream.

Task #5816

(cherry picked from commit caf590d51f)
8 months ago
Juliana Fajardini 4aff7c44db stream/reassemble: add exception policy counters
Add stats counters for exception policies applied in case of memcap hit
during stream reassembly.

Task #5816

(cherry picked from commit fd9a20ffcf)
8 months ago
Juliana Fajardini 5567703b25 stream/tcp: add ssnmemcap exception policy counter
Add stats counters for exception policies applied in case a stream
session memcap is hit.

Task #5816

(cherry picked from commit 2dee3772bf)
8 months ago
Juliana Fajardini 2ebacb2a49 applayer: add stats counters for exception errors
Add stats counters for exception policy are applied for app-layer errors

Part of
Task #5816

(cherry picked from commit a71ace8575)
8 months ago
Juliana Fajardini 1b05f36338 defrag: add exception policy memcap stats counters
Add defrag memcap stats counter.

Task #5816

(cherry picked from commit 485c0e1d9a)
8 months ago
Juliana Fajardini 6cb9a353ec decode/flow: add exception policy stats counters
We will register stats counters for all policies, even though for now
Suri only uses one possible configuration policy at a time. The idea is
that this could change in the near future, so we want to have this
ready.

Task #5816

(cherry picked from commit 657419b53e)
8 months ago
Juliana Fajardini 78ece1a7d1 decode: add stats counters for ipv4/ipv6 over ipv4
These existed for ipv6 over ipv6, and ipv4 over ipv6, but not for the
ipv4 counterpart.

Task #7758

(backported from cbe621fb09)
9 months ago
Jason Ish cd00499863 af-packet: add event for packets truncated by af-packet
Ticket: #7458
(cherry picked from commit d78f2c9a4e)
1 year ago
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)
1 year 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)
1 year ago
Victor Julien d6cede34cc decode/tcp: count urg flag
(cherry picked from commit ac02a71479)
1 year 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)
1 year 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)
1 year ago
Jason Ish 10225bdee2 eve/schema: add missing field "code" anomaly events
(cherry picked from commit b44fc62e60)
2 years ago
Juliana Fajardini 490931c166 schema/tls: add missing custom fields chain/cert
Task #7287

(cherry picked from commit 2eefc4dac8)
2 years 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)
2 years ago
Philippe Antoine b9cd802e86 eve/schema: complete and reorder smtp fields
received and cc were missing

(cherry picked from commit 8d4699fbba)
2 years ago
Sascha Steinbiss 93fd349b3f ja4: implement for TLS and QUIC
Ticket: OISF#6379
(cherry picked from commit 120313f4da)
2 years 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)
2 years 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
3 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
3 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.
3 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.
3 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
3 years ago
Philippe Antoine f35052941d jsonschema: add missing field .files[].file_id 3 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.
3 years ago
Victor Julien 735c37c668 eve/schema: add ips capture stats 3 years ago
Juliana Fajardini 0437173848 output/drop: add verdict field
Related to
Bug #5464
3 years ago
Juliana Fajardini 53b8defd79 output/alert: add verdict field
Related to
Bug #5464
3 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
3 years ago
Juliana Fajardini 05417407b3 schema: add missing flow event property: emergency 3 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.
3 years ago
Eric Leblond a73c9b0e40 output: target keys have port
Update JSON schema to support signature with target keyword
3 years ago
Victor Julien a8057eeed8 eve/schema: spelling 3 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
3 years ago