Commit Graph

190 Commits (suricata-8.0.0)

Author SHA1 Message Date
Shivani Bhardwaj fc1dbf6eb4 schema: add rule keyword mapping for dcerpc 5 months ago
Jason Ish 744f301df4 eve-parity: handle arrays of scalars
And add an example with "client_alpns".
5 months ago
Jason Ish 771d9d9d8b schema: mark dns.version and dns.grouped as having no keywords 5 months ago
Jason Ish 00a571a25c schema: mark "stats" and "drop" as having no keywords 5 months ago
Jason Ish 115d7d3c6d schema: add an object for mapping fields to keywords
To some EVE fields and a "suricata" object that contains an array of
keywords. These are the keywords that map directly to this field, or
somehow cover this field.

This is an attempt at tooling to help with EVE and keyword parity.

Related to tickets: #5642, #6463, #4772
5 months ago
Jeff Lucovsky cbda276aeb output: Log ethernet type
Issue 7129

When configured with the existing "ethernet" switch, include the ether
type in the output.

This is most useful with anomaly records indicating unknown ethertypes.
6 months ago
Jeff Lucovsky 123b36b9f5 decode/ethertype: Event on unknown ethertype
Issue: 7129

Create a decode/engine event if unknown ethertypes are observed.
6 months ago
Philippe Antoine b967fcaf8f stats: remove unused pseudo_failed stat 7 months ago
Philippe Antoine b0282f49af http2: complete json schema
git grep js.set_string rust/src/http2/logger.rs | grep '"' |
cut -d'"' -f2 | sort | uniq | while read i;
do echo -n $i; git grep $i etc/schema.json | wc -l; done

shows only has_multiple was missing
7 months ago
Victor Julien 779f9d8ba3 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.
8 months ago
Victor Julien 6882bcb3e5 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.
8 months ago
Victor Julien ac02a71479 decode/tcp: count urg flag 8 months ago
Jason Ish 37f4c52b22 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
8 months ago
Philippe Antoine f2c3776314 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.
8 months ago
Philippe Antoine 09ba69cfb0 output/http: log invalid status as a string
Ticket: 7311

If response_status_number is not a valid poisitive integer,
we should not try to parse it again, and fail again,
but just log the raw string.
8 months ago
Jeff Lucovsky b30df19f1a app-layer/stats: Expand memuse/memcap handling
This commit adds memcap/memuse handling to the unix-socket interface:
- ftp
- http-byterange
- host

New stats:
- ippair: memuse, memcap
- host: memuse, memcap
- http-byterange: memuse, memcap
9 months ago
Jason Ish b44fc62e60 eve/schema: add missing field "code" anomaly events 9 months ago
Juliana Fajardini 2eefc4dac8 schema/tls: add missing custom fields chain/cert
Task #7287
10 months ago
Jason Ish 6ae5ae701b doc/userguide: generate eve documentation
Add EVE documentation for QUIC and Pgsql to their respective sections of
the userguide.

Also add a complete EVE reference as an appendix.

Other protocols can be done, but its a manual process to document in the
schema, then add the glue to pull them into the documentation.

The documentation is generated during "make dist", or if it doesn't
exist, "conf.py" will attempt to generate the eve documentation for
building on Readthedocs.
10 months ago
Jeff Lucovsky a7b70ce5ce config: Update reference keys
Issue: 4974

1. Use https instead of http everywhere
2. Organize and annotate references by
    - Referenced by ET/Open and ET/Pro
        - URL resolves and works as intended (to provide supplemental
          information regarding a reference value, e.g., bug id, cve
          value)
        - URL no longer resolves
        - URL resolves but doesn't work as intended (to provide
          supplemental information)
    - Not referenced by ET/Open nor ET/Pro
        - URL resolves and works as intended (to provide supplemental
          information regarding a reference value, e.g., bug id, cve
          value)
        - URL no longer resolves
        - URL resolves but doesn't work as intended (to provide
          supplemental information)
10 months ago
Jeff Lucovsky 9bc468e63a alert/reference: Optionally add reference(s)
Issue: 4974

Optionally include rule references with the alert. Since there can be
multiple reference keywords, they are collected into an array.
10 months ago
Giuseppe Longo edf70276d6 rust/ldap: enable parser for udp
This introduces a new parser registration function for LDAP/UDP, and update
ldap configuration in order to be able to enable/disable a single parser
independently (such as dns).
Also, GAPs are accepted only for TCP parser and not for UDP.

