Commit Graph

19226 Commits (8f0dbc0b63d4e898bb1211fba00a243c744857d1)
 

Author SHA1 Message Date
Philippe Antoine 8f0dbc0b63 detect/krb5: move krb5.cname and krb5.sname to rust
Ticket: 8648
2 weeks ago
Philippe Antoine 3327cf42f0 detect/krb5: move krb5_err_code to rust
Ticket: 8648

Make it a generic integer on the way
2 weeks ago
Jason Ish e560db9d1f ftp: don't match unset ftp.dynamic_port
Treat dyn_port 0 as an absent value so numeric comparisons do not
match FTP transactions without a negotiated data port.

Ticket: #8392
2 weeks ago
Jason Ish dd600d0860 ftp: mark ftp.reply as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish c6ec50ab6f ftp: mark ftp.command_data as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish 1f30641a83 ftp: mark ftpbounce as firewall supported
Ticket: 8392
2 weeks ago
Jason Ish 974241aa50 ftp: mark ftp.reply_received as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish f59960d42b ftp: support STOU data transfers
Support STOU on the FTP data channel.

With STOU a filename is optional. If no filname is provided, use
"<stou>". The server does respond with the filename to use, but there
can be a race condition in getting this filename and setting up file
storage before data starts flowing.

Ticket: #8664
2 weeks ago
Jason Ish e65bf4c905 ftp: support APPE data transfers
Support the APPE (append) command on the ftp data channel. Like STOR,
APPE uploads file content on the data channel.

Ticket: #8664
2 weeks ago
Jason Ish 5856ced29c ftp: support LIST and MLSD data channels
Support LIST and MLSD on the ftp data channel.

Ticket: #8664
2 weeks ago
Jason Ish be94ab952a ftp: register ftp.mode at response_complete
Also mark as supported by the firewall.

Ticket: #8392
2 weeks ago
Jason Ish fc1546e25e ftp: register ftp.completion_code at response_complete
Ticket: #8392
2 weeks ago
Jason Ish 1b289daea3 ftp: support nlst on the data channel
Ticket: #8664
2 weeks ago
Jason Ish 6bc2969b8d ftp: mark ftpdata_command as firewall supported 2 weeks ago
Jason Ish f93268e531 ftp: mark ftp.dynamic_port as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish 41cad78506 ftp: register ftp.dynamic_port at response completion
Register ftp.dynamic_port at the FTP transaction completion progress
instead of progress 0. This allows ftp.dynamic_port to be used in
ftp:response_complete.

Ticket: #8392
2 weeks ago
Jason Ish 0d566f90ce ftp: mark ftp.command as firewall supported
Ticket: #8392
2 weeks ago
Jason Ish a6ce31d50d ftp: register ftp.command_data at request completion
Register ftp.command_data with the FTP request completion progress so it
can be used by firewall rules on the ftp:request_complete hook.

Ticket: #8392
2 weeks ago
Jason Ish bf63c574d3 ftp: register ftp.command buffer at request completion
Register ftp.command with the FTP request completion progress so it can
be used by firewall rules on the ftp:request_complete hook.

Ticket: #8392
2 weeks ago
Philippe Antoine f56501215f detect/file: reorder struct fields to reduce padding
and make scan-build happy
2 weeks ago
Philippe Antoine 89dbce1b46 detect: convert tx_progress to uint8_t 2 weeks ago
Jeff Lucovsky 30d4edf9eb detect: revert 2eede11195
Revert issue 8619 fix in favor of a more general change that
sets INSPECTED_T{S,C} correctly on passed flows. This makes clean no
longer need the FLOW_ACTION_PASS special case to free those
transactions.

Issue: 8621
3 weeks ago
Jeff Lucovsky 006e21c1cc app-layer: fix inverted tx inspected flag check
Issue: 8628

AppLayerParserSetTransactionInspectId() had an inverted guard when
tagging completed transactions as inspected: it set the INSPECTED flag
only on txs that already had it, so a finished tx was never newly
marked.

