]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
13 months agodoc: update eBPF compilation instructions
Lukas Sismis [Tue, 16 Jan 2024 13:47:08 +0000 (14:47 +0100)] 
doc: update eBPF compilation instructions

Ticket: #6599

13 months agodoc/userguide: document iprep isset/isnotset
Victor Julien [Thu, 6 Jun 2024 15:38:55 +0000 (17:38 +0200)] 
doc/userguide: document iprep isset/isnotset

13 months agodoc/userguide: add more operators to iprep
Victor Julien [Thu, 6 Jun 2024 15:38:34 +0000 (17:38 +0200)] 
doc/userguide: add more operators to iprep

13 months agodetect/iprep: update function naming
Victor Julien [Thu, 6 Jun 2024 15:24:20 +0000 (17:24 +0200)] 
detect/iprep: update function naming

Bring in line with new Rust code naming for FFI functions.

13 months agodetect/iprep: implement isset and isnotset
Victor Julien [Mon, 13 May 2024 12:37:51 +0000 (14:37 +0200)] 
detect/iprep: implement isset and isnotset

Implement special "isset" and "isnotset" modes.

"isset" matches if an IP address is part of an iprep category with any
value.

It is internally implemented as ">=,0", which should always be true if
there is a value to evaluate, as valid reputation values are 0-127.

"isnotset" matches if an IP address is not part of an iprep category.

Internally it is implemented outside the uint support.

Ticket: #6857.

13 months agoreputation: minor cleanup
Victor Julien [Mon, 13 May 2024 12:37:02 +0000 (14:37 +0200)] 
reputation: minor cleanup

No need to init ptrs to NULL after SCCalloc.

13 months agodetect/iprep: update keyword parser for extendibility
Victor Julien [Mon, 13 May 2024 10:33:57 +0000 (12:33 +0200)] 
detect/iprep: update keyword parser for extendibility

13 months agomisc: prefix functions with SC not Sc 11275/head
Jason Ish [Fri, 7 Jun 2024 23:28:01 +0000 (17:28 -0600)] 
misc: prefix functions with SC not Sc

13 months agodetect/noalert: point noalert/alert to new doc 11272/head
Victor Julien [Fri, 7 Jun 2024 19:02:00 +0000 (21:02 +0200)] 
detect/noalert: point noalert/alert to new doc

13 months agodoc/userguide: add noalert/alert keyword docs
Victor Julien [Thu, 6 Jun 2024 10:25:51 +0000 (12:25 +0200)] 
doc/userguide: add noalert/alert keyword docs

13 months agodoc/userguide: give pcre1 to pcre2 proper heading
Victor Julien [Thu, 6 Jun 2024 09:46:55 +0000 (11:46 +0200)] 
doc/userguide: give pcre1 to pcre2 proper heading

13 months agodetect: implement 'alert' keyword as a companion to 'noalert'
Victor Julien [Fri, 12 Jan 2024 13:00:37 +0000 (14:00 +0100)] 
detect: implement 'alert' keyword as a companion to 'noalert'

This can be used to implement alert then pass logic.

Add support for alert-then-pass to alert handling routines.

Ticket: #5466.

13 months agodetect: set ACTION_ALERT for rules that should alert
Victor Julien [Fri, 12 Jan 2024 10:14:27 +0000 (11:14 +0100)] 
detect: set ACTION_ALERT for rules that should alert

Replaces default "alert" logic and removed SIG_FLAG_NOALERT.

Instead, "noalert" unsets ACTION_ALERT. Same for flowbits:noalert and
friends.

In signature ordering rules w/o action are sorted as if they have 'alert',
which is the same behavior as before, but now implemented explicitly.

Ticket: #5466.

13 months agodetect/alert: minor loop cleanup
Victor Julien [Fri, 12 Jan 2024 12:41:17 +0000 (13:41 +0100)] 
detect/alert: minor loop cleanup

13 months agodetect/noalert: minor cleanup
Victor Julien [Fri, 12 Jan 2024 08:51:02 +0000 (09:51 +0100)] 
detect/noalert: minor cleanup

