Commit Graph

18782 Commits (e65643909acbabd4c8dd2027ba1f47328e4e3ee4)
 

Author SHA1 Message Date
Philippe Antoine e65643909a doc: move more examples to container:: example-rule
Ticket: 8372

And fix another bad rule
4 months ago
Philippe Antoine 72e13c9774 doc: do not highlight bad transactional rule
As stated, it will refuse to load.

Ticket: 8372
4 months ago
Philippe Antoine 15f45be672 doc: fix rules
Ticket: 8372

Somes rules in the doc had typos, fix them so suricata can load
them when you copy/paste the doc
4 months ago
Philippe Antoine 42a85c37f1 scripts: add script to check rules in doc
Ticket: 8372

and run it in github CI
4 months ago
Jason Ish be36e67f52 rust: suppress cargo audit for RUSTSEC-2026-0097
Per https://rustsec.org/advisories/RUSTSEC-2026-0097,
this issue it not applicable unless the "log" and "thread_rng"
features of rand are enabled.  "log" is not enabled in our
dependency chain.

Updating to the fixed version of rand requires an MSRV of 1.85.

Ticket: #8467
4 months ago
Philippe Antoine 58a71d94b0 rust/ffi: move conf_get helper to ffi crate
Ticket: 7666
4 months ago
Jason Ish 6a67811a0c conf: make dirname pointer const
Fixes warning:

conf-yaml-loader.c: In function ‘ConfYamlSetConfDirname’:
conf-yaml-loader.c:87:8: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   87 |     ep = strrchr(filename, '\\');
      |        ^
4 months ago
Jason Ish 73bee2f4fd conf: avoid use-after-free when processing include sequences
Ticket: #8465
4 months ago
Jason Ish a11aaadd86 plugins: add --plugin command line option to load plugins
Add --plugin <PATH> to load an additional plugin from the command
line. This is more convenient than "--set plugins.X" especially when
you may already have a plugins loaded and you want to load an
additional one.

Ticket: 8463
4 months ago
Philippe Antoine 512bbe4de8 detect/template: merge template and template2
Ticket: 7278

Do a single packet match template merging best of both current
templates
4 months ago
Philippe Antoine 8d254f5630 dhcp/output: log app-layer metadata in alerts
Ticket: 6091

log as extended
4 months ago
Philippe Antoine db980daf5f dhcp: standardize output code
To prepare to add metadata in alerts

Ticket: 6091
4 months ago
Philippe Antoine d14af54b3b detect/transforms: constify some callbacks arguments
Ticket: 8298
4 months ago
Philippe Antoine cae749bc58 detect: remove unneeded null check
CID 1645613
Ticket: 7664

We assign and dereference next_s like
        next_s = *match_array++;
        next_sflags = next_s->flags;

So, there is no need to check if next_s is NULL, as it can never
be (otherwise, we could crash before)
4 months ago
Philippe Antoine 0a24f0afe2 smb: parse smb1 session setup with word count 13
Ticket: 5845
4 months ago
Jason Ish 98469b0f56 rust/ffi: fix clippy warnings
Remove the unneeded return.

The other option would be to allow it, but so far in the ffi crate we
don't have any non-default allows.
4 months ago
Jason Ish ecffd6cd54 github-ci: deny warnings in clippy check
We currently have some clippy warnings in the ffi crate. They output to
to the terminal but clippy exits with a success code. Typically we want
to fix this, so deny warnings which will cause clippy to exit with an
error code, failing ci.
4 months ago
Jason Ish 70994426d3 github-ci: add --workspace to cargo clippy --fix
--fix doesn't appear to apply to all sub-crates unless --workspace is
provided.
4 months ago
Jason Ish 336b50ae9e storage: prefix core API with SC 4 months ago
Jason Ish 3722477319 device/storage: prefix API with SC 4 months ago
Jason Ish 41fd80aa46 ippair/storage: prefix API with SC 4 months ago
Jason Ish 279aa88956 host/storage: prefix API with SC 4 months ago
Jason Ish 67bd09ba2c thread/storage: prefix API with SC
In preparation for Rust bindings.
4 months ago
Jason Ish 137f59f542 flow/storage: prefix API with SC
In preparation for adding Rust bindings.
4 months ago
dependabot[bot] bf6824cb49 github-actions: bump codecov/codecov-action from 5.5.2 to 6.0.0
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.2 to 6.0.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](671740ac38...57e3a136b7)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months ago
dependabot[bot] b9fac32bbd github-actions: bump github/codeql-action from 4.32.4 to 4.35.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.4 to 4.35.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v4.32.4...v4.35.1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months ago
dependabot[bot] 5ff0ed977c github-actions: bump actions/download-artifact from 8.0.0 to 8.0.1
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](70fc10c6e5...3e5f45b2cf)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months ago
Philippe Antoine c53b9df5a2 rust/ffi: move detection helpers to ffi crate
Ticket: 7666
4 months ago
Philippe Antoine 4f4912c042 rust: bindgen SIGMATCH_ constants 4 months ago
Shivani Bhardwaj 4ec5f22951 ftp: trigger raw stream inspection
Internals
---------
Suricata's stream engine returns data for inspection to the detection
engine from the stream when the chunk size is reached.