On a normal flow DetectRunTx() sets the same flag and masks the
mistake. On a passed flow -- a `pass` rule or a pass-the-flow exception
policy -- detection is skipped and this function is the only thing that
marks txs inspected. With the inverted guard the transactions are never
flagged, AppLayerParserTransactionsCleanup() never frees them, and the
per-flow transaction list grows without bound while each packet
re-scans it, giving O(n^2) cleanup cost.

This is an unintended regression from 834378ff88.
3 weeks ago
Juliana Fajardini 9cd778b33a doc: requirements for rtd aren't changed
Python's naming conflict shouldn't affect the read the docs requirements
file, so don't rename that one.
3 weeks ago
Philippe Antoine d9fae18432 swf: prevents overflow with bad config value
Ticket: 8642

Do not allocate too much by using the config value, when the flash
file does not require that much data anyways
3 weeks ago
Philippe Antoine 52490b8c26 ftp: do not error the flow on file before port
Ticket: 8659

If a client sends a SOTR/RETR command before doing a PASV/PORT
command, ther server may reply
425 Use PORT or PASV first.\r\n
and allow the client to continue sendinf other commands

So, Suricata should not put the whole flow into error, it just
sets an event, and continues to parse further
3 weeks ago
Jason Ish 26cf56bf54 github-ci: consolidate new authors check into a single workflow
Replace the two-workflow pattern (authors.yml + authors-done.yml) with a
single pull_request_target workflow.

I'm not sure this was possible when this job was originally created, but
apparently it is now.
3 weeks ago
Philippe Antoine f092d07f6d decode/sctp: chunk_cnt can be a u16
Ticket: 8661
3 weeks ago
Philippe Antoine 3ca2ed25a3 detect/datajson: check json objects are string as expected
Ticket: 8624
3 weeks ago
Jeff Lucovsky 2eefb1910d doc/fixup: Fixup usages of container-example
There are several places where transform-related container-example helper wasn't
formatting rules properly.
3 weeks ago
Jeff Lucovsky d2e3bf1d34 doc: document xor transform variable key and offset syntax
Add user-facing documentation for the xor transform's 'extract <nbytes>
<offset>' syntax and offset parameter in rules/transforms.rst.

Add a devguide section (devguide/extending/detect/transforms.rst)
covering the detection pipeline execution order, how transforms run
before detection-time keywords, and how xor reads key bytes directly
from the raw buffer at a specified position and width. Explains how
the engine deduplicates inspection buffers for rules with variable
keys at different buffer positions.

Issue: 8671
3 weeks ago
Jeff Lucovsky 5d007ef25e detect/xor: add inline variable key syntax
Extend the xor transform to accept a variable-position key using
the 'extract <nbytes> <offset>' syntax. The engine reads <nbytes> bytes
at buffer position <offset> at transform time.

The optional 'offset' parameter specifies where XOR decoding
starts in the buffer; bytes before that position are left unchanged.

Syntax:
  xor:"<hex_key>"
  xor:extract <nbytes> <offset>
  xor:offset <N>,"<hex_key>"
  xor:offset <N>,extract <nbytes> <offset>

Variable-key helpers (VariableKeyLocation, variable_key_bytes,
parse_key_location, strip_keyword_prefix) are imported from the new
varkey module.

The variable key bytes are copied out of the inspection buffer before
decoding, so an in-place transform cannot corrupt the key when the key
region overlaps the decoded range.

Issue: 8671
3 weeks ago
Jeff Lucovsky 385bd4416b detect/transforms: add varkey module for variable-key helpers
Introduce rust/src/detect/transforms/varkey.rs to centralise helpers
used by transforms that read key material directly from the inspection
buffer at transform time.

Exported items:
  VariableKeyLocation  { offset: u16, nbytes: u8 }
  variable_key_bytes   bounds-checked slice into an inspection buffer
  strip_keyword_prefix strip 'keyword<ws>' from option strings
  parse_key_location   parse '<nbytes> <offset>' into VariableKeyLocation