13 months agowebsocket: add data frame 11271/head
Philippe Antoine [Wed, 29 May 2024 11:47:15 +0000 (13:47 +0200)] 
websocket: add data frame

Ticket: 7051

13 months agouserguide/upgrade: add note about alerts' increase
Juliana Fajardini [Wed, 29 May 2024 17:26:54 +0000 (14:26 -0300)] 
userguide/upgrade: add note about alerts' increase

With triggering stream reassembly early, since for certain types of
rules there may be more alerts triggered - even in IPS mode, make this
clear in the upgrading section.

Bug #7026

13 months agodns: allow triggering raw stream reassembly
Juliana Fajardini [Tue, 21 May 2024 20:35:34 +0000 (17:35 -0300)] 
dns: allow triggering raw stream reassembly

For TCP streams, app proto stream reassembly can start earlier, instead
of waiting and queueing up data before doing so.

Task #7018
Related to
Bug #7004

13 months agoenip: convert to rust
Philippe Antoine [Fri, 17 Nov 2023 08:30:29 +0000 (09:30 +0100)] 
enip: convert to rust

Ticket: 3958

- transactions are now bidirectional
- there is a logger
- gap support is improved with probing for resync
- frames support
- app-layer events
- enip_command keyword accepts now string enumeration as values.
- add enip.status keyword
- add keywords :
    enip.product_name, enip.protocol_version, enip.revision,
    enip.identity_status, enip.state, enip.serial, enip.product_code,
    enip.device_type, enip.vendor_id, enip.capabilities,
    enip.cip_attribute, enip.cip_class, enip.cip_instance,
    enip.cip_status, enip.cip_extendedstatus

13 months agofiles: remove the need for state in callbacks 11270/head
Philippe Antoine [Wed, 5 Jun 2024 11:57:32 +0000 (13:57 +0200)] 
files: remove the need for state in callbacks

As files now belong to transactions

13 months agoapp-layer: remove unused parameters
Philippe Antoine [Wed, 5 Jun 2024 11:36:46 +0000 (13:36 +0200)] 
app-layer: remove unused parameters

13 months agosmtp/mime: look for urls in base64 message
Philippe Antoine [Tue, 4 Jun 2024 12:42:43 +0000 (14:42 +0200)] 
smtp/mime: look for urls in base64 message

Ticket: 5185

Previously, it was looked for message in plain text, and base64
encoding was only handled for attachments.

This commit also fixes the buffering got such base64 data streamed
into urls finding, by buffering a beginning non-empty line,
and by ensuring that we run extraction on the last line,
even if it had no EOL.

13 months agodpdk: simplify and fix build
Philippe Antoine [Tue, 7 May 2024 13:09:28 +0000 (15:09 +0200)] 
dpdk: simplify and fix build

13 months agofuzz: build with dependencies on rust and c lib
Philippe Antoine [Tue, 30 Apr 2024 20:19:06 +0000 (22:19 +0200)] 
fuzz: build with dependencies on rust and c lib

So that there is no need to remove the final binary, to recompile
it if there has been changes in the code.

13 months agoci: fix and test with Wunused-macros 11253/head
Philippe Antoine [Wed, 5 Jun 2024 09:48:54 +0000 (11:48 +0200)] 
ci: fix and test with Wunused-macros

Ticket: 6937

Completes ce9bfba76a785e6a02cbbe796a23be6c4e5bc553

13 months agoeve/stats: add description for flow mgr & recycler
Shivani Bhardwaj [Wed, 5 Jun 2024 03:25:17 +0000 (08:55 +0530)] 
eve/stats: add description for flow mgr & recycler

Ticket 6434

13 months agodoc/userguide: fix rule container typo
Victor Julien [Wed, 5 Jun 2024 04:46:09 +0000 (06:46 +0200)] 
doc/userguide: fix rule container typo

Fixes: 8781e9352a6c ("doc/userguide: add documentation for SMTP frames")
13 months agopgsql: trigger raw stream reassembly
Juliana Fajardini [Mon, 20 May 2024 16:02:45 +0000 (13:02 -0300)] 
pgsql: trigger raw stream reassembly

