Commit Graph

2408 Commits (c717cc1e9b2a1c8d961c39ade46b8c9fde3df675)

Author SHA1 Message Date
Jason Ish b71178b667 lua/dns: handle OPT answers like TXT records
In "tx:answers()" don't attempt to push each OPT as its own string,
instead concatenate into one string like we do with TXT.

The previous method was broken and didn't work anyways, so we're not
breaking something that previously worked.

Ticket: 8843
2 months ago
Jason Ish bddf04d99b dns: fix TCP request gap resync
Ticket: #8842
2 months ago
Philippe Antoine 0c1ec09879 enip: avoid quadratic complexity with multiple service packet
Ticket: 8757
2 months ago
Jason Ish 491259842b psl: update to 2.1.228
Ticket: 8147
2 months ago
Philippe Antoine c608165c04 rfb: keep failure_reason as Vec<u8>
And log it with from_utf8_lossy

Since we may now cut a too big failure_reason breaking a valid
utf-8 string

Ticket: 8731
2 months ago
Philippe Antoine f9515dc71d rfb: limit strings length
Ticket: 8731

Adds a configurable limit to string lengths to avoid to retain
too much memory for too long, and avoid producing log events
that are too big
2 months ago
Philippe Antoine 0b0606b126 http2: log :authority header as hostname
Ticket: 8774
2 months ago
Philippe Antoine f5e44ced1e http2: use host header for http.host keyword
if :authority header is absent

Ticket: 8774
2 months ago
Victor Julien 9b491a131e nfs: fix SECINFO_NO_NAME parser handling
nfs4_res_secinfo_no_name() used a local var "i2" to walk through
the security-flavor array entries, but returned the pre-walk var "i"
in the Ok at the end. Every byte of the flavor array was therefore left
unconsumed in the input stream and re-interpreted by count next iteration
as a subsequent compound operation.

Addressed by returning i2 instead of i so all flavor bytes are consumed.

Ticket: #8860.
2 months ago
Philippe Antoine b0b353d0c0 http2: host normalization handles ipv6 address
And does not consider automatically a port after first colon

Ticket: 8778
2 months ago
Philippe Antoine 52c01543c9 http2: code cleanup for http2_normalize_host
Just separate the steps in parsing, and deduplicate code
2 months ago
Jeff Lucovsky 89d09c457c detect/bytemath: reject literal shift counts of 64
Fail rule load when byte_math pairs << or >> with a literal rvalue of
64 or more. rvalue was bounded only to u32::MAX, so a rule shifting by
100 loaded and then produced 0 for every packet it inspected, spending
detection work on a comparison whose outcome was settled before the
first packet arrived.

A variable rvalue still loads. Its value comes from a byte_extract on
the packet and is not known until the rule runs, so the guard in
DetectByteMathDoMatch() stays the only check covering that path.

DetectByteMathParse() reports every SCByteMathParse() failure as
"invalid bytemath values", so the rejected rule is named by the
"error parsing signature" line that follows rather than by the reason
the parser gave.

Issue: 8845
2 months ago
Philippe Antoine 7c669548cb nfs: optionally parse nfs3 read attr-follows
Ticket: 8750
2 months ago
Philippe Antoine 7c394b9774 datasets: add size checks for hashes read
Ticket: 8768
2 months ago
Jason Ish 99f7b1f437 dhcp: remove unused import in test
To address clippy warning.
2 months ago
Jason Ish 17bd53c29c rust/ffi: add flow accessors to flow wrapper
Ticket: #8599
2 months ago
Jason Ish d3d206faa5 rust/ffi: add safe flow storage wrapper
Add a typed FlowStorage<T> wrapper around the flow storage bindings.

Update example and docs.

Ticket: #8447
2 months ago
Jason Ish 8a5c729ac9 rust/ffi: add number setters to jsonbuilder wrapper 2 months ago
Jason Ish f3332694e3 rust/ffi: bindgen flow storage
Ticket: #8447
2 months ago
Jason Ish 8cf5d4d770 rust/ffi: use Flow wrapper in flow and eve callbacks
Pass the safe Flow wrapper to the flow init/update/finish callbacks and
the EVE callback instead of a raw sys::Flow pointer.

Ticket: #8599
2 months ago
Jason Ish b4043dc207 rust/ffi: add wrapper around Flow
Ticket: #8599
2 months ago
Jason Ish bedd65f766 flow: add accessors for flow addresses
Expose source and destination addresses as raw byte pointers, so FFI
callers do not need the internal FlowAddress layout.
2 months ago
Jason Ish c0de5bca46 flow: add accessor functions
Add accessor functions to allow NDPI and our plugin examples to access
flow fields in an opaque manner.

Provides accessors for:

- is ipv4
- is ipv6
- ip protocol
- to server packet count
- to destination packet count

Ticket: #8632
2 months ago
Lukas Sismis 3adbd677e8 app-layer: query raw protocol names
To avoid back-and-forth of http1 conversion
a second query function was added to support
existing use cases.