All four items are pub so any transform can import them. Unit tests
are included in the module.

Issue: 8671
3 weeks ago
Philippe Antoine 72e9314402 ci: check cargo fmt for whole suricata 3 weeks ago
Philippe Antoine e6ee69c7da rust: format all files
except the ones with #[rustfmt::skip]

Ticket: 3836
3 weeks ago
Shivani Bhardwaj 3adb975032 misc: rename requirements.txt to bundle.txt
Do not use Python's standard file name to define external packages that
need to be installed. This confuses Dependabot.
3 weeks ago
Victor Julien 2b19f86ee6 Revert "af-packet: speed up thread sync during startup"
This reverts commit 923ad6af77.

Several issues have been reported:

1. non-deterministic thread to queue mapping (privately reported)

2. race condition causing IPS mode to loose packets, or get stuck
   completely, ticket 8667.

Ticket: #8667.
3 weeks ago
Philippe Antoine ac1b3cc1ef windows: always quote path for windows functions needing it
Ticket: 8600

CreateServiceA doc states for example :

> If the path contains a space, it must be quoted so that it is
  correctly interpreted.

Also fixes strlcat usage and check return value to error out on
truncated path
3 weeks ago
Philippe Antoine 114c80099c suricata: make FUZZING a feature
so as to skip SV tests that would fail when we are building in unsafe
fuzzing mode
3 weeks ago
Philippe Antoine 5a03fbfc61 detect/engine-analyzer: add note for pcre with \X
Ticket: 8634
3 weeks ago
Maxime FORJA a4841e60cb docs: fix typos in Basic_Setup.txt
- Fixed a typo where 'change' was used instead of 'chance'.

- Removed trailing spaces before commas.

- Corrected 'up-dated' to 'updated'.
3 weeks ago
Samaresh Kumar Singh decd897eff doc: clarify suricata.yaml location per install
The Quickstart guide installs Suricata from the Ubuntu PPA, where the
config lives at /etc/suricata/suricata.yaml. A source build installs it
under the prefix passed to configure, which defaults to /usr/local, so
the file ends up at /usr/local/etc/suricata/suricata.yaml instead. Add a
note next to the edit step so source-build users are not confused when
the package path does not exist on their system.

Ticket: #8358
Signed-off-by: Samaresh Kumar Singh <ssam3003@gmail.com>
3 weeks ago
Philippe Antoine ca34fba00c rust: format smb files
Ticket: 3836
4 weeks ago
Philippe Antoine f8ac56c591 dcerpc: remove obsolete comment 4 weeks ago
Jason Ish 2fe4bb2872 ftpdata: ignore direction in ftpdata_command
The ftpdata_command would never match a RETR in the to_server direction,
or a STOR in the to_client direction, this effectively makes the
ftpdata_command applicable to passive mode only.

Instead, remove the directionality on the ftpdata_command. Its "meta"
information passed from the control channel and isn't really
directional. I think the idea was to abstract away active/passive from
the rule writer, but unfortunately doesn't allow the ftpdata_command
keyword to work in the more strict firewll mode.

Ticket: #8663
4 weeks ago
Jason Ish d346e469c5 ftp: skip ts inspection on tc only transactions
In FTP, the first transaction is a banner from the server. Skip TS
inspection on this transaction.

Allows firewall mode to get past this transaction and onto the next.

Ticket: #8662
4 weeks ago
Philippe Antoine 097975e289 fuzz: forbid usage of pcre with \X
Ticket: 8634
4 weeks ago
Philippe Antoine aea9fd73b7 rust: format dcerpc files
Ticket: 3836
4 weeks ago
Abhijeet Singh 28b10fb042 util/log: rotate log file periodically
Fix log file not rotating during zero traffic periods by triggering rotation logic every second

Ticket: https://redmine.openinfosecfoundation.org/issues/8115
4 weeks ago
Victor Julien 1eff94f2b2 github-ci: add gcc analyzer build
Make sure to not run against lua rust crate build, as it's not clean.
4 weeks ago