diff --git a/protofiles/CommandRequest.proto b/protofiles/CommandRequest.proto index 2c250d2e86375..3813149d931c0 100644 --- a/protofiles/CommandRequest.proto +++ b/protofiles/CommandRequest.proto @@ -21,6 +21,7 @@ message CommandRequest { PCAP_RECONSTRUCTION = 10; LICENSE = 11; MACHINE_ID = 12; + LUA_SAVE = 13; } required CommandType type = 1; optional string stringArgOne = 2; diff --git a/protofiles/LuaDefinedRule.proto b/protofiles/LuaDefinedRule.proto new file mode 100644 index 0000000000000..4fe0bb54af99a --- /dev/null +++ b/protofiles/LuaDefinedRule.proto @@ -0,0 +1,37 @@ +package protoMsg; + +option java_package = "com.logrhythm.nm.message"; +option java_outer_classname = "LuaRulesMsg"; + + +message LuaDefinedRule { + enum LuaType { + CUSTOM = 0; + SYSTEM = 1; + } + + enum LuaExecution { + PACKET_RULE = 0; + FLOW_RULE = 1; + } + + required LuaType type = 1; + required string code =2; + + optional string name = 3; + optional bool enabled = 4; + optional string description = 5; + optional string author = 6; + optional string uuid = 7; + optional uint64 last_modified_date =8; +} + + + +message LuaRules { + message LuaSerializedRule { + optional string uuid = 1; + required string rule = 2; + } + repeated LuaSerializedRule rules =1; +} \ No newline at end of file diff --git a/scripts/buildProtoFiles.sh b/scripts/buildProtoFiles.sh index 32b560cb57357..ef1ddccac4080 100755 --- a/scripts/buildProtoFiles.sh +++ b/scripts/buildProtoFiles.sh @@ -80,6 +80,7 @@ cd "$cppSrcDir" "$protoc" -I="$protoFileDir":$thirdPartyDir:/usr/include:$DISTDIR/protobuf/include --cpp_out=libprocess "$protoFileDir"/ProcessRequest.proto "$protoc" -I="$protoFileDir":$thirdPartyDir:/usr/include:$DISTDIR/protobuf/include --cpp_out=libprocess "$protoFileDir"/ProcessReply.proto "$protoc" -I="$protoFileDir":$thirdPartyDir:/usr/include:$DISTDIR/protobuf/include --cpp_out=libcommand "$protoFileDir"/DriveInfo.proto +"$protoc" -I="$protoFileDir":$thirdPartyDir:/usr/include:$DISTDIR/protobuf/include --cpp_out=libcommand "$protoFileDir"/LuaDefinedRule.proto "$protoc" -I="$protoFileDir":$thirdPartyDir:/usr/include:$DISTDIR/protobuf/include --cpp_out=libcommand "$protoFileDir"/ConfigDefaults.proto "$protoc" -I="$protoFileDir":$thirdPartyDir:/usr/include:$DISTDIR/protobuf/include --cpp_out=libcommand "$protoFileDir"/ConfigDefaultsRequest.proto "$protoc" -I="$protoFileDir":$thirdPartyDir:/usr/include:$DISTDIR/protobuf/include --cpp_out=libfork "$protoFileDir"/ForkerReply.proto @@ -109,6 +110,8 @@ mv libcommand/CommandReply.pb.cc libcommand/CommandReply.pb.cpp mv libprocess/ProcessRequest.pb.cc libprocess/ProcessRequest.pb.cpp mv libprocess/ProcessReply.pb.cc libprocess/ProcessReply.pb.cpp mv libcommand/DriveInfo.pb.cc libcommand/DriveInfo.pb.cpp +mv libcommand/LuaDefinedRule.pb.cc libcommand/LuaDefinedRule.pb.cpp + mv libcommand/ConfigDefaults.pb.cc libcommand/ConfigDefaults.pb.cpp mv libcommand/ConfigDefaultsRequest.pb.cc libcommand/ConfigDefaultsRequest.pb.cpp mv libfork/ForkerReply.pb.cc libfork/ForkerReply.pb.cpp