Skip to content

Commit

Permalink
transform: Add luaxform files
Browse files Browse the repository at this point in the history
Issue: 2290

This commit adds the source files for the new transform -- luaxform.
  • Loading branch information
jlucovsky committed Sep 15, 2024
1 parent 7d1efce commit 1d014e6
Show file tree
Hide file tree
Showing 7 changed files with 411 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ noinst_HEADERS = \
detect-transform-compress-whitespace.h \
detect-transform-dotprefix.h \
detect-transform-header-lowercase.h \
detect-transform-luaxform.h \
detect-transform-md5.h \
detect-transform-pcrexform.h \
detect-transform-sha1.h \
Expand Down Expand Up @@ -895,6 +896,7 @@ libsuricata_c_a_SOURCES = \
detect-transform-compress-whitespace.c \
detect-transform-dotprefix.c \
detect-transform-header-lowercase.c \
detect-transform-luaxform.c \
detect-transform-md5.c \
detect-transform-pcrexform.c \
detect-transform-sha1.c \
Expand Down
2 changes: 2 additions & 0 deletions src/detect-engine-register.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
#include "detect-transform-casechange.h"
#include "detect-transform-header-lowercase.h"
#include "detect-transform-base64.h"
#include "detect-transform-luaxform.h"

#include "util-rule-vars.h"

Expand Down Expand Up @@ -695,6 +696,7 @@ void SigTableSetup(void)
DetectTransformToUpperRegister();
DetectTransformHeaderLowercaseRegister();
DetectTransformFromBase64DecodeRegister();
DetectTransformLuaxformRegister();

DetectFileHandlerRegister();

Expand Down
1 change: 1 addition & 0 deletions src/detect-engine-register.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ enum DetectKeywordId {
DETECT_TRANSFORM_TOUPPER,
DETECT_TRANSFORM_HEADER_LOWERCASE,
DETECT_TRANSFORM_FROM_BASE64,
DETECT_TRANSFORM_LUAXFORM,

DETECT_AL_IKE_EXCH_TYPE,
DETECT_AL_IKE_SPI_INITIATOR,
Expand Down
4 changes: 1 addition & 3 deletions src/detect-lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "util-var-name.h"

#include "util-lua.h"
#include "util-lua-common.h"
#include "util-lua-sandbox.h"

static int DetectLuaMatch (DetectEngineThreadCtx *,
Expand Down Expand Up @@ -126,9 +127,6 @@ void DetectLuaRegister(void)
#define FLAG_INSTRUCTION_LIMIT_LOGGED BIT_U32(25)
#define FLAG_MEMORY_LIMIT_LOGGED BIT_U32(26)

#define DEFAULT_LUA_ALLOC_LIMIT 500000
#define DEFAULT_LUA_INSTRUCTION_LIMIT 500000

#if 0
/** \brief dump stack from lua state to screen */
void LuaDumpStack(lua_State *state)
Expand Down
Loading

0 comments on commit 1d014e6

Please sign in to comment.