]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1825 in SNORT/snort3 from ~RUCOMBS/snort3:talos_alignment to...
authorRuss Combs (rucombs) <rucombs@cisco.com>
Mon, 4 Nov 2019 15:15:45 +0000 (10:15 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Mon, 4 Nov 2019 15:15:45 +0000 (10:15 -0500)
Squashed commit of the following:

commit 08d2f79e350a96c4359e7169ff1369e97f86f458
Author: russ <rucombs@cisco.com>
Date:   Fri Nov 1 10:22:36 2019 -0400

    search_engine: stop searching if queue limit is reached

commit 6e23316f0236958c4656610bdc1bad3a164c1a9f
Author: russ <rucombs@cisco.com>
Date:   Tue Oct 29 18:46:47 2019 -0400

    lua: tweak default conf and add tweaks for various scenarios

    Remove perf related configs from default snort.lua.  These depend
    on the specific deployment.

    Add lua files for connectivity, balanced, security, and max detect
    which provide an easy way to start tuning your config.

commit e1bc66e26d8b042153e8c41ba7f05526f4bdab38
Author: russ <rucombs@cisco.com>
Date:   Mon Nov 4 07:42:01 2019 -0500

    imap, pop, smtp: changed default decode depths to unlimited

commit d93e7ec438fec3ecbfd404fb33e0f1e5a8283846
Author: russ <rucombs@cisco.com>
Date:   Fri Nov 1 10:15:42 2019 -0400

    http_inspect: change accelerated_blocking to detained_inspection

commit 8f93239ab64372053cd7c1c1806b03e5b6768e54
Author: russ <rucombs@cisco.com>
Date:   Wed Oct 30 07:57:54 2019 -0400

    ips_option::enable: fix dynamic plugin build

commit d803c6f0c428dfd491733db4f18311157a7247d6
Author: russ <rucombs@cisco.com>
Date:   Tue Oct 29 22:09:28 2019 -0400

    detection: negated fast patterns are last choice

commit 1b9bfcaa59a55b43f17817d6a2ad351aab9ec4af
Author: russ <rucombs@cisco.com>
Date:   Tue Oct 29 13:34:27 2019 -0400

    ips: define a builtin GID range to prevent unloaded SIDs from firing on all packets

    100 <= GID <= 999 defines a builtin rule range such that SIDs from GIDs in this range
    that are configured won't fire unless the module is loaded and configured.  This is
    helpful when a dynamic plugin is not loaded.  It is possible to have builtin GIDs
    outside this range, but they may fire inadvertently.

    Also, note that "builtin" rules doesn't include just statically linked modules.  Any
    plugin generator (excluding text rules and SO rules) is considered "builtin".

    Exception to the above is granted for the old SDF (138) generator from Snort 2.
    Rules for GID 138 may appear as a result of snort2lua or user porting efforts so
    it is not considered a builtin rule.

commit d6f3553be176e7e916c627a2235546d5b0bf99a3
Author: russ <rucombs@cisco.com>
Date:   Tue Oct 29 11:13:50 2019 -0400

    port_scan: increase default memcap to a more reasonable 10M

commit 1ec6e5825939555a5924de522ae5608a49f98c69
Author: russ <rucombs@cisco.com>
Date:   Tue Oct 29 11:12:07 2019 -0400

    telnet: fix check_encrypted help string

commit b30cebb995019ef83de4d9cd52a9d2f929a006c9
Author: russ <rucombs@cisco.com>
Date:   Sat Oct 26 19:43:19 2019 -0400

    dce_smb: deprecate config for smb_file_inspection, use smb_file_depth only

commit 147827d7a3228ebabf973ff1a188b13d4f50d939
Author: russ <rucombs@cisco.com>
Date:   Tue Oct 22 14:36:07 2019 -0400

    normalizer: make tcp.ips defaults to true

36 files changed:
lua/CMakeLists.txt
lua/balanced.lua [new file with mode: 0644]
lua/connectivity.lua [new file with mode: 0644]
lua/max_detect.lua [new file with mode: 0644]
lua/security.lua [new file with mode: 0644]
lua/snort.lua
lua/talos.lua
src/detection/fp_create.cc
src/detection/fp_detect.cc
src/detection/fp_utils.cc
src/detection/rules.h
src/ips_options/CMakeLists.txt
src/network_inspectors/normalize/norm_module.cc
src/network_inspectors/port_scan/ps_module.cc
src/parser/parse_rule.cc
src/service_inspectors/dce_rpc/dce_smb.cc
src/service_inspectors/dce_rpc/dce_smb2.cc
src/service_inspectors/dce_rpc/dce_smb_module.cc
src/service_inspectors/dce_rpc/dce_smb_module.h
src/service_inspectors/dce_rpc/dce_smb_utils.cc
src/service_inspectors/ftp_telnet/telnet_module.cc
src/service_inspectors/http_inspect/dev_notes.txt
src/service_inspectors/http_inspect/http_cutter.cc
src/service_inspectors/http_inspect/http_cutter.h
src/service_inspectors/http_inspect/http_flow_data.cc
src/service_inspectors/http_inspect/http_flow_data.h
src/service_inspectors/http_inspect/http_module.cc
src/service_inspectors/http_inspect/http_module.h
src/service_inspectors/http_inspect/http_msg_header.cc
src/service_inspectors/http_inspect/http_stream_splitter_scan.cc
src/service_inspectors/http_inspect/http_tables.cc
src/service_inspectors/http_inspect/http_test_input.h
src/service_inspectors/imap/imap_module.cc
src/service_inspectors/pop/pop_module.cc
src/service_inspectors/smtp/smtp_module.cc
tools/snort2lua/preprocessor_states/pps_dcerpc_server.cc

index 4f9fc0343b99957828612fee2e4fb86f3e12e301..b8866ef03f99d955ca3efad2f38e5dcea84ca513 100644 (file)
@@ -1,7 +1,11 @@
 
 set (LUA_SCRIPTS
+    balanced.lua
+    connectivity.lua
     file_magic.lua
     inline.lua
+    max_detect.lua
+    security.lua
     snort.lua
     snort_defaults.lua
     talos.lua
diff --git a/lua/balanced.lua b/lua/balanced.lua
new file mode 100644 (file)
index 0000000..74fbc89
--- /dev/null
@@ -0,0 +1,21 @@
+---------------------------------------------------------------------------
+-- balanced connectivity and security policy
+-- use with -c snort.lua --tweaks balanced
+---------------------------------------------------------------------------
+
+http_inspect.request_depth = 300
+http_inspect.response_depth = 500
+
+normalizer.tcp =
+{
+    ips = false,
+    rsv = false,
+    pad = false,
+    req_urg = false,
+    req_pay = false,
+    req_urp = false,
+    block = false,
+}
+
+port_scan = nil
+
diff --git a/lua/connectivity.lua b/lua/connectivity.lua
new file mode 100644 (file)
index 0000000..f9447bd
--- /dev/null
@@ -0,0 +1,24 @@
+---------------------------------------------------------------------------
+-- reduced security policy that favors connectivity
+-- use with -c snort.lua --tweaks connectivity
+---------------------------------------------------------------------------
+
+http_inspect.request_depth = 300
+http_inspect.response_depth = 500
+
+http_inspect.unzip = false
+http_inspect.utf8 = false
+
+normalizer.tcp =
+{
+    ips = false,
+    rsv = false,
+    pad = false,
+    req_urg = false,
+    req_pay = false,
+    req_urp = false,
+    block = false,
+}
+
+port_scan = nil
+
diff --git a/lua/max_detect.lua b/lua/max_detect.lua
new file mode 100644 (file)
index 0000000..bd18f15
--- /dev/null
@@ -0,0 +1,43 @@
+---------------------------------------------------------------------------
+-- maximum detection policy
+-- this will yield lowest throughput
+-- use with -c snort.lua --tweaks max_detect
+---------------------------------------------------------------------------
+
+ftp_server.check_encrypted = true
+
+http_inspect.detained_inspection = true
+http_inspect.decompress_pdf = true
+http_inspect.decompress_swf = true
+http_inspect.decompress_zip = true
+http_inspect.percent_u = true
+http_inspect.normalize_javascript = true
+
+imap.decompress_pdf = true
+imap.decompress_swf = true
+imap.decompress_zip = true
+
+pop.decompress_pdf = true
+pop.decompress_swf = true
+pop.decompress_zip = true
+
+port_scan = nil
+
+search_engine.detect_raw_tcp = true
+search_engine.queue_limit = 0
+
+smtp.decompress_pdf = true
+smtp.decompress_swf = true
+smtp.decompress_zip = true
+
+stream_tcp.require_3whs = 0
+
+stream_tcp.small_segments =
+{
+    count = 3,
+    maximum_size = 150,
+}
+
+telnet.check_encrypted = true
+telnet.normalize = true
+
diff --git a/lua/security.lua b/lua/security.lua
new file mode 100644 (file)
index 0000000..9945428
--- /dev/null
@@ -0,0 +1,36 @@
+---------------------------------------------------------------------------
+-- enhanced security policy
+-- use with -c snort.lua --tweaks security
+---------------------------------------------------------------------------
+
+ftp_server.check_encrypted = true
+
+http_inspect.decompress_pdf = true
+http_inspect.decompress_swf = true
+http_inspect.decompress_zip = true
+
+imap.decompress_pdf = true
+imap.decompress_swf = true
+imap.decompress_zip = true
+
+pop.decompress_pdf = true
+pop.decompress_swf = true
+pop.decompress_zip = true
+
+port_scan = nil
+
+smtp.decompress_pdf = true
+smtp.decompress_swf = true
+smtp.decompress_zip = true
+
+stream_tcp.require_3whs = 180
+
+stream_tcp.small_segments =
+{
+    count = 3,
+    maximum_size = 150,
+}
+
+telnet.check_encrypted = true
+telnet.normalize = true
+
index 9032ecc462bb9fde41eb9646a0849108fba481d2..f7ac1adc423fdacc8f15ce44771406f92c64c838 100644 (file)
@@ -148,11 +148,7 @@ binder =
 ---------------------------------------------------------------------------
 
 -- use latency to monitor / enforce packet and rule thresholds
-latency =
-{
-    packet = { max_time = 1500 },
-    rule = { max_time = 200 },
-}
+--latency = { }
 
 -- use these to capture perf data for analysis and tuning
 --profiler = { }
index 5a3630c192f09387acb4e8ecfd9cc222014a3893..a165fc4b33a875c21405e564c26d4ea312e99c09 100644 (file)
@@ -29,8 +29,6 @@ daq =
     snaplen = 65535
 }
 
-normalizer = { tcp = { ips = true } }
-
 snort = { }
 snort['-Q'] = true
 
index c4482256be55c32b2fbaa922d2d662d9cdfbde33..bcce9ad5e8a772f3bc369179f00ecd9833e214fc 100644 (file)
@@ -396,7 +396,7 @@ static int fpFinishPortGroupRule(
         pattern_length = pmd->pattern_size;
     }
 
-    if ( fp->get_debug_print_fast_patterns() )
+    if ( fp->get_debug_print_fast_patterns() and !otn->soid )
         print_fp_info(s_group, otn, pmd, pattern, pattern_length);
 
     PMX* pmx = (PMX*)snort_calloc(sizeof(PMX));
index f754a7ded753b9e31090d737c020a6f703946635..1aa2ce4fa2a32b8b4bf717ef522072ad832cf3a1 100644 (file)
@@ -777,6 +777,12 @@ bool MpseStash::push(void* user, void* tree, int index, void* list)
         }
     }
 