Expose the raw stream earlier to the detection engine, as Pgsql can have
multiple messages per transaction and usually will have a message
complete within one TCP packet.

Bug #7000

Related to
Bug #7026

13 months agopgsql/logger: open json object from logger function
Juliana Fajardini [Thu, 25 Apr 2024 01:13:35 +0000 (22:13 -0300)] 
pgsql/logger: open json object from logger function

Before, the JsonBuilder object for the pgsql event was being created
from the C-side function that actually called the Rust logger.

This resulted that if another module - such as the Json Alert called the
PGSQL logger, we wouldn't have the `pgsql` key present in the log output
- only its inner fields.

Bug #6983

14 months agodoc/userguide: add documentation for SMTP frames 11236/head
Victor Julien [Tue, 4 Jun 2024 10:30:12 +0000 (12:30 +0200)] 
doc/userguide: add documentation for SMTP frames

14 months agosmtp/frames: initial frame support
Victor Julien [Mon, 13 Nov 2023 05:43:32 +0000 (06:43 +0100)] 
smtp/frames: initial frame support

Adds the following frames:

  command_line
  data
  response_line

The *_line frames are per line, so in multi-line responses each line
will have it's own frame.

Ticket: #4905.

14 months agoflow-worker: debug output about updates
Victor Julien [Sun, 26 May 2024 06:40:11 +0000 (08:40 +0200)] 
flow-worker: debug output about updates

14 months agostream: process ASYNC in packet dir
Victor Julien [Sun, 26 May 2024 06:38:13 +0000 (08:38 +0200)] 
stream: process ASYNC in packet dir

There will generally not be an opposing direction to handle
the app update.

14 months agodetect/frames: inspect frames only in correct direction
Victor Julien [Fri, 26 Jan 2024 14:11:30 +0000 (15:11 +0100)] 
detect/frames: inspect frames only in correct direction

Inspect frames in the correct direction after they have been created.

14 months agoapp-layer: flag flow for next packet in other dir
Victor Julien [Fri, 26 Jan 2024 13:36:16 +0000 (14:36 +0100)] 
app-layer: flag flow for next packet in other dir

Add new flags to trigger FLOW_TS_APP_UPDATED/FLOW_TC_APP_UPDATED flags
to be set for the next packet in the relevant direction.

This allows for app relevant work to be done in the next packet in our
direction.

14 months agodetect/frames: avoid IPS rescanning
Victor Julien [Thu, 30 Nov 2023 10:59:45 +0000 (11:59 +0100)] 
detect/frames: avoid IPS rescanning

Make sure to only scan the data when the app layer has been updated
as well.

Ticket: #6718.

14 months agoapp-layer/frames: add by type getter
Victor Julien [Sun, 12 Nov 2023 08:41:45 +0000 (09:41 +0100)] 
app-layer/frames: add by type getter

AppLayerFrameGetLastOpenByType: Returns the most recent frame with a type
with unknown length (-1).

Check if type is globally enabled first.

14 months agoframes: add FrameGetLastOpenByType
Victor Julien [Sun, 12 Nov 2023 08:41:13 +0000 (09:41 +0100)] 
frames: add FrameGetLastOpenByType

Getter for the most recent frame with unknown length (-1).

14 months agoframes: fix bounds check
Victor Julien [Mon, 3 Jun 2024 08:28:44 +0000 (10:28 +0200)] 
frames: fix bounds check

14 months agostream: minor code clarification
Victor Julien [Sun, 26 May 2024 06:35:05 +0000 (08:35 +0200)] 
stream: minor code clarification

'dir' was too generic, so indicate it's about the app-layer update direction.

14 months agoapp-layer: minor code clarification
Victor Julien [Sun, 26 May 2024 06:34:35 +0000 (08:34 +0200)] 
app-layer: minor code clarification

'dir' was too generic, so indicate it's about the app-layer update direction.

14 months agodns: adds missing NS field in json schema
Philippe Antoine [Thu, 28 Mar 2024 15:53:25 +0000 (16:53 +0100)] 
dns: adds missing NS field in json schema