Ticket #7203
12 months ago
Shivani Bhardwaj 638b5c4da7 eve/stats: add description for flow stats
Ticket 6434
1 year ago
Philippe Antoine 1e82e20c65 doh: implement dns over http2 app-proto
Ticket: 5773
1 year ago
Giuseppe Longo 910a5b226c rust/ldap: implement logger 1 year ago
Jason Ish fcc1b1067b 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
1 year ago
Jason Ish df656324ba dns: new v3 style logging for alerts
V3 style DNS logging fixes the discrepancies between request and
response logging better dns records and alert records.

The main change is that queries and answers are always logged as
arrays, and header fields are not logged in array items.

For alerts this means that answers are now logged as arrays, queries
already were.

DNS records will get this new format as well, but with a configuration
parameter.

Bug: #6281
1 year ago
Nathan Scrivens 9ecc3573a7 dns: parse and populate OPT rdata struct
Feature: 7017
Add DNSRDataOPT struct and DNSRData enum type OPT.
Add OPT parsing function and test function.
Add DNSRData OPT type to lua.rs match.
Log OPT rdata.
1 year ago
Nathan Scrivens 4598ca164d dns log: add additional section
Feature: 7011
dns_log_json_answer: log additional section records.
update schema.json with new "additionals" section.
1 year ago
Philippe Antoine c9ce43b31e output: configurable payload_length field for alerts
Ticket: 7098
1 year ago
Victor Julien 869d5492dc eve/schema: update for alpn 1 year ago
Victor Julien 7f474af1d0 eve/schema: minor enip reformat 1 year ago
Philippe Antoine 82c03f72c3 enip: convert to rust
Ticket: 3958

- transactions are now bidirectional
- there is a logger
- gap support is improved with probing for resync
- frames support
- app-layer events
- enip_command keyword accepts now string enumeration as values.
- add enip.status keyword
- add keywords :
    enip.product_name, enip.protocol_version, enip.revision,
    enip.identity_status, enip.state, enip.serial, enip.product_code,
    enip.device_type, enip.vendor_id, enip.capabilities,
    enip.cip_attribute, enip.cip_class, enip.cip_instance,
    enip.cip_status, enip.cip_extendedstatus
1 year ago
Shivani Bhardwaj de1de53e2f eve/stats: add description for flow mgr & recycler
Ticket 6434
1 year ago
Philippe Antoine 9332bc2c45 dns: adds missing NS field in json schema 1 year ago
Philippe Antoine 8d4699fbba eve/schema: complete and reorder smtp fields
received and cc were missing
1 year ago
Victor Julien 1190e426f9 defrag: remove trackers on lookup
When looking up a tracker, remove any timed out / completed trackers.
1 year ago
Victor Julien 75b78d7643 defrag: add defrag.memuse counter
Gives a current snapshot of the memory in use by the defrag engine.
1 year ago
Victor Julien 83dc703d1f defrag: add various counters 1 year ago
Victor Julien fc05d253d2 defrag: add defrag.mgr.tracker_timeout counter
Updated by flow manager.
1 year ago
Victor Julien 76e05c72f6 eve/schema: reformat 1 year ago
Jason Ish 10e6028175 lua: track memory limit exceede errors
Update the Lua allocated to set a code on memory allocation limit
exceeded errors so an appropriate error message can be logged and a
state incremented.

Fixes the tracking of the allocated size by using the difference
between original size, and new size and toss in some debug
validations.
1 year ago
Jason Ish 5a1cba72f0 lua: add logging and counter for instruction limit being exceeded 1 year ago
Jason Ish c8fa454cb2 lua: add blocked functions as a special log type plus stat
Distinguish between a generic Lua script error and an error created by a
function being blocked, so each is logged once respective of each other.

Also add a stat that is incremented when a script fails due to a
blocked function.

NOTE: This does not catch calls to functions that are blocked by not
having the library loaded, such as "io.open", as they are blocked by
not even loading the "io" library.
1 year ago
Shivani Bhardwaj f073cf2350 eve/schema: add tls.subjectaltname fields
Feature 5234
1 year ago
Jason Ish 224f55ba21 detect/lua: don't treat a crashed script as no match
If a rule script crashed, the return value was treated as a no
match. This would make a negation of the rule match and alert.

