Commit Graph

1929 Commits (master)

Author SHA1 Message Date
Shivani Bhardwaj e4b3b75b23 version: start development towards 8.0.1 7 days ago
Shivani Bhardwaj 9956286fb8 release: 8.0.0; update changelog 1 week ago
Philippe Antoine fa8d3a4ccb http2: do not set file flags for global txs
Global txs means here txs with stream id 0, used for connection control
messages.
2 weeks ago
Philippe Antoine 349c21af2c http2: mark old txs as updated
As is done in the other case a few lines below
2 weeks ago
Philippe Antoine 1d6d331752 http2: forbid data on stream 0
Ticket: 7658

Suricata will not handle well if we open a file for this tx,
do not close it, but set the transaction state to completed.

RFC 9113 section 6.1 states:

If a DATA frame is received whose Stream Identifier field is 0x00,
the recipient MUST respond with a connection error (Section 5.4.1)
 of type PROTOCOL_ERROR.
2 weeks ago
Jason Ish c204ddb3e5 rust/Makefile: sort filenames
Misc cleanup as these lists are growing.
2 weeks ago
Jason Ish f68b06798f rust/htp: follow suricata versioning
Have htp follow Suricata versioning so we don't have to worry about
version updates as it changes.

For example, between 8.0.0-beta1 and 8.0.0-rc1 there were changes to
the htp, however the version stayed at 2.0.0 making it impossible to
publish these changes to crates.io.
2 weeks ago
Philippe Antoine 1940454a69 http: do not yield after failed connect if already pipelined
Ticket: 7791
2 weeks ago
Philippe Antoine 10150e95ad rust: allow collapsible_else_if for debug logs
see https://github.com/rust-lang/rust-clippy/issues/15158
3 weeks ago
Philippe Antoine a22b2f06fe rust/htp: fix clippy uninlined_format_args
--> htp/src/decompressors.rs:703:64
    |
703 |                 std::io::Error::new(std::io::ErrorKind::Other, format!("{}", e))
    |                                                                ^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
3 weeks ago
Jeff Lucovsky 7e713cb45a detect/analyzer: Support u8 types
Issue: 6359

Support JSON output of u8 types
3 weeks ago
Philippe Antoine bca6cbfb04 rust: fix prototype for AppLayerParserTriggerRawStreamInspection
Ticket: 7762

As it modifies the flow indeed
4 weeks ago
Philippe Antoine f8168493f6 rust: remove unnecessary cbindgen exclusions 4 weeks ago
Philippe Antoine 59a5b53809 util/mpm: constify arg
and make rust version use the correct integer type

Ticket: 7762
4 weeks ago
Shivani Bhardwaj 6a6104304d version: start development towards 8.0.0 4 weeks ago
Shivani Bhardwaj cdfebcdc9c release: 8.0.0-rc1; update changelog 1 month ago
Jason Ish 25b8cd9761 lua: update to lua 5.4.8002
This updated crates remove tmpnam from being linked in, removing the
warning.
1 month ago
Eric Leblond dd94dc6cc6 datajson: introduce feature
This patch introduces new option to dataset keyword.
Where regular dataset allows match from sets, dataset with json
format allows the same but also adds JSON data to the alert
event. This data is coming from the set definition it self.
For example, an ipv4 set will look like:

  [{"ip": "10.16.1.11", "test": "success","context":3}]

The syntax is a JSON array but it can also be a JSON object
with an array inside. The idea is to directly used data coming
from the API of a threat intel management software.

The syntax of the keyword is the following:

  dataset:isset,src_ip,type ip,load src.lst,format json, \
       enrichment_key src_ip, value_key ip;

Compare to dataset, it just have a supplementary option key
that is used to indicate in which subobject the JSON value
should be added.