14 months agodns: remove unneeded mut in logger
Philippe Antoine [Tue, 12 Dec 2023 13:25:16 +0000 (14:25 +0100)] 
dns: remove unneeded mut in logger

14 months agosmtp: use rust for mime parsing 11227/head
Philippe Antoine [Thu, 1 Sep 2022 14:02:05 +0000 (16:02 +0200)] 
smtp: use rust for mime parsing

Ticket: #3487

14 months agohttp: use rust for mime parsing
Philippe Antoine [Tue, 2 Aug 2022 14:25:10 +0000 (16:25 +0200)] 
http: use rust for mime parsing

Ticket: #3487

14 months agohttp: multipart unused code removal
Philippe Antoine [Tue, 2 Aug 2022 13:55:25 +0000 (15:55 +0200)] 
http: multipart unused code removal

14 months agoeve/schema: complete and reorder smtp fields
Philippe Antoine [Thu, 23 May 2024 12:52:46 +0000 (14:52 +0200)] 
eve/schema: complete and reorder smtp fields

received and cc were missing

14 months agomime: improved token parsing
Philippe Antoine [Wed, 3 Aug 2022 10:48:52 +0000 (12:48 +0200)] 
mime: improved token parsing

Accepts escaped quote in escaped string

14 months agogithub-action: remove end of life CentOS 8 stream
Victor Julien [Mon, 3 Jun 2024 16:24:57 +0000 (18:24 +0200)] 
github-action: remove end of life CentOS 8 stream

14 months agodefrag: remove trackers on lookup
Victor Julien [Fri, 24 May 2024 17:11:41 +0000 (19:11 +0200)] 
defrag: remove trackers on lookup

When looking up a tracker, remove any timed out / completed trackers.

14 months agodefrag: add defrag.memuse counter
Victor Julien [Fri, 24 May 2024 16:27:11 +0000 (18:27 +0200)] 
defrag: add defrag.memuse counter

Gives a current snapshot of the memory in use by the defrag engine.

14 months agodefrag: timeout check on look up; tag for removal
Victor Julien [Thu, 23 May 2024 19:11:23 +0000 (21:11 +0200)] 
defrag: timeout check on look up; tag for removal

14 months agodefrag: add various counters
Victor Julien [Thu, 23 May 2024 18:46:22 +0000 (20:46 +0200)] 
defrag: add various counters

14 months agodefrag: remove tracker on frag pool issues
Victor Julien [Fri, 24 May 2024 17:14:10 +0000 (19:14 +0200)] 
defrag: remove tracker on frag pool issues

If a frag wasn't inserted due to pool empty or alloc failure, clear and

invalidate the tracker.

14 months agodefrag: add defrag.mgr.tracker_timeout counter
Victor Julien [Thu, 23 May 2024 18:42:58 +0000 (20:42 +0200)] 
defrag: add defrag.mgr.tracker_timeout counter

Updated by flow manager.

14 months agodefrag: update exception policy counter: ptr can't be NULL
Victor Julien [Fri, 24 May 2024 19:53:59 +0000 (21:53 +0200)] 
defrag: update exception policy counter: ptr can't be NULL

14 months agodefrag: fix test passing NULL pointers
Victor Julien [Fri, 24 May 2024 19:53:26 +0000 (21:53 +0200)] 
defrag: fix test passing NULL pointers

14 months agodefrag: turn queue into stack
Victor Julien [Thu, 23 May 2024 04:37:33 +0000 (06:37 +0200)] 
defrag: turn queue into stack

Only used by the spare tracker logic, which works better as a stack.

14 months agodefrag: minor cleanups; dead code removal
Victor Julien [Thu, 23 May 2024 04:42:20 +0000 (06:42 +0200)] 
defrag: minor cleanups; dead code removal

14 months agodefrag: turn hash row into single linked list
Victor Julien [Wed, 22 May 2024 13:29:13 +0000 (15:29 +0200)] 
defrag: turn hash row into single linked list

14 months agodefrag: timeout/reuse start of list
Victor Julien [Wed, 22 May 2024 10:41:20 +0000 (12:41 +0200)] 
defrag: timeout/reuse start of list