Instead cleanup and exit early if the rule script crashed and don't
run negation logic.

A stat, detect.lua.errors has been added to count how many times a
script crashes.

Also consolidates the running of the Lua script and return value
handling to a common function.

Bug: #6940
1 year ago
Philippe Antoine 2c305ba37e pop3: protocol detection
Ticket: #6366
1 year ago
Giuseppe Longo 01586d884d output-json/arp: implement logger
This adds a logger for ARP, disabled by default.

Ticket #6827
1 year ago
Giuseppe Longo 5219a5da5f decode/arp: implement decoder
This adds a decoder for ARP.

Ticket #6827
1 year ago
Shivani Bhardwaj 329ac61961 eve/stats: add description for ips
Ticket 6434
1 year ago
Shivani Bhardwaj 861ffff972 eve/stats: add description for transactions
Ticket 6434
1 year ago
Giuseppe Longo bff790b6ac rust/sdp: implement logger
This implements a logger for the SDP protocol.
Given that SDP is encapsulated within other protocols (such as SIP),
enabling it separately is not necessary.

Ticket #6627
1 year ago
Philippe Antoine 0291d37009 websocket: configurable logging of payload in alerts 1 year ago
Philippe Antoine 44b6aa5e4b app-layer: websockets protocol support
Ticket: 2695
1 year ago
Sascha Steinbiss 120313f4da ja4: implement for TLS and QUIC
Ticket: OISF#6379
1 year ago
Jeff Lucovsky 2dfa4cecb5 stats: Memcap pressure max relocation
This commit moves the memcap pressure/pressure_max stats from the global
stats namespace into the memcap namespace.

With per-thread stats, they will be within the flow-manager's values.

Issue: 6398
1 year ago
Juliana Fajardini caf590d51f 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
1 year ago
Juliana Fajardini fd9a20ffcf stream/reassemble: add exception policy counters
Add stats counters for exception policies applied in case of memcap hit
during stream reassembly.

Task #5816
1 year ago
Juliana Fajardini 2dee3772bf stream/tcp: add ssnmemcap exception policy counter
Add stats counters for exception policies applied in case a stream
session memcap is hit.

Task #5816
1 year ago
Juliana Fajardini a71ace8575 applayer: add stats counters for exception errors
Add stats counters for exception policy are applied for app-layer errors

Part of
Task #5816
1 year ago
Juliana Fajardini 485c0e1d9a defrag: add exception policy memcap stats counters
Add defrag memcap stats counter.

Task #5816
1 year ago
Juliana Fajardini 657419b53e 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
1 year ago
Juliana Fajardini ce001d8eae schema: apply clang formatting changes 1 year ago
Arne Welzel f9cf87a003 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.
1 year ago
Jason Ish c2ecae9b82 schema: add flow.wrong_thread 1 year ago
Giuseppe Longo c9d309219e rust/sip: register parser for tcp
This patch lets the parser to work over tcp protocol, taking care of handling
data before calling the request/response parsers.

Ticket #3351.
1 year ago
Hadiqa Alamdar Bukhari 6c193b1a3d dns: add missing dns keywords to schema.json
Found and added missing dns fields in schema.json after manual code review.
Added description to these newly added dns fields.
Feature #5642
1 year ago
Shivani Bhardwaj 487ba82fb9 eve/stats: add description for applayer flows
Ticket 6434
1 year ago
Shivani Bhardwaj 8817514bea eve/stats: add description for expectations
Ticket 6434
1 year ago
Shivani Bhardwaj 1816e98ef0 eve/stats: add description for applayer errors
Ticket 6434
1 year ago
Shivani Bhardwaj 5a1a32ba5b eve/stats: add description for common fields
Ticket 6434
1 year ago
Jason Ish 90ae3a223f eve/schema: allow authorities in dns.answers in alert
Factor out dns.authorities to a definition.
2 years ago
Jason Ish b453eea150 stats: add rules skipped
Rule skipped is a count of the number of rules that are skipped due to
missing requirements.

Feature: #6637
2 years ago
Philippe Antoine f714678d72 schema: adds missing modbus field
./stats/app_layer/error/modbus
2 years ago
Juliana Fajardini 467c3f2c64 schema: apply clang formatting changes 2 years ago
Juliana Fajardini 30ac77ce65 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
2 years ago
Philippe Antoine 8c5310aefd doc: quic in eve/schema
Ticket: #6076
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