Bug
---
Inspection triggered only in the specified chunk sizes may be too late
when it comes to inspection of smaller protocol specific data which
could result in delayed inspection, incorrect data logged with a transaction
and logs misindicating the pkt that triggered an alert.

Fix
---
Fix this by making an explicit call from all respective applayer parsers to
trigger raw stream inspection which shall make the data available for inspection
in the following call of the stream engine. This needs to happen per direction
on the completion of an entity like a request or a response.

Important notes
---------------
1. The above mentioned behavior with and without this patch is
affected internally by the following conditions.
- inspection depth
- stream depth
In these special cases, the inspection window will be affected and
Suricata may not consider all the data that could be expected to be
inspected.
2. This only applies to applayer protocols running over TCP.
3. The inspection window is only considered up to the ACK'd data.
4. This entire issue is about IDS mode only.

FTP parser can handle multiple command lines per direction. Appropriate calls
to trigger raw stream inspection have been added on succesful parsing of each
request line and response line.

Bug 7742
4 months ago
Philippe Antoine 2fa10052cf websocket: check pdu opcode for reassembly
Ticket: 8413

RFC 6455 Section 5.4 states

Control frames (see Section 5.5) MAY be injected in the middle of
a fragmented message.

Control frames are identified by opcodes where the most significant
bit of the opcode is 1.
4 months ago
Philippe Antoine 7b0528d85f http2: set response_frame_size
Ticket: 8410

Do not set only request_frame_size whatever the direction
4 months ago
Victor Julien 6c3169cee0 doc/userguide: add ether and arp to intro 4 months ago
Victor Julien 6298c47145 doc/userguide: improve protocol docs 4 months ago
Victor Julien e6381a3c22 doc/userguide: add note on rule reloads
Cannot be combined with --firewall-rules-exclusive
4 months ago
Victor Julien f99b86beab doc/userguide: document L2 firewall handling of ARP 4 months ago
Victor Julien facbb04915 detect: enable pcre and urilen for firewall mode
Ticket: #8397.
4 months ago
Victor Julien 49b1382a8b qa: add nfq based firewall test with live reload 4 months ago
Victor Julien 7ac32910c9 qa: add rule reload step to firewall test
Additionally, use bsize, pcre and urilen.

Ticket: #8204.
Ticket: #8397.
4 months ago
Victor Julien 1c66eec656 qa: add script to test firewall bridge mode 4 months ago
Victor Julien 2e2132a16f doc/userguide: improve pkthdr docs 4 months ago
Victor Julien 6fbd7483d6 detect/parse: limit pkthdr proto to decoder event rules
`alert pkthdr` was initially just an alias for `alert ip`, as that was
really just a way of stating that "any" should be matched. However with
the Ethernet matching in place, it no long makes sense to treat `alert
ip` as "any". Since `pkthdr` is used to match on decoder events, also
for packets that completely failed to parse, it should no longer be
treated as `alert ip` but rather as it's own distinct logic.
4 months ago
Victor Julien b983ce64ef detect: add track pkthdr as any l2 protocol
To indicate it's not just like `alert ip`.
4 months ago
Victor Julien 61a7f47a69 detect: add ether.hdr keyword
Sticky buffer to inspect the ethernet header.

Example rule:

        alert ether any any -> any any ( \
                ether.hdr; content:"|08 06|"; offset:12; depth:2; \
                sid:1;)

Ticket: #8327.
4 months ago
Victor Julien 232276ac19 detect: ethernet/arp matching
Support `alert ether` for matching all ethernet packets.

Add `alert arp` for matching ARP packets.

Ticket: #8313.
4 months ago
Victor Julien d4f005933a detect/proto: reduce size for common sigs
Make `Signature::proto` an optional member, meaning that if it is
NULL we can skip the check. This can be done for `alert ip`, as no check
is needed, and for `alert tcp` and `alert udp` as having a rule in a sgh
for those means that the protocol matches.

Some exceptions are rules that require:
- ipv4/ipv6 specific matching
- frames, due to sharing prefilter between tcp and udp
- ip-only rules, due to those not being per sgh
4 months ago
Victor Julien dc814aa595 detect/frame: set frame flag during init
Allows for quickly checking if sig operates on frames during parsing.
4 months ago
Jason Ish cd9993c568 storage: remove the size registration parameter
With the Alloc callback gone, the size is no longer needed.
4 months ago
Jason Ish f337cd573b storage: remove alloc callback as its unused
Remove the "Alloc" callback from the storage API, it was only being
used in tests without any real usage.
4 months ago
Jason Ish 332f47d557 host/storage: use fail/pass api in unit tests 4 months ago