14 months agodefrag: simplify lookup/create loops
Victor Julien [Wed, 22 May 2024 10:17:10 +0000 (12:17 +0200)] 
defrag: simplify lookup/create loops

Turn into a simpler do { } while loop like in the flow code.

14 months agoeve/schema: reformat
Victor Julien [Sat, 1 Jun 2024 18:07:32 +0000 (20:07 +0200)] 
eve/schema: reformat

14 months agogithub-actions: bump codecov/codecov-action from 4.1.1 to 4.4.1
dependabot[bot] [Sat, 1 Jun 2024 19:52:56 +0000 (19:52 +0000)] 
github-actions: bump codecov/codecov-action from 4.1.1 to 4.4.1

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.1.1 to 4.4.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.1.1...125fc84a9a348dbcf27191600683ec096ec9021c)

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

Signed-off-by: dependabot[bot] <support@github.com>
14 months agogithub-actions: bump ossf/scorecard-action from 2.3.1 to 2.3.3
dependabot[bot] [Sat, 1 Jun 2024 19:52:53 +0000 (19:52 +0000)] 
github-actions: bump ossf/scorecard-action from 2.3.1 to 2.3.3

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.1 to 2.3.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/0864cf19026789058feabb7e87baa5f140aac736...dc50aa9510b46c811795eb24b2f1ba02a914e534)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
14 months agogithub-actions: bump github/codeql-action from 3.25.3 to 3.25.7
dependabot[bot] [Sat, 1 Jun 2024 19:52:50 +0000 (19:52 +0000)] 
github-actions: bump github/codeql-action from 3.25.3 to 3.25.7

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.3 to 3.25.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.25.3...v3.25.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
14 months agooutput/streaming: suppress noisy start up message 11214/head
Victor Julien [Sat, 1 Jun 2024 14:11:36 +0000 (16:11 +0200)] 
output/streaming: suppress noisy start up message

14 months agooutput/lua: handle registration error
Victor Julien [Sat, 1 Jun 2024 14:11:10 +0000 (16:11 +0200)] 
output/lua: handle registration error

Use error message instead of info message.

14 months agoeve: revert ethernet addresses when needed
Eric Leblond [Sun, 15 Oct 2023 13:39:40 +0000 (15:39 +0200)] 
eve: revert ethernet addresses when needed

EVE logging has a direction parameter that can cause the logging
of an application layer to be done in a direction that is not linked
to the packet. As a result the source IP addres could be assigned the
MAC address of the destination IP and reverse.

This patch addresses this by propagating the direction to the ethernet
logging function and using it there to define the correct mapping.

Issue #6405

14 months agoutil/radix-tree: fix potential dereference of nullptr
Alexey Simakov [Tue, 28 May 2024 16:36:58 +0000 (19:36 +0300)] 
util/radix-tree: fix potential dereference of nullptr

Fix potential dereferece of nullptr in case of
unsuccessful allocation of memory leak for tree nodes

Bug: #7049

14 months agolua: use quoted include style to avoid system includes 11199/head
Jason Ish [Thu, 30 May 2024 18:19:39 +0000 (12:19 -0600)] 
lua: use quoted include style to avoid system includes

Use quoted include style for Lua includes ("lua.h" instead of <lua.h>)
as this could result in system includes being picked up instead of the
includes from our vendor directory.

14 months agostyle: remove some useless return
Philippe Antoine [Wed, 15 May 2024 13:06:39 +0000 (15:06 +0200)] 
style: remove some useless return

and remove empty line before end of function

14 months agosrc: remove some unused parameters
Philippe Antoine [Tue, 14 May 2024 20:38:22 +0000 (22:38 +0200)] 
src: remove some unused parameters

14 months agodevguide: highlight commit message example 11179/head
Juliana Fajardini [Wed, 29 May 2024 15:24:30 +0000 (12:24 -0300)] 
devguide: highlight commit message example

Although we have the example for a commit message in our Code Submission
Process sub-chapter, seems that people still oversee it a lot. It was
suggested that we put it in a note-box, to make it more visible.

