Commit Graph

17360 Commits (ddb4361432f499396a0ee736bf5071ea451a24af)
 

Author SHA1 Message Date
Jeff Lucovsky ddb4361432 detect/ftp: Add ftp.mode command
Issue: 7505

This commit adds support for the ftp.mode keyword.

ftp.mode: active|passive
1 year ago
Jeff Lucovsky c6e0ba2b85 detect/ftp: Add parser for ftp.mode keyword
Issue: 7505

Add a parser for the ftp.mode command that returns the state struct. Add
a function to free the object it allocates.
1 year ago
Jeff Lucovsky 34d7f0c65d output/ftp: Log mode for passive connections
This commit will now output the FTP mode -- active or passive -- when
the command is
- (previous): PORT, EPRT
- (new): PASV, EPSV

Issue: 7505
1 year ago
Philippe Antoine 4af3bd9c91 rust: bindgen SCDetectHelperKeywordSetCleanCString
Ticket: 7667
1 year ago
Philippe Antoine 13449344e8 rust: bindgen SCDetectHelperKeywordRegister
Ticket: 7667
1 year ago
Philippe Antoine f909bbba68 rust: bindgen SCDetectHelperKeywordAliasRegister
Ticket: 7667
1 year ago
Philippe Antoine a7448a0c16 rust: bindgen SCDetectHelperBufferRegister
Ticket: 7667
1 year ago
Philippe Antoine 0d82e905bc rust: bindgen DetectHelperMultiBufferMpmRegister
Ticket: 7667
1 year ago
Philippe Antoine dfa4df9f54 rust: bindgen SCDetectHelperMultiBufferProgressMpmRegister
Ticket: 7667
1 year ago
Philippe Antoine 7805103f68 detect: fix -Wshorten-64-to-32 warnings for content inspection
Ticket: 6186
1 year ago
Jeff Lucovsky dc994effd6 detect/entropy: Correct slot for url initialization
Correct the sigmatch slot for url initialization.
1 year ago
Victor Julien 26f7632324 htp: fix unittests shutdown order
Make sure to free flow/packets before cleaning up global structs.

Solves an crash sometimes seen on OpenBSD in test HTPParserTest26.
1 year ago
Philippe Antoine 030493c4a8 lua: better doc for ja3 lib
Completes commit 7e78ad944c

Tickt: 7605
1 year ago
Jason Ish c13f85f18d lua: convert file functions to lib suricata.file
This also breaks out the fileinfo function into a method per file info
item. And likewise for state, just return the state and add a new method
for checking if the file is stored.

Ticket: #7491
1 year ago
Victor Julien 3b5a99d239 github-ci: use all profraw files in coverage test 1 year ago
Victor Julien 7b46ec8c24 github-ci: add --list-app-layer-hooks checks 1 year ago
Victor Julien acc7bd0c6f app-layer: add --list-app-layer-hooks options
This provides a list of available hooks.

Ticket: #7702.
1 year ago
Victor Julien 019c746d79 github-ci: add -h option to coverage test 1 year ago
Juliana Fajardini 62949b3815 pgsql: remove unused "password_message" code
``Password message`` is actually logged just as ``Password``.
Remove related dead code.
1 year ago
Juliana Fajardini 6f81caf8d4 pgsql: clearly indicate redacted password message
If a password message was seen while logging passwords was disabled
for pgsql, this would lead to an empty request being logged.
Instead of simply not logging anything when there is a password message
and this is disabled, however, log instead that said password is
redacted.

Bug #7647
1 year ago
Jason Ish 11cef2980b github-ci: use current directory for unit test logging
/tmp appears to exist when you make it, but doesn't appear to actually
exist after msys translation, so just use "."
1 year ago
Shivani Bhardwaj c1b932747c schema: add rule keyword mapping for flow 1 year ago
Victor Julien b14734c113 eve/verdict: log 'accept' for firewall accept rules
Ticket: #7698.
1 year ago
Shivani Bhardwaj e2f0370f4c decode: remove unnecessary PKT_STREAM_EOF flag
PKT_STREAM_EOF flag is set only when a pseudo packet is created. In all
the users of this flag, it suffices to use PKT_PSEUDO_STREAM_END
instead. PKT_PSEUDO_STREAM_END is the more widely used flag as well so
keep it and remove this unneeded flag creating a vacancy.
1 year ago
Shivani Bhardwaj 9f6d52f569 stream/reassemble: remove unused min_inspect_depth
Whether minimum inspection depth should be respected is an important
parameter but it is only used by one caller of StreamReassembleRawDo fn
to calculate progress value. This progress value is already passed as a
parameter to the said fn.
1 year ago
Shivani Bhardwaj edbba842e8 src: apply clang formatting changes 1 year ago
Shivani Bhardwaj 623229728d signature: rename num to iid
to signify that it refers to the internal ID of the signature and
distinguish it from the "id" param that signifies the "sid" specified in
a rule.
1 year ago
Philippe Antoine fd7bd9c200 src: new file detect-engine-inspect-buffer.h
For InspectionBuffer structure and related functions

Bindgen it for rust, especially transforms

Ticket: 7667
1 year ago
Philippe Antoine df0dc2e8ea rust: bindgen SCDetectSignatureAddTransform
by moving it to detect-engine-buffer.h and prefixing it