+    if ( max and ( count == max ) )
+    {
+        pmqs.tot_inq_overruns++;
+        return true;
+    }
+
     if ( !max or ( count < max ) )
     {
         Node node;
@@ -790,12 +796,6 @@ bool MpseStash::push(void* user, void* tree, int index, void* list)
         count++;
     }
 
-    if ( max and ( count == max ) )
-    {
-        pmqs.tot_inq_overruns++;
-        return true;
-    }
-
     return false;
 }
 
@@ -858,8 +858,7 @@ static int rule_tree_queue(
 {
     MpseStash* stash = ((IpsContext*)context)->stash;
 
-    stash->push(user, tree, index, list);
-    return 0;
+    return stash->push(user, tree, index, list) ? 1 : 0;
 }
 
 static inline int batch_search(
index 59f661fd77684e6c92c538ca8cbf24310a13e224..5fee5d735f8248cfc4bece1719fd71bf6e60b178 100644 (file)
@@ -289,6 +289,9 @@ bool FpSelector::is_better_than(
     if ( !pmd->is_negated() && rhs.pmd->is_negated() )
         return true;
 
+    if ( pmd->is_negated() && !rhs.pmd->is_negated() )
+        return false;
+
     if ( size > rhs.size )
         return true;
 
index 1a65ee1214c3553630ad51d6273843b6e79b9b6c..5e8bad60bc4d3514e45d338682c85aceac1829b2 100644 (file)
 #define GID_DEFAULT          1
 #define GID_SESSION        135
 
+#define GID_BUILTIN_MIN    100
+#define GID_BUILTIN_MAX    999
+
+// should be revoked in the future
+#define GID_EXCEPTION_SDF  138
+
 #define SESSION_EVENT_SYN_RX 1
 #define SESSION_EVENT_SETUP  2
 #define SESSION_EVENT_CLEAR  3
index affe4d62b3b7a4d83e688e1c3983f0cb946ac0d1..a1d56704f6ccfa9fc9c805402e155fc17d54b44b 100644 (file)
@@ -101,11 +101,12 @@ else (STATIC_IPS_OPTIONS)
     add_dynamic_module(ips_ber_data ips_options ips_ber_data.cc)
     add_dynamic_module(ips_ber_skip ips_options ips_ber_skip.cc)
     add_dynamic_module(ips_bufferlen ips_options ips_bufferlen.cc)
-    add_dynamic_module(ips_byte_test ips_options ips_byte_test.cc)
-    add_dynamic_module(ips_byte_jump ips_options ips_byte_jump.cc)
     add_dynamic_module(ips_byte_extract ips_options ips_byte_extract.cc)
+    add_dynamic_module(ips_byte_jump ips_options ips_byte_jump.cc)
     add_dynamic_module(ips_byte_math ips_options ips_byte_math.cc)
+    add_dynamic_module(ips_byte_test ips_options ips_byte_test.cc)
     add_dynamic_module(ips_cvs ips_options ips_cvs.cc)
+    add_dynamic_module(ips_enable ips_options ips_enable.cc)
     add_dynamic_module(ips_file_type ips_options ips_file_type.cc)
     add_dynamic_module(ips_flags ips_options ips_flags.cc)
     add_dynamic_module(ips_fragbits ips_options ips_fragbits.cc)
index bc55a7f0870911a45a17b50680522ea051a5a5b6..6f170c774f2d2bd5ede6c7e2c453b3c8b84c1816 100644 (file)
@@ -116,7 +116,7 @@ static const Parameter norm_tcp_params[] =
     { "urp", Parameter::PT_BOOL, nullptr, "true",
       "adjust urgent pointer if beyond segment length" },
 
-    { "ips", Parameter::PT_BOOL, nullptr, "false",
+    { "ips", Parameter::PT_BOOL, nullptr, "true",
       "ensure consistency in retransmitted data" },
 
     { "ecn", Parameter::PT_SELECT, "off | packet | stream", "off",
index 85abdd373d98d36fd1fcb2c3f3c2d186bc3d7b5d..b78f9d017f944e0f63905d22dd0a49ed3c6ac1b9 100644 (file)
@@ -59,7 +59,7 @@ static const Parameter scan_params[] =
 
 static const Parameter ps_params[] =
 {
-    { "memcap", Parameter::PT_INT, "1024:maxSZ", "1048576",
+    { "memcap", Parameter::PT_INT, "1024:maxSZ", "10485760",
       "maximum tracker memory in bytes" },
 
     { "protos", Parameter::PT_MULTI, protos, "all",
index f57f2740840c769fa35c00eea6125d369d7011bd..35f0113abb2cd65a0e2db84f358201400511abdc 100644 (file)
@@ -1154,6 +1154,20 @@ static void parse_rule_state(SnortConfig* sc, RuleTreeNode& rtn, OptTreeNode* ot
     OtnFree(otn);
 }
 
+static bool is_builtin(uint32_t gid)
+{
+    if ( ModuleManager::gid_in_use(gid) )
+        return true;
+
+    // the builtin range prevents unloaded sids from firing on every packet
+    if ( gid < GID_BUILTIN_MIN or gid > GID_BUILTIN_MAX )
+        return false;
+
+    // not builtin but may get used and abused by snort2lua
+    // should be deleted at some point
+    return gid != GID_EXCEPTION_SDF;
+}
+
 void parse_rule_close(SnortConfig* sc, RuleTreeNode& rtn, OptTreeNode* otn)
 {
     if ( s_ignore )
@@ -1226,7 +1240,7 @@ void parse_rule_close(SnortConfig* sc, RuleTreeNode& rtn, OptTreeNode* otn)
         otn->sigInfo.builtin = false;
         so_rule_count++;
     }
-    else if ( ModuleManager::gid_in_use(otn->sigInfo.gid) )
+    else if ( is_builtin(otn->sigInfo.gid) )
     {
         if ( otn->num_detection_opts )
             ParseError("%u:%u builtin rules do not support detection options",
index 25d6cfabc27938ebaccd5a80ffad02173dd9390c..bc77c4cea104d8a7ef15fa101d70fe799bb0d693 100644 (file)
@@ -28,7 +28,6 @@
 #include "file_api/file_service.h"
 #include "protocols/packet.h"
 #include "utils/util.h"
-#include "packet_io/active.h"
 
 #include "dce_context_data.h"
 #include "dce_smb_commands.h"
@@ -337,11 +336,6 @@ private:
 Dce2Smb::Dce2Smb(const dce2SmbProtoConf& pc)
 {
     config = pc;
-    if ((config.smb_file_inspection == DCE2_SMB_FILE_INSPECTION_ONLY)
-        || (config.smb_file_inspection == DCE2_SMB_FILE_INSPECTION_ON))
-    {
-        Active::set_enabled();
-    }
 }
 
 Dce2Smb::~Dce2Smb()
index 2874fbc35f1daed13bb3ab733f96085d4a8ad760..ff0389e093e54c1b2e6610a36a835af955dcf05d 100644 (file)
@@ -65,9 +65,8 @@ static inline void DCE2_Smb2InsertTid(DCE2_SmbSsnData* ssd, const uint32_t tid,
 {
     bool is_ipc = (share_type != SMB2_SHARE_TYPE_DISK);
 
-    if (!is_ipc && (!DCE2_ScSmbFileInspection((dce2SmbProtoConf*)ssd->sd.config)
-        || ((ssd->max_file_depth == -1) && DCE2_ScSmbFileDepth(
-        (dce2SmbProtoConf*)ssd->sd.config) == -1)))
+    if ( !is_ipc and
+        ssd->max_file_depth == -1 and DCE2_ScSmbFileDepth((dce2SmbProtoConf*)ssd->sd.config) == -1 )
     {
         trace_logf(dce_smb, "Not inserting TID (%u) because it's "
             "not IPC and not inspecting normal file data.\n", tid);
@@ -303,7 +302,7 @@ static void DCE2_Smb2CreateRequest(DCE2_SmbSsnData* ssd, const Smb2Hdr*,
     const Smb2CreateRequestHdr* smb_create_hdr,const uint8_t* end)
 {
     uint16_t name_offset = alignedNtohs(&(smb_create_hdr->name_offset));
+
     DCE2_Smb2InitFileTracker(&ssd->ftracker, false, 0);
 
     if (name_offset > SMB2_HEADER_LENGTH)
@@ -337,13 +336,13 @@ static void DCE2_Smb2CreateResponse(DCE2_SmbSsnData* ssd, const Smb2Hdr*,
 {
     uint64_t fileId_persistent;
     uint64_t file_size = UNKNOWN_FILE_SIZE;
-  
+
 
     fileId_persistent = alignedNtohq((const uint64_t*)(&(smb_create_hdr->fileId_persistent)));
     ssd->ftracker.fid_v2 = fileId_persistent;
     if (smb_create_hdr->end_of_file)
     {
-        file_size = alignedNtohq((const uint64_t*)(&(smb_create_hdr->end_of_file)));      
+        file_size = alignedNtohq((const uint64_t*)(&(smb_create_hdr->end_of_file)));
         ssd->ftracker.tracker.file.file_size = file_size;
     }
 
@@ -481,7 +480,7 @@ static void DCE2_Smb2ReadRequest(DCE2_SmbSsnData* ssd, const Smb2Hdr* smb_hdr,
 {
     uint64_t message_id, offset;
     uint64_t fileId_persistent;
-  
+
     message_id = alignedNtohq((const uint64_t*)(&(smb_hdr->message_id)));
     offset = alignedNtohq((const uint64_t*)(&(smb_read_hdr->offset)));
     fileId_persistent = alignedNtohq((const uint64_t*)(&(smb_read_hdr->fileId_persistent)));
@@ -566,7 +565,7 @@ static void DCE2_Smb2Read(DCE2_SmbSsnData* ssd, const Smb2Hdr* smb_hdr,
     {
         uint64_t message_id;
         Smb2Request* request;
-    
+
         message_id = alignedNtohq((const uint64_t*)(&(smb_hdr->message_id)));
         request = DCE2_Smb2GetRequest(ssd, message_id);
         if (!request)
index 6a4c062378925fbb0eea0d9f2393fa550fa8d471..ae8e280670d0f1553d9038ea16b20b9463a0b677 100644 (file)
@@ -129,11 +129,11 @@ static const Parameter s_params[] =
     { "valid_smb_versions", Parameter::PT_MULTI, "v1 | v2 | all", "all",
       "valid SMB versions" },
 
-    { "smb_file_inspection", Parameter::PT_ENUM, "off | on | only", "off",
-      "SMB file inspection" },
+    { "smb_file_inspection", Parameter::PT_ENUM, "off | on | only", nullptr,
+      "deprecated (not used): file inspection controlled by smb_file_depth" },
 
     { "smb_file_depth", Parameter::PT_INT, "-1:32767", "16384",
-      "SMB file depth for file data" },
+      "SMB file depth for file data (-1 = disabled, 0 = unlimited)" },
 
     { "smb_invalid_shares", Parameter::PT_STRING, nullptr, nullptr,
       "SMB shares to alert on " },
@@ -358,7 +358,7 @@ bool Dce2SmbModule::set(const char* fqn, Value& v, SnortConfig* c)
         set_smb_versions_mask(config,v.get_string());
 
     else if ( v.is("smb_file_inspection") )
-        config.smb_file_inspection = (dce2SmbFileInspection)v.get_uint8();
+        ParseWarning(WARN_CONF, "smb_file_inspection is deprecated (not used): use smb_file_depth");
 
     else if ( v.is("smb_file_depth") )
         config.smb_file_depth = v.get_int16();
@@ -403,24 +403,12 @@ void print_dce2_smb_conf(dce2SmbProtoConf& config)
     else
         LogMessage("    Maximum SMB compounded requests: %u\n", config.smb_max_compound);
 
-    if (config.smb_file_inspection == DCE2_SMB_FILE_INSPECTION_OFF)
-    {
-        LogMessage("    SMB file inspection: Disabled\n");
-    }
+    if (config.smb_file_depth == -1)
+        LogMessage("    SMB file depth: Disabled\n");
+    else if (config.smb_file_depth == 0)
+        LogMessage("    SMB file depth: Unlimited\n");
     else
-    {
-        if (config.smb_file_inspection == DCE2_SMB_FILE_INSPECTION_ONLY)
-            LogMessage("    SMB file inspection: Only\n");
-        else
-            LogMessage("    SMB file inspection: Enabled\n");
-
-        if (config.smb_file_depth == -1)
-            LogMessage("    SMB file depth: Disabled\n");
-        else if (config.smb_file_depth == 0)
-            LogMessage("    SMB file depth: Unlimited\n");
-        else
-            LogMessage("    SMB file depth: %d\n",config.smb_file_depth);
-    }
+        LogMessage("    SMB file depth: %d\n",config.smb_file_depth);
 
     if (config.smb_valid_versions_mask  == DCE2_VALID_SMB_VERSION_FLAG_V1)
     {
index 11eb1e237f41657fd7177e59ecb27bac7b8bd095..f64938c75176010c6e21d0a101a7dff3f91a61c7 100644 (file)
@@ -33,13 +33,6 @@ struct SnortConfig;
 #define DCE2_VALID_SMB_VERSION_FLAG_V1 1
 #define DCE2_VALID_SMB_VERSION_FLAG_V2 2
 
-enum dce2SmbFileInspection
-{
-    DCE2_SMB_FILE_INSPECTION_OFF = 0,
-    DCE2_SMB_FILE_INSPECTION_ON,
-    DCE2_SMB_FILE_INSPECTION_ONLY
-};
-
 enum dce2SmbFingerprintPolicy
 {
     DCE2_SMB_FINGERPRINT_POLICY_NONE = 0,
@@ -63,7 +56,6 @@ struct dce2SmbProtoConf
     uint8_t smb_max_chain;
     uint8_t smb_max_compound;
     uint16_t smb_valid_versions_mask;
-    dce2SmbFileInspection smb_file_inspection;
     int16_t smb_file_depth;
     DCE2_List* smb_invalid_shares;
     bool legacy_mode;
@@ -97,25 +89,8 @@ private:
 
 void print_dce2_smb_conf(dce2SmbProtoConf& config);
 
-inline bool DCE2_ScSmbFileInspection(const dce2SmbProtoConf* sc)
-{
-    if (sc == nullptr)
-        return false;
-    return ((sc->smb_file_inspection == DCE2_SMB_FILE_INSPECTION_ON)
-           || (sc->smb_file_inspection == DCE2_SMB_FILE_INSPECTION_ONLY));
-}
-
-inline bool DCE2_ScSmbFileInspectionOnly(const dce2SmbProtoConf* sc)
-{
-    if (sc == nullptr)
-        return false;
-    return sc->smb_file_inspection == DCE2_SMB_FILE_INSPECTION_ONLY;
-}
-
 inline int64_t DCE2_ScSmbFileDepth(const dce2SmbProtoConf* sc)
 {
-    if (!DCE2_ScSmbFileInspection(sc))
-        return -1;
     return sc->smb_file_depth;
 }
 
index 1e280dc405f325ceafd3d922058d508a27029e71..80087c71e2966992b22b7e26aa6d206050042bd7 100644 (file)
@@ -834,9 +834,8 @@ void DCE2_SmbRemoveTid(DCE2_SmbSsnData* ssd, const uint16_t tid)
 void DCE2_SmbInsertTid(DCE2_SmbSsnData* ssd,
     const uint16_t tid, const bool is_ipc)
 {
-    if (!is_ipc && (!DCE2_ScSmbFileInspection((dce2SmbProtoConf*)ssd->sd.config)
-        || ((ssd->max_file_depth == -1) && DCE2_ScSmbFileDepth(
-        (dce2SmbProtoConf*)ssd->sd.config) == -1)))
+    if ( !is_ipc and
+        ssd->max_file_depth == -1 and DCE2_ScSmbFileDepth((dce2SmbProtoConf*)ssd->sd.config) == -1 )
     {
         trace_logf(dce_smb, "Not inserting TID (%hu) "
             "because it's not IPC and not inspecting normal file "
@@ -844,14 +843,6 @@ void DCE2_SmbInsertTid(DCE2_SmbSsnData* ssd,
         return;
     }
 
-    if (is_ipc && DCE2_ScSmbFileInspectionOnly((dce2SmbProtoConf*)ssd->sd.config))
-    {
-        trace_logf(dce_smb, "Not inserting TID (%hu) "
-            "because it's IPC and only inspecting normal file "
-            "data.\n", tid);
-        return;
-    }
-
     int insert_tid = (int)tid;
     // Set a bit so as to distinguish between IPC and non-IPC TIDs
     if (!is_ipc)
index 330745559a646e2158bb455e76d9c112dbf901fb..cb7e13afbeabe565be9a20254ad2a79733b0e765 100644 (file)
@@ -51,7 +51,7 @@ static const Parameter s_params[] =
       "check for end of encryption" },
 
     { "encrypted_traffic", Parameter::PT_BOOL, nullptr, "false",
-      "check for encrypted Telnet and FTP" },
+      "check for encrypted Telnet" },
 
     { "normalize", Parameter::PT_BOOL, nullptr, "false",
       "eliminate escape sequences" },
index 4a733690c229505e9fbe0636c832013be26d60f4..5f526a20e9cc51a36179a991091c242e3d400988 100644 (file)
@@ -7,7 +7,7 @@ It serves several specialized purposes in cases where the HTTP message is trunca
 unexpectedly).
 
 The nature of splitting allows packets to be forwarded before they are aggregated into a message
-section and inspected. Accelerated blocking is a feature that allows the splitter to designate
+section and inspected. Detained inspection is a feature that allows the splitter to designate
 to Stream packets that are too risky to forward without being inspected. These packets are detained
 until such time as inspection is completed. The design is based on the principle that detaining
 one packet in a TCP stream effectively blocks all subsequent packets from being reassembled and
index fe99162ddb7c5da0b5e715b0b1ae91a810fe6220..a8c01fbf60d0948c99b62dcad3f8ec6d09f728cf 100644 (file)
@@ -282,7 +282,7 @@ ScanResult HttpBodyClCutter::cut(const uint8_t* buffer, uint32_t length, HttpInf
     if (octets_seen + length < flow_target)
     {
         octets_seen += length;
-        return need_accelerated_blocking(buffer, length) ? SCAN_NOT_FOUND_DETAIN : SCAN_NOT_FOUND;
+        return need_detained_inspection(buffer, length) ? SCAN_NOT_FOUND_DETAIN : SCAN_NOT_FOUND;
     }
 
     if (!stretch)
@@ -291,7 +291,7 @@ ScanResult HttpBodyClCutter::cut(const uint8_t* buffer, uint32_t length, HttpInf
         num_flush = flow_target - octets_seen;
         if (remaining > 0)
         {
-            need_accelerated_blocking(buffer, num_flush);
+            need_detained_inspection(buffer, num_flush);
             return SCAN_FOUND_PIECE;
         }
         else
@@ -307,7 +307,7 @@ ScanResult HttpBodyClCutter::cut(const uint8_t* buffer, uint32_t length, HttpInf
         else
             num_flush = flow_target - octets_seen;
         remaining -= octets_seen + num_flush;
-        need_accelerated_blocking(buffer, num_flush);
+        need_detained_inspection(buffer, num_flush);
         return SCAN_FOUND_PIECE;
     }
 
@@ -322,7 +322,7 @@ ScanResult HttpBodyClCutter::cut(const uint8_t* buffer, uint32_t length, HttpInf
     // Cannot stretch to the end of the message body. Cut at the original target.
     num_flush = flow_target - octets_seen;
     remaining -= flow_target;
-    need_accelerated_blocking(buffer, num_flush);
+    need_detained_inspection(buffer, num_flush);
     return SCAN_FOUND_PIECE;
 }
 
@@ -344,13 +344,13 @@ ScanResult HttpBodyOldCutter::cut(const uint8_t* buffer, uint32_t length, HttpIn
     {
         // Not enough data yet to create a message section
         octets_seen += length;
-        return need_accelerated_blocking(buffer, length) ? SCAN_NOT_FOUND_DETAIN : SCAN_NOT_FOUND;
+        return need_detained_inspection(buffer, length) ? SCAN_NOT_FOUND_DETAIN : SCAN_NOT_FOUND;
     }
     else if (stretch && (octets_seen + length <= flow_target + MAX_SECTION_STRETCH))
     {
         // Cut the section at the end of this TCP segment to avoid splitting a packet
         num_flush = length;
-        need_accelerated_blocking(buffer, num_flush);
+        need_detained_inspection(buffer, num_flush);
         return SCAN_FOUND_PIECE;
     }
     else
@@ -358,7 +358,7 @@ ScanResult HttpBodyOldCutter::cut(const uint8_t* buffer, uint32_t length, HttpIn
         // Cut the section at the target length. Either stretching is not allowed or the end of
         // the segment is too far away.
         num_flush = flow_target - octets_seen;
-        need_accelerated_blocking(buffer, num_flush);
+        need_detained_inspection(buffer, num_flush);
         return SCAN_FOUND_PIECE;
     }
 }
@@ -552,7 +552,7 @@ ScanResult HttpBodyChunkCutter::cut(const uint8_t* buffer, uint32_t length,
             }
 
             if (!detain_this_packet)
-                detain_this_packet = need_accelerated_blocking(buffer+k, skip_amount);
+                detain_this_packet = need_detained_inspection(buffer+k, skip_amount);
 
             k += skip_amount - 1;
             if ((expected -= skip_amount) == 0)
@@ -627,7 +627,7 @@ ScanResult HttpBodyChunkCutter::cut(const uint8_t* buffer, uint32_t length,
             skip_amount = (skip_amount <= adjusted_target-data_seen) ? skip_amount :
                 adjusted_target-data_seen;
             if (!detain_this_packet)
-                detain_this_packet = need_accelerated_blocking(buffer+k, skip_amount);
+                detain_this_packet = need_detained_inspection(buffer+k, skip_amount);
             k += skip_amount - 1;
             if ((data_seen += skip_amount) == adjusted_target)
             {
@@ -657,19 +657,19 @@ ScanResult HttpBodyChunkCutter::cut(const uint8_t* buffer, uint32_t length,
 }
 
 // This method searches the input stream looking for the beginning of a script or other dangerous
-// content that requires accelerated blocking. Exactly what we are looking for is encapsulated in
+// content that requires detained inspection. Exactly what we are looking for is encapsulated in
 // dangerous().
 //
 // Return value true indicates a match and enables the packet that completes the matching sequence
 // to be detained.
 //
-// Once accelerated blocking is activated on a message body it never goes away. The first packet
+// Once detained inspection is activated on a message body it never goes away. The first packet
 // of every subsequent message section must be detained (detention_required). Supporting this
 // requirement requires that the calling routine submit all data including buffers that are about
 // to be flushed.
-bool HttpBodyCutter::need_accelerated_blocking(const uint8_t* data, uint32_t length)
+bool HttpBodyCutter::need_detained_inspection(const uint8_t* data, uint32_t length)
 {
-    if (!accelerated_blocking || packet_detained)
+    if (!detained_inspection || packet_detained)
         return false;
     if (detention_required || dangerous(data, length))
     {
@@ -680,7 +680,7 @@ bool HttpBodyCutter::need_accelerated_blocking(const uint8_t* data, uint32_t len
     return false;
 }
 
-// Currently we do accelerated blocking when we see a javascript starting
+// Currently we do detained inspection when we see a javascript starting
 bool HttpBodyCutter::dangerous(const uint8_t* data, uint32_t length)
 {
     static const uint8_t match_string[] = { '<', 's', 'c', 'r', 'i', 'p', 't' };
index dcdba544b17e2739d7d772faa00fed5ae7ae1c49..d7d5d2ce72133f66a872e9cf8ab9c846287ab7bc 100644 (file)
@@ -96,17 +96,17 @@ private:
 class HttpBodyCutter : public HttpCutter
 {
 public:
-    HttpBodyCutter(bool accelerated_blocking_) : accelerated_blocking(accelerated_blocking_) {}
+    HttpBodyCutter(bool detained_inspection_) : detained_inspection(detained_inspection_) {}
     void soft_reset() override { octets_seen = 0; packet_detained = false; }
     void detain_ended() { packet_detained = false; }
 
 protected:
-    bool need_accelerated_blocking(const uint8_t* data, uint32_t length);
+    bool need_detained_inspection(const uint8_t* data, uint32_t length);
 
 private:
     bool dangerous(const uint8_t* data, uint32_t length);
 
-    const bool accelerated_blocking;
+    const bool detained_inspection;
     bool packet_detained = false;
     uint8_t partial_match = 0;
     bool detention_required = false;
@@ -115,8 +115,8 @@ private:
 class HttpBodyClCutter : public HttpBodyCutter
 {
 public:
-    HttpBodyClCutter(int64_t expected_length, bool accelerated_blocking) :
-        HttpBodyCutter(accelerated_blocking), remaining(expected_length)
+    HttpBodyClCutter(int64_t expected_length, bool detained_inspection) :
+        HttpBodyCutter(detained_inspection), remaining(expected_length)
         { assert(remaining > 0); }
     HttpEnums::ScanResult cut(const uint8_t*, uint32_t length, HttpInfractions*, HttpEventGen*,
         uint32_t flow_target, bool stretch) override;
@@ -128,7 +128,7 @@ private:
 class HttpBodyOldCutter : public HttpBodyCutter
 {
 public:
-    explicit HttpBodyOldCutter(bool accelerated_blocking) : HttpBodyCutter(accelerated_blocking) {}
+    explicit HttpBodyOldCutter(bool detained_inspection) : HttpBodyCutter(detained_inspection) {}
     HttpEnums::ScanResult cut(const uint8_t*, uint32_t, HttpInfractions*, HttpEventGen*,
         uint32_t flow_target, bool stretch) override;
 };
@@ -136,7 +136,7 @@ public:
 class HttpBodyChunkCutter : public HttpBodyCutter
 {
 public:
-    explicit HttpBodyChunkCutter(bool accelerated_blocking) : HttpBodyCutter(accelerated_blocking)
+    explicit HttpBodyChunkCutter(bool detained_inspection) : HttpBodyCutter(detained_inspection)
         {}
     HttpEnums::ScanResult cut(const uint8_t* buffer, uint32_t length,
         HttpInfractions* infractions, HttpEventGen* events, uint32_t flow_target, bool stretch)
index a339c948889faaefc6fb2bc6dd306bc54e0fa36a..ed494f2c5b2a47fc4eab2233bc917b952022a594 100644 (file)
@@ -113,7 +113,7 @@ void HttpFlowData::half_reset(SourceId source_id)
     body_octets[source_id] = STAT_NOT_PRESENT;
     section_size_target[source_id] = 0;
     stretch_section_to_packet[source_id] = false;
-    accelerated_blocking[source_id] = false;
+    detained_inspection[source_id] = false;
     file_depth_remaining[source_id] = STAT_NOT_PRESENT;
     detect_depth_remaining[source_id] = STAT_NOT_PRESENT;
     detection_status[source_id] = DET_REACTIVATING;
index f8ffef62f442a4f1bce9ac01a312d2d98e3b93cd..ca2d37d13cde5c5af41a55802dc52d144cf73bfa 100644 (file)
@@ -121,7 +121,7 @@ private:
     HttpEnums::CompressId compression[2] = { HttpEnums::CMP_NONE, HttpEnums::CMP_NONE };
     HttpEnums::DetectionStatus detection_status[2] = { HttpEnums::DET_ON, HttpEnums::DET_ON };
     bool stretch_section_to_packet[2] = { false, false };
-    bool accelerated_blocking[2] = { false, false };
+    bool detained_inspection[2] = { false, false };
 
     // *** Inspector's internal data about the current message
     struct FdCallbackContext
index e388becf75bc0780ac9dba88d93b655e0d195ea4..111410831aebc4bd89b22a8c8195ea6341dd6863 100644 (file)
@@ -55,8 +55,8 @@ const Parameter HttpModule::http_params[] =
     { "decompress_zip", Parameter::PT_BOOL, nullptr, "false",
       "decompress zip files in response bodies" },
 
-    { "accelerated_blocking", Parameter::PT_BOOL, nullptr, "false",
-      "inspect JavaScript in response messages as soon as possible" },
+    { "detained_inspection", Parameter::PT_BOOL, nullptr, "false",
+      "store-and-forward as necessary to effectively block alerting JavaScript" },
 
     { "normalize_javascript", Parameter::PT_BOOL, nullptr, "false",
       "normalize JavaScript in response bodies" },
@@ -171,9 +171,9 @@ bool HttpModule::set(const char*, Value& val, SnortConfig*)
     {
         params->decompress_zip = val.get_bool();
     }
-    else if (val.is("accelerated_blocking"))
+    else if (val.is("detained_inspection"))
     {
-        params->accelerated_blocking = val.get_bool();
+        params->detained_inspection = val.get_bool();
     }
     else if (val.is("normalize_javascript"))
     {
index 65cbeb9866fe406ed0d126f048054d181af6194b..bc0ae1a514fbf47a5c6de15a542d82c77a9fd924 100644 (file)
@@ -42,7 +42,7 @@ public:
     bool decompress_pdf = false;
     bool decompress_swf = false;
     bool decompress_zip = false;
-    bool accelerated_blocking = false;
+    bool detained_inspection = false;
 
     struct JsNormParam
     {
index d7761f2f082de26cb69c00d170db816cf1aa6e85..5ff10d2858be17cd9767f1add4405f764cfc4b00 100644 (file)
@@ -301,8 +301,8 @@ void HttpMsgHeader::prepare_body()
     setup_utf_decoding();
     setup_file_decompression();
     update_depth();
-    // Limitations on accelerated blocking will be lifted as the feature is built out
-    session_data->accelerated_blocking[source_id] = params->accelerated_blocking &&
+    // Limitations on detained inspection will be lifted as the feature is built out
+    session_data->detained_inspection[source_id] = params->detained_inspection &&
         (source_id == SRC_SERVER) && (session_data->compression[source_id] == CMP_NONE) &&
         (params->request_depth == -1);
     if (source_id == SRC_CLIENT)
index 5d286f725ff2fbb13cfc9f6c6e136647e663b748..1860518c3ca92f0e2dc225b723428458c21c38e3 100644 (file)
@@ -73,11 +73,11 @@ HttpCutter* HttpStreamSplitter::get_cutter(SectionType type,
         return (HttpCutter*)new HttpHeaderCutter;
     case SEC_BODY_CL:
         return (HttpCutter*)new HttpBodyClCutter(session_data->data_length[source_id],
-            session_data->accelerated_blocking[source_id]);
+            session_data->detained_inspection[source_id]);
     case SEC_BODY_CHUNK:
-        return (HttpCutter*)new HttpBodyChunkCutter(session_data->accelerated_blocking[source_id]);
+        return (HttpCutter*)new HttpBodyChunkCutter(session_data->detained_inspection[source_id]);
     case SEC_BODY_OLD:
-        return (HttpCutter*)new HttpBodyOldCutter(session_data->accelerated_blocking[source_id]);
+        return (HttpCutter*)new HttpBodyOldCutter(session_data->detained_inspection[source_id]);
     default:
         assert(false);
         return nullptr;
index 92ab812fef7e0338ab9a8eb4690367befefd08dc..b39019e2aa29c14c7dbc32b6cfdba8437286b3f2 100644 (file)
@@ -406,8 +406,8 @@ const PegInfo HttpModule::peg_names[PEG_COUNT_MAX+1] =
     { CountType::SUM, "uri_coding", "URIs with character coding problems" },
     { CountType::NOW, "concurrent_sessions", "total concurrent http sessions" },
     { CountType::MAX, "max_concurrent_sessions", "maximum concurrent http sessions" },
-    { CountType::SUM, "detained_packets", "TCP packets delayed by accelerated blocking" },
-    { CountType::SUM, "partial_inspections", "pre-inspections for accelerated blocking" },
+    { CountType::SUM, "detained_packets", "TCP packets delayed by detained inspection" },
+    { CountType::SUM, "partial_inspections", "pre-inspections for detained inspection" },
     { CountType::END, nullptr, nullptr }
 };
 
index be628f0e69045504f0e2844ff503043dd62a933d..b626cab31aab43605dbd38c01f08562219de28fc 100644 (file)
@@ -64,7 +64,7 @@ private:
     // TCP connection directional close
     bool tcp_closed = false;
 
-    // partial flush requested, useful for testing accelerated blocking
+    // partial flush requested, useful for testing detained inspection
     bool partial = false;
 
     // number of octets that have been flushed and must be sent by reassemble
index a3031a1109bf815131c7ebb9b9e10d8274098c2c..e2595fcb7291fc010a007d9e9e1aecb7b38de542 100644 (file)
@@ -33,10 +33,10 @@ using namespace std;
 
 static const Parameter s_params[] =
 {
-    { "b64_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "b64_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "base64 decoding depth (-1 no limit)" },
 
-    { "bitenc_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "bitenc_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "non-Encoded MIME attachment extraction depth (-1 no limit)" },
 
     { "decompress_pdf", Parameter::PT_BOOL, nullptr, "false",
@@ -48,10 +48,10 @@ static const Parameter s_params[] =
     { "decompress_zip", Parameter::PT_BOOL, nullptr, "false",
       "decompress zip files in MIME attachments" },
 
-    { "qp_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "qp_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "quoted Printable decoding depth (-1 no limit)" },
 
-    { "uu_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "uu_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "Unix-to-Unix decoding depth (-1 no limit)" },
 
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
index 0f74dc439a6fc2b0ae9e280befda6ebc1f4870b1..8f040a10aad05f242fe7af1b59254a9bfb5c4fcb 100644 (file)
@@ -33,10 +33,10 @@ using namespace std;
 
 static const Parameter s_params[] =
 {
-    { "b64_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "b64_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "base64 decoding depth (-1 no limit)" },
 
-    { "bitenc_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "bitenc_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "Non-Encoded MIME attachment extraction depth (-1 no limit)" },
 
     { "decompress_pdf", Parameter::PT_BOOL, nullptr, "false",
@@ -48,10 +48,10 @@ static const Parameter s_params[] =
     { "decompress_zip", Parameter::PT_BOOL, nullptr, "false",
       "decompress zip files in MIME attachments" },
 
-    { "qp_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "qp_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "Quoted Printable decoding depth (-1 no limit)" },
 
-    { "uu_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "uu_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "Unix-to-Unix decoding depth (-1 no limit)" },
 
     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
index a7eb4ba60e9fc52260865178375f1188813a2195..6f639057f0b85749c0c03b4bfab6fa37963d1937 100644 (file)
@@ -70,13 +70,13 @@ static const Parameter s_params[] =
     { "auth_cmds", Parameter::PT_STRING, nullptr, nullptr,
       "commands that initiate an authentication exchange" },
 
-    { "b64_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "b64_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "depth used to decode the base64 encoded MIME attachments (-1 no limit)" },
 
     { "binary_data_cmds", Parameter::PT_STRING, nullptr, nullptr,
       "commands that initiate sending of data and use a length value after the command" },
 
-    { "bitenc_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "bitenc_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "depth used to extract the non-encoded MIME attachments (-1 no limit)" },
 
     { "data_cmds", Parameter::PT_STRING, nullptr, nullptr,
@@ -134,10 +134,10 @@ static const Parameter s_params[] =
     { "normalize_cmds", Parameter::PT_STRING, nullptr, nullptr,
       "list of commands to normalize" },
 
-    { "qp_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "qp_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "quoted-Printable decoding depth (-1 no limit)" },
 
-    { "uu_decode_depth", Parameter::PT_INT, "-1:65535", "1460",
+    { "uu_decode_depth", Parameter::PT_INT, "-1:65535", "-1",
       "Unix-to-Unix decoding depth (-1 no limit)" },
 
     { "valid_cmds", Parameter::PT_STRING, nullptr, nullptr,
index 1856f60c98b2d659d0bbb90b2fc5b31bcba61931..4a893e5a1c0ae8cd46a4c476e4129ed7ce0180d1 100644 (file)
@@ -186,7 +186,8 @@ bool DcerpcServer::parse_smb_file_inspection(std::istringstream& data_stream)
         {
             file_inspect.pop_back();
         }
-        tmpval = table_api.add_option("smb_file_inspection", file_inspect);
+        file_inspect = "smb_file_inspection: " + file_inspect;
+        tmpval = table_api.add_deleted_comment(file_inspect);
     }
     else
     {
@@ -207,7 +208,8 @@ bool DcerpcServer::parse_smb_file_inspection(std::istringstream& data_stream)
         std::string arg = file_inspect.substr(1, pos-1);
         // remove additional whitespaces
         arg.erase(remove_if(arg.begin(), arg.end(), isspace), arg.end());
-        tmpval = table_api.add_option("smb_file_inspection", arg);
+        arg = "smb_file_inspection: " + arg;
+        tmpval = table_api.add_deleted_comment(arg);
 
         pos = file_inspect.find("file-depth");
         if (pos == std::string::npos)