14 months agothreads: give threads more time to get ready
Victor Julien [Wed, 29 May 2024 05:03:24 +0000 (07:03 +0200)] 
threads: give threads more time to get ready

In certain conditions, it can take a long time for threads to start up.
For example in af-packet, setting up the socket, rings, etc has been
observed to take close to half a second per thread, and since the
threads go one by one in a preset order, this means the start up can
take a lot of time if there are many threads. The old logic would just
allow a hard coded 60s. This was not always enough when the number of
threads was high.

This patch makes the wait time take the number of threads into account.
It adds a second of time budget to the base 60s for each thread.

So as an example, if a system has 112 af-packet threads, it would wait
172 seconds (60 + 112) for the threads to get ready.

Ticket: #7048.

14 months agothreads: optimize start up check
Victor Julien [Mon, 27 May 2024 15:12:09 +0000 (17:12 +0200)] 
threads: optimize start up check

When starting a large amount of threads, the loop was inefficient. It
would loop over the threads and if one wasn't yet ready it would sleep a
bit and then reevaluate all the threads. This reevaluation of threads
already checked was inefficient, and could lead to the time budget
running out.

This patch splits the check, and keeps track of the threads that have
already passed. This avoids the rescanning of already checked threads.

14 months agotls-store: support client logging
Victor Julien [Sat, 25 May 2024 15:35:26 +0000 (17:35 +0200)] 
tls-store: support client logging

Adds a `client-` prefix to the logged certs and meta files.

Ticket: #7045.

14 months agotlsstore: remove stale FIXME
Victor Julien [Sat, 25 May 2024 17:22:04 +0000 (19:22 +0200)] 
tlsstore: remove stale FIXME

14 months agodetect/tls.store: fix direction check
Victor Julien [Sat, 25 May 2024 07:36:48 +0000 (09:36 +0200)] 
detect/tls.store: fix direction check

STREAM_* flags are invalid for `Flow::flags`.

Fixes: dfcb4295240f ("detect/cert: Use client side certs")
14 months agogithub-ci: re-add --disable-lua to commit check 11161/head 11165/head 11170/head
Jason Ish [Tue, 28 May 2024 18:20:29 +0000 (12:20 -0600)] 
github-ci: re-add --disable-lua to commit check

This is required for some older versions in the pull request to build
as the commits change some compile time options with respect to Lua.

14 months agodoc: update lua sandbox docs for allowed packages/functions
Jason Ish [Mon, 27 May 2024 22:12:30 +0000 (16:12 -0600)] 
doc: update lua sandbox docs for allowed packages/functions

14 months agolua: track memory limit exceede errors
Jason Ish [Mon, 27 May 2024 21:37:17 +0000 (15:37 -0600)] 
lua: track memory limit exceede errors

Update the Lua allocated to set a code on memory allocation limit
exceeded errors so an appropriate error message can be logged and a
state incremented.

Fixes the tracking of the allocated size by using the difference
between original size, and new size and toss in some debug
validations.

14 months agolua: remove sandbox lib for now
Jason Ish [Fri, 24 May 2024 22:05:58 +0000 (16:05 -0600)] 
lua: remove sandbox lib for now

Not sure if I see a use for it, some extra debug logging might be just
as useful for those writing Lua scripts.

14 months agolua: add logging and counter for instruction limit being exceeded
Jason Ish [Fri, 24 May 2024 21:57:08 +0000 (15:57 -0600)] 
lua: add logging and counter for instruction limit being exceeded

14 months agolua: add blocked functions as a special log type plus stat
Jason Ish [Fri, 24 May 2024 21:26:32 +0000 (15:26 -0600)] 
lua: add blocked functions as a special log type plus stat

Distinguish between a generic Lua script error and an error created by a
function being blocked, so each is logged once respective of each other.

Also add a stat that is incremented when a script fails due to a
blocked function.

NOTE: This does not catch calls to functions that are blocked by not
having the library loaded, such as "io.open", as they are blocked by
not even loading the "io" library.