Ticket: 7667
1 year ago
Philippe Antoine 09664df8ef build: reorder files in Makefile.am 1 year ago
Philippe Antoine 1f871cdd64 rust: reuse/reexport suricata_sys DetectEngineThreadCtx
Use the bindgen'd version instead of our own recoded one
1 year ago
Philippe Antoine cf336396c3 rust: bindgen detect-engine-helper.h
Ticket: 7667

Begin by focusing on transforms
1 year ago
Juliana Fajardini 3286ae2cc9 eve: add ip version field
Adds the field `ip_v` (integer) to the common fields of EVE.
To facilitate searches based on IP version, for instance.

Task #7047
1 year ago
Victor Julien c85d301712 detect: assist clang to suppress warning
CC       detect-engine-loader.o
In file included from /usr/include/stdio.h:970,
                 from suricata-common.h:77,
                 from detect-engine-loader.c:24:
In function 'fgets',
    inlined from 'DetectLoadSigFile' at detect-engine-loader.c:139:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:313:12: warning: argument 2 value -1 is negative [-Wstringop-overflow=]
  313 |     return __fgets_alias (__s, __n, __stream);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/dirent.h:25,
                 from suricata-common.h:73:
/usr/include/x86_64-linux-gnu/bits/stdio2-decl.h: In function 'DetectLoadSigFile':
/usr/include/x86_64-linux-gnu/bits/stdio2-decl.h:96:14: note: in a call to function '__fgets_alias' declared with attribute 'access (write_only, 1, 2)'
   96 | extern char *__REDIRECT (__fgets_alias,
      |              ^~~~~~~~~~
1 year ago
Victor Julien 1e68213098 util/pages: suppress scan-build on page check
Suppress the following warning:

util-pages.c:49:13: warning: Both PROT_WRITE and PROT_EXEC flags are set. This can lead to exploitable memory regions, which could be overwritten with malicious code [security.MmapWriteExec]
   49 |         if (mprotect(ptr, getpagesize(), PROT_READ|PROT_WRITE|PROT_EXEC) == -1) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

As the check is done to check if the OS allows it or not, for enabling
JIT in pcre.
1 year ago
Victor Julien 61b21dd167 mpm/hs: suppress scan-build warning
util-mpm-hs-cache.c:83:25: warning: Value of 'errno' was not checked and may be overwritten by function 'fread' [unix.Errno]
   83 |     size_t bytes_read = fread(buffer, 1, file_sz, file);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

"After calling 'rewind' reading 'errno' is required to find out if the call has failed".
1 year ago
Victor Julien 19e3a70ca3 detect/byte_test: suppress scan-build warning
detect-bytetest.c:523:14: warning: 2nd function call argument is an uninitialized value [core.CallAndMessage]
  523 |         if (!DetectBytetestValidateNbytes(data, nbytes, optstr)) {
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
1 year ago
Victor Julien 159bacb268 github-ci: bump scan-build to 20 on Ubuntu 25.04 1 year ago
Eric Leblond f342ae9e8c misc: add git-clang-format to shell.nix 1 year ago
Eric Leblond 96962536a7 misc: add python support to shell.nix
This allows to run suricata-verify from the shell environment.

Ticket: #7669
1 year ago
Eric Leblond 649a032ba9 github-ci: add a nix build
This will test that shell.nix is working properly and also
test compile-commands Makefile target.

Ticket: #7669
1 year ago
Eric Leblond 2a2f38ff88 build: add compile-commands target
It generates a `compile_commands.json` suitable for clangd.
This is almost mandatory to have a command like this one for NixOs
users as tool like bear are not able to intercept correctly the
clang calls due to the usage of a wrapper.

Ticket: #7669
1 year ago
Eric Leblond 20371dbdf6 build: add EXTRA_CFLAGS
This can be used from command line to add some build options without
running a full configure. This is convenient for single run build.
1 year ago
Eric Leblond 90a08ecfc3 misc: add a shell.nix file
By adding a `shell.nix` file in the root directory of the source,
NixOs (https://nixos.org/) users can get a ready for development
environment by simply running `nix-shell` from the source tree.

This is really convenient as the installation of needed packages
is just done as user and transparently for the user/developer.

Ticket: #7669
1 year ago
Jason Ish 97eaeef7d8 lua: convert SMTP functions to lib: suricata.smtp
Ticket: #7606
1 year ago
Eric Leblond e499a98ba9 datasets: fix set with ip sets
It can get an IPv6 or an IPv4 so we need to handle both length.

Ticket: #7689
1 year ago
Victor Julien ee59d9a894 flow: fix unittests for ThreadVars requirement 1 year ago
Victor Julien c648abad0d flow: fix time handling for non-TCP
Track per flow thread id for UDP and other non-TCP protocols. This
improves the timeout handling as the per thread timestamp is used in
offline mode.

Fixes: ada2bfe009 ("flow/worker: improve flow timeout time accuracy")
Fixes: ef396f7509 ("flow/manager: in offline mode, use owning threads time")

Bug #7687.
1 year ago
Jeff Lucovsky 44d6886dc1 detect/ftp: Use helper functions with ftp.command
Refactor ftp.command handling to use helper functions from
detect-engine-helper.[ch] for reduced code duplication.
1 year ago
Philippe Antoine 7e78ad944c lua: convert ja3 function into suricata.ja3 lib
Ticket: 7605
1 year ago