The information is added in the even under the alert.extra
subobject:

  "alert": {
    "extra": {
      "src_ip": {
        "ip": "10.6.1.11",
        "test": "success",
        "context": 3
      },

The main interest of the feature is to be able to contextualize
a match. For example, if you have an IOC source, you can do

 [
   {"buffer": "value1", "actor":"APT28","Country":"FR"},
   {"buffer": "value2", "actor":"APT32","Country":"NL"}
 ]

This way, a single dataset is able to produce context to the
event where it was not possible before and multiple signatures
had to be used.

The format introduced in datajson is an evolution of the
historical datarep format. This has some limitations. For example,
if a user fetch IOCs from a threat intel server there is a large
change that the format will be JSON or XML. Suricata has no support
for the second but can support the first one.

Keeping the key value may seem redundant but it is useful to have it
directly accessible in the extra data to be able to query it
independantly of the signature (where it can be multiple metadata
or even be a transformed metadata).

In some case, when interacting with data (mostly coming from
threat intel servers), the JSON array containing the data
to use is not at the root of the object and it is ncessary
to access a subobject.

This patch implements this with support of key in level1.level2.
This is done via the `array_key` option that contains the path
to the data.

Ticket: #7372
1 month ago
Pierre Chifflier adcee8d7b5 ldap: avoid unneeded renaming of variables 1 month ago
Pierre Chifflier ebc1678c5c ldap: fix clippy warnings (unneded conversions) 1 month ago
Pierre Chifflier bda22c1f4a ldap: factorize code and remove duplicated structs, use ldap_parser where relevant 1 month ago
Pierre Chifflier c152c5c7e0 ldap: update ldap-parser to 0.5.0 1 month ago
Philippe Antoine 6dbc421825 rust: bindgen AppLayerParserConfParserEnabled
Ticket: 7667
1 month ago
Philippe Antoine 49b2a2be5d rust: bindgen SCAppLayerParserRegisterLogger
Ticket: 7667
1 month ago
Philippe Antoine 7bfef2e1e8 rust: bindgen AppLayerParserRegisterParserAcceptableDataDirection
Ticket: 7667
1 month ago
Philippe Antoine 1ff4dbfc24 rust: bindgen AppLayerParserSetStreamDepth
Ticket: 7667
1 month ago
Philippe Antoine b29d46d81f rust: bindgen SCAppLayerParserStateIssetFlag
Ticket: 7667
1 month ago
Philippe Antoine 6d56beffef rust: bindgen AppLayerParserStateSetFlag
Ticket: 7667
1 month ago
Jason Ish 1aaf5cb7d2 rust: allow some lints in suricatactl and suricatasc
These are lints we allow in the Suricata Rust source code for style
reasons.
1 month ago
Jason Ish 89ba53272c suricatasc: reconnect on loss of connection
If the connection is lost (for example, Suricata is restarted), try to
re-open the connect and re-execute the command.

This was the behavior of the Python implementation.

Ticket: #7746
1 month ago
Shivani Bhardwaj 16eb56aa73 sip: fix inspection direction 1 month ago
Jason Ish f0411c079d rust: fix compiler warning for confusing lifetimes
For example:

error: lifetime flowing from input to output with different syntax can be confusing
   --> htp/src/headers.rs:475:16
    |
475 | fn null(input: &[u8]) -> IResult<&[u8], ParsedBytes> {
    |                ^^^^^             -----  ----------- the lifetimes get resolved as `'_`
    |                |                 |
    |                |                 the lifetimes get resolved as `'_`
    |                this lifetime flows to the output
    |
note: the lint level is defined here
   --> htp/src/lib.rs:3:9

This currently only happens when using the Rust nightly compiler, which
we use for our fuzz builds.
1 month ago
Jason Ish b83c2dacd4 lua: update to Lua 5.4.8
Also uses a proper Lua tagged version that is not a pre-release.

Ticket: #7632
1 month ago
Jason Ish e7366e43b5 rust: update deps
Update all deps with cargo update. Additionally, apply the updated
versions to the Cargo.toml, which while not stricly required, does
make it more clear what the version in use is.
1 month ago
Jason Ish 332bc6a05b rust: fix new clippy issues with MSRV update 1 month ago
Jason Ish 7de03a5ef3 rust: update clap and rustyline
With a MSRV of 1.75.0 we can now use current Clap. Rustlyline is
updated, but still needs to be held back from the most current
release.
1 month ago
Jason Ish 55a0d403cb rust: unpin once_cell from old version
We can now update to the current version of once_cell with Rust 1.75.
1 month ago
Jason Ish f0eaebe3a6 rust: set MSRV to 1.75.0
This is the Rust version found on Ubuntu LTS releases as of today, and
is the oldest we need to support.

Ticket: #6573
1 month ago
Jeff Lucovsky a292670443 detect/entropy: Add calculated entropy value to flowvars
When the entropy keyword is used, record the calculated entropy value to
a flow variable for logging use.
1 month ago
Philippe Antoine 79544d0f1e rust: remove some unneeded cbindgen:ignore
Ticket: 7667
1 month ago
Philippe Antoine 7bb0c94ae9 rust: bindgen app-layer-detect-proto.h
Ticket: 7667
1 month ago
Juliana Fajardini 765041dcdd pgsql: fix clippy warnings 1 month ago
Juliana Fajardini be47de4f6d pgsql: fix typo in comment that changed meaning 1 month ago
Juliana Fajardini 88fdfb9d5a pgsql: debug validation on duplicated request msgs
There shouldn't be duplicated messages in the requests Vec. And thus
the parser shouldn't log duplicated keys nor messages. Add debug
validations to ensure this.

With PGSQL's current state machine, most frontend/ client messages will
lead to the creation of a new transaction - which would prevent
duplicated messages being pushed to the requests array and reaching the
logger.

The current exceptions for that are:

- CopyDataIn
- CopyDone
- CopyFail

Thus, debug statements were added for those cases.

CopyDone and CopyFail, per the documentation, shouldn't be seen
duplicated on the wire for the same transaction. CopyDataIn -- yes, but
we consolidate those, so the expectation is that they won't be
duplicated in the requests array or when reaching the logger either.

Related to
Task #7645
1 month ago
Juliana Fajardini f4439c520c pgsql: separate request completion and state type
Since some of state types could indicate a request completion, don't
process them in if/else statements.

Related to
Task #7645
1 month ago
Juliana Fajardini 68acc0cfcb pgsql: be more strict with pub usage
Review pub visibility to:
Make it pub crate-only wherever possible.
Remove pub altogether where not-needed.
1 month ago
Juliana Fajardini 57f7f93a03 pgsql: reorganize pgsql states for CopyData msgs
To set apart states that are both for frontend and backend.
1 month ago
Juliana Fajardini f3aa0085a0 pgsql: rename copy in/out response field
We used `copy_column_count`, while just `columns` is more accurate with
what PostgreSQL describes, and what Wireshark shows.

Related to
Task #7644
Task #7645
1 month ago
Juliana Fajardini e5a47d7616 pgsql: rename 'dummy' response variables
While this could be considered minor, they were not just bad, but
misleading names, as the variables weren't really `dummy` responses,
but consolidating several messages.
1 month ago
Juliana Fajardini 2086f99d6b pgsql: add initial support to CopyIn mode/subproto
This sub-protocol inspects messages sent mainly from the frontend to
the backend after a 'COPY FROM STDIN' has been processed by the
backend.

Parses new messages:
- CopyInResponse -- initiates copy-in mode/sub-protocol
- CopyData (In) -- data transfer message, from frontend to backend
- CopyDone -- signals that no more CopyData messages will be seen from
  the frontend, for the current transaction
- CopyFail -- used by the frontend to signal some failure to proceed
  with sending CopyData messages

Task #7645
1 month ago