14 months agolua: use a function allow list instead of a deny list
Jason Ish [Thu, 23 May 2024 17:55:28 +0000 (11:55 -0600)] 
lua: use a function allow list instead of a deny list

The Lua library surface area is small enough to manage an allow list,
which is generally better than a deny list, as we'll explicitly need
to opt-in to new functions provided by the Lua runtime.

14 months agorust/Makefile: cleanup "clean" targets
Jason Ish [Mon, 15 Apr 2024 16:16:31 +0000 (10:16 -0600)] 
rust/Makefile: cleanup "clean" targets

Remove maintainer-clean-local, this is not needed.

In distclean-local, remove "rust/dist" and "rust/vendor" as they are
created during "make dist".

In "clean-local", remove "rust/target" and "rust/gen" as they are
created during a normal "make".

14 months agogithub-ci/scan-build: exclude rust (lua)
Jason Ish [Mon, 15 Apr 2024 04:44:52 +0000 (22:44 -0600)] 
github-ci/scan-build: exclude rust (lua)

The vendored Lua code triggers some scan-build failures, so exclude
the rust/ directory for now. Might want to look at these separately
though.

14 months agogithub-ci: test make after clean without cbindgen
Jason Ish [Mon, 15 Apr 2024 18:00:34 +0000 (12:00 -0600)] 
github-ci: test make after clean without cbindgen

Modify the CentOS 9 Stream build to not have cbdingen available, as
its already building from the dist.  But add a "make clean" followed
by a "make" to test that it still builds after a clean.

14 months agolua: remove lua as a compile time feature
Jason Ish [Wed, 1 May 2024 20:44:52 +0000 (14:44 -0600)] 
lua: remove lua as a compile time feature

Its always built-in. However, can be disabled at runtime.

14 months agorust/lua: remove lua_int8 feature
Jason Ish [Tue, 30 Apr 2024 22:45:18 +0000 (16:45 -0600)] 
rust/lua: remove lua_int8 feature

Now that we're fixed to Lua 5.4, the integer size is always 8.

14 months agolua: use rust crate to vendor (bundle) lua
Jason Ish [Sat, 13 Apr 2024 23:08:09 +0000 (17:08 -0600)] 
lua: use rust crate to vendor (bundle) lua

Remove lua-dev(el) from all CI tests.

14 months agolua: reset instruction counter before calling script
Jason Ish [Fri, 24 May 2024 21:26:19 +0000 (15:26 -0600)] 
lua: reset instruction counter before calling script

14 months agolua: misc cleanups in sandbox implementation
Jason Ish [Thu, 11 Apr 2024 17:06:29 +0000 (11:06 -0600)] 
lua: misc cleanups in sandbox implementation

Including:
- rename guards
- SCMalloc to SCCalloc
- remove unused enum
- rename public functions to our naming standard

14 months agodoc: Initial doc for lua sandbox
Jo Johnson [Mon, 5 Feb 2024 22:58:34 +0000 (14:58 -0800)] 
doc: Initial doc for lua sandbox

14 months agolua: Add config to allow sandbox bypass
Jo Johnson [Mon, 5 Feb 2024 20:03:59 +0000 (12:03 -0800)] 
lua: Add config to allow sandbox bypass

14 months agolua: Add config override for lua sandbox limits
Jo Johnson [Mon, 29 Jan 2024 16:56:53 +0000 (08:56 -0800)] 
lua: Add config override for lua sandbox limits

14 months agolua: Add lua sandbox for detection rules
Jo Johnson [Wed, 20 Dec 2023 20:14:03 +0000 (12:14 -0800)] 
lua: Add lua sandbox for detection rules

14 months agolua: remove internal references to luajit
Jo Johnson [Fri, 26 Jan 2024 18:09:00 +0000 (10:09 -0800)] 
lua: remove internal references to luajit

14 months agolua: build lua by default
Jo Johnson [Tue, 16 Jan 2024 18:59:28 +0000 (10:59 -0800)] 
lua: build lua by default

Ticket: #4776

[Edits by Jason Ish]
- Add Lua in CI where needed
- Disable Lua for builds that don't have Lua 5.4