This change will be handy for the upcoming
default-policy for firewall settings
2 months ago
Jason Ish 7c283ba954 rust: set CARGO_ENV when generating ffi bindings
This is required when rustc is not in a standard path. The other
cbindgen calls already had this, so it was just missed while adding the
ffi bindings, but shows up when rustc is at a path like
/usr/lib/rust-1.89/bin/rustc, but that directory is not in your path.
2 months ago
Jason Ish 98f42f8462 rust: disable clippy warning for manual c str literals
Disable the clippy warning for not using modern C string
literals. Ubuntu 24.04 still ships cbindgen 0.26.0 that doesn't
support these, so migrating to modern C string literals would require
Ubuntu 24.04 users wishing to build from git to install cbindgen with
cargo.
2 months ago
Jason Ish 2bea5b6aad rust: set minimum rust version to 1.85
1.85 was chosen for now as it supports edition 2024. However, we have
not set our edition to 2024 yet.
2 months ago
Shivani Bhardwaj 2eb0b60b83 smb/log: map dcerpc uuid, opnum to service names
With this patch, the logged uuids will also have corresponding
stringified service names. The requests that will have an opnum will
have a corresponding stringified procedure name.

Feature 2727
Feature 8523
3 months ago
Shivani Bhardwaj d77f73d9a6 dcerpc/log: map uuid, opnum to service and procedure
Log the service and procedure names corresponding to a UUID and opnum
for each DCERPC event where it's available.

Feature 2727
Feature 8523
3 months ago
Shivani Bhardwaj 35d28272b2 dcerpc: add interface-service name data
This data directly comes from Zeek @d11a8750. It was scriptually
converted to NDJSON ingestible to Suricata using serde and serde_json.
The script used for this conversion lives in
scripts/extract_dce_rpc_interfaces.py.

Part of this data within Zeek codebase comes from the MITRE BZAR
project. Hence, the LICENSE file alongwith this data consists of both
the licenses: Zeek and BZAR.

Feature 2727
Feature 8523
3 months ago
Shivani Bhardwaj cee102c76d rust: add serde and serde_json as dependencies
Feature 2727
Feature 8523
3 months ago
Philippe Antoine 46880985ef http2: find content-encoding without case-sensitivity
See RFC 9110 8.4.1

> All content codings are case-insensitive

Ticket: 8760
3 months ago
Philippe Antoine dee0f03db4 detect/modbus: move modbus keyword to rust
Ticket: 3195
3 months ago
Philippe Antoine 3e70a79ed2 detect/nfs: move nfs.version to rust
Ticket: 3195
3 months ago
Jason Ish e9b08dbb2d rust: clippy fixups for 1.97
Mostly provided by clippy --fix, and one `.to_string()` removal where
not needed.
4 months ago
Victor Julien f545f06cf2 doh2: do not enable parser if http2 is disabled
DOH2 depends on HTTP/2, so it makes no sense to enable it separately.

It would also put the sub state handling in a weird state, as the DOH2
side reuses the registered HTTP/2 callbacks.
4 months ago
Victor Julien cf216b6309 http2: rename state *start to *started
This is to make the hook use names consistent with the default
hooks and other protocols.
4 months ago
Victor Julien bb41ef9caf http2: update push promise to account for stream id 0 filtering 4 months ago
Victor Julien c17ab6a65e http2: set event on frame types not allowed on stream id 4 months ago
Victor Julien 63b8143577 http2: register names for states per sub-state 4 months ago
Victor Julien 14100d795c http2: mark HTTP2TxProgress and HTTP2TxGlobalProgress as AppLayerState 4 months ago
Victor Julien b36ec146aa detect/dns: register keywords for DOH2 as well
Now that DNS keywords are no longer registered for DOH2, the keywords
need to manually registered for DOH2.
4 months ago
Victor Julien 7ebc699df0 http2: split transaction state machines
Split into 2 sub-states:
- stream, which has the "HTTP" requests and responses, including DOH2
- global, which has the settings and other global or control handling

Introduce a simpler progress tracking for the global sub state:
- HTTP2ProgGlobalStart and HTTP2ProgGlobalComplete.

The stream sub state uses the same state machine as before.

Ticket: #8386.
4 months ago
Victor Julien 95365ce05b detect: support per tx sub states
Support for per transaction sub states: different state machines per
transaction type.

Skip engines not belonging to our substate.

Store tx_type in DetectTransaction.

Each protocol supporting sub states will register states from 1 and up.

To support:

Ticket: #8386.
4 months ago
Victor Julien b6bc025789 app-layer: start of substate API support
Allow registration of per substate progress name mappings.

Implement logic for getting sub-state names, id's.

Add transaction type and end of progress values to AppLayerTxData.

Introduce helpers to keep logic clean.
4 months ago
Philippe Antoine 9c244c978a snmp/detect: add snmp.trap_address keyword
Ticket: 8486
4 months ago
Philippe Antoine 08b0adf09d snmp/detect: add snmp.trap_oid keyword
Ticket: 8485
4 months ago
Philippe Antoine 752dae89ea detect: add progress argument to SCDetectRegisterMpmGeneric
Will be needed by snmp
4 months ago
Philippe Antoine 7d024a840c rust: bindgen detect ThreadCtx keyword functions 4 months ago
Philippe Antoine 5fe920ec42 detect: make Http2ThreadBuf a generic DetectThreadBuf
to be used by snmp and other
4 months ago