• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OISF / suricata / 23374838686

21 Mar 2026 07:29AM UTC coverage: 59.341% (-20.0%) from 79.315%
23374838686

Pull #15075

github

web-flow
Merge 90b4e834f into 6587e363a
Pull Request #15075: Stack 8001 v16.4

38 of 70 new or added lines in 10 files covered. (54.29%)

34165 existing lines in 563 files now uncovered.

119621 of 201584 relevant lines covered (59.34%)

650666.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

59.23
/src/detect-engine-register.c
1
/* Copyright (C) 2007-2024 Open Information Security Foundation
2
 *
3
 * You can copy, redistribute or modify this Program under the terms of
4
 * the GNU General Public License version 2 as published by the Free
5
 * Software Foundation.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 * GNU General Public License for more details.
11
 *
12
 * You should have received a copy of the GNU General Public License
13
 * version 2 along with this program; if not, write to the Free Software
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15
 * 02110-1301, USA.
16
 */
17

18
/**
19
 * \file
20
 *
21
 * \author Victor Julien <victor@inliniac.net>
22
 */
23

24
#include "suricata-common.h"
25
#include "suricata.h"
26
#include "detect.h"
27
#include "flow.h"
28
#include "flow-private.h"
29
#include "flow-bit.h"
30

31
#include "detect-parse.h"
32
#include "detect-engine.h"
33
#include "detect-engine-profile.h"
34

35
#include "detect-engine-alert.h"
36
#include "detect-engine-siggroup.h"
37
#include "detect-engine-address.h"
38
#include "detect-engine-proto.h"
39
#include "detect-engine-port.h"
40
#include "detect-engine-mpm.h"
41
#include "detect-engine-iponly.h"
42
#include "detect-engine-threshold.h"
43
#include "detect-engine-prefilter.h"
44

45
#include "rust.h"
46

47
#include "detect-engine-payload.h"
48
#include "detect-engine-dcepayload.h"
49
#include "detect-dns-name.h"
50
#include "detect-dns-response.h"
51
#include "detect-tls-sni.h"
52
#include "detect-tls-certs.h"
53
#include "detect-tls-cert-fingerprint.h"
54
#include "detect-tls-cert-issuer.h"
55
#include "detect-tls-cert-subject.h"
56
#include "detect-tls-cert-serial.h"
57
#include "detect-tls-alpn.h"
58
#include "detect-tls-subjectaltname.h"
59
#include "detect-tls-random.h"
60
#include "detect-tls-ja3-hash.h"
61
#include "detect-tls-ja3-string.h"
62
#include "detect-tls-ja3s-hash.h"
63
#include "detect-tls-ja3s-string.h"
64
#include "detect-engine-state.h"
65
#include "detect-engine-analyzer.h"
66

67
#include "detect-http-cookie.h"
68
#include "detect-http-method.h"
69
#include "detect-http-ua.h"
70
#include "detect-http-host.h"
71

72
#include "detect-mark.h"
73
#include "detect-nfs-version.h"
74

75
#include "detect-engine-event.h"
76
#include "decode.h"
77

78
#include "detect-config.h"
79

80
#include "detect-smtp.h"
81

82
#include "detect-base64-decode.h"
83
#include "detect-base64-data.h"
84
#include "detect-ipaddr.h"
85
#include "detect-ipopts.h"
86
#include "detect-tcp-flags.h"
87
#include "detect-fragbits.h"
88
#include "detect-fragoffset.h"
89
#include "detect-gid.h"
90
#include "detect-tcp-ack.h"
91
#include "detect-tcp-seq.h"
92
#include "detect-content.h"
93
#include "detect-uricontent.h"
94
#include "detect-pcre.h"
95
#include "detect-depth.h"
96
#include "detect-nocase.h"
97
#include "detect-rawbytes.h"
98
#include "detect-bytetest.h"
99
#include "detect-bytemath.h"
100
#include "detect-bytejump.h"
101
#include "detect-sameip.h"
102
#include "detect-l3proto.h"
103
#include "detect-ipproto.h"
104
#include "detect-within.h"
105
#include "detect-distance.h"
106
#include "detect-offset.h"
107
#include "detect-sid.h"
108
#include "detect-prefilter.h"
109
#include "detect-priority.h"
110
#include "detect-classtype.h"
111
#include "detect-reference.h"
112
#include "detect-tag.h"
113
#include "detect-threshold.h"
114
#include "detect-metadata.h"
115
#include "detect-msg.h"
116
#include "detect-rev.h"
117
#include "detect-flow.h"
118
#include "detect-flow-age.h"
119
#include "detect-flow-pkts.h"
120
#include "detect-flow-elephant.h"
121
#include "detect-requires.h"
122
#include "detect-tcp-window.h"
123
#include "detect-tcp-wscale.h"
124
#include "detect-ftpbounce.h"
125
#include "detect-ftp-dynamic-port.h"
126
#include "detect-isdataat.h"
127
#include "detect-id.h"
128
#include "detect-rpc.h"
129
#include "detect-asn1.h"
130
#include "detect-filename.h"
131
#include "detect-filestore.h"
132
#include "detect-filemagic.h"
133
#include "detect-filemd5.h"
134
#include "detect-filesha1.h"
135
#include "detect-filesha256.h"
136
#include "detect-filesize.h"
137
#include "detect-dataset.h"
138
#include "detect-datarep.h"
139
#include "detect-dsize.h"
140
#include "detect-flowvar.h"
141
#include "detect-flowint.h"
142
#include "detect-pktvar.h"
143
#include "detect-noalert.h"
144
#include "detect-flowbits.h"
145
#include "detect-hostbits.h"
146
#include "detect-xbits.h"
147
#include "detect-csum.h"
148
#include "detect-stream_size.h"
149
#include "detect-engine-sigorder.h"
150
#include "detect-ttl.h"
151
#include "detect-fast-pattern.h"
152
#include "detect-itype.h"
153
#include "detect-icode.h"
154
#include "detect-icmp-id.h"
155
#include "detect-icmp-seq.h"
156
#include "detect-icmpv4hdr.h"
157
#include "detect-igmphdr.h"
158
#include "detect-igmp-type.h"
159
#include "detect-dce-iface.h"
160
#include "detect-dce-opnum.h"
161
#include "detect-dce-stub-data.h"
162
#include "detect-urilen.h"
163
#include "detect-bsize.h"
164
#include "detect-detection-filter.h"
165
#include "detect-http-client-body.h"
166
#include "detect-http-server-body.h"
167
#include "detect-http-header.h"
168
#include "detect-http-header-names.h"
169
#include "detect-http-headers.h"
170
#include "detect-http-raw-header.h"
171
#include "detect-http-uri.h"
172
#include "detect-http-protocol.h"
173
#include "detect-http-start.h"
174
#include "detect-http-stat-msg.h"
175
#include "detect-http-request-line.h"
176
#include "detect-http-response-line.h"
177
#include "detect-http2.h"
178
#include "detect-byte-extract.h"
179
#include "detect-file-data.h"
180
#include "detect-pkt-data.h"
181
#include "detect-replace.h"
182
#include "detect-tos.h"
183
#include "detect-app-layer-event.h"
184
#include "detect-app-layer-state.h"
185
#include "detect-lua.h"
186
#include "detect-iprep.h"
187
#include "detect-geoip.h"
188
#include "detect-app-layer-protocol.h"
189
#include "detect-template.h"
190
#include "detect-template2.h"
191
#include "detect-tcphdr.h"
192
#include "detect-tcpmss.h"
193
#include "detect-udphdr.h"
194
#include "detect-icmpv6hdr.h"
195
#include "detect-icmpv6-mtu.h"
196
#include "detect-ipv4hdr.h"
197
#include "detect-ipv6hdr.h"
198
#include "detect-krb5-cname.h"
199
#include "detect-krb5-errcode.h"
200
#include "detect-krb5-sname.h"
201
#include "detect-krb5-ticket-encryption.h"
202
#include "detect-sip-method.h"
203
#include "detect-sip-uri.h"
204
#include "detect-target.h"
205
#include "detect-ja4-hash.h"
206
#include "detect-ftp-command.h"
207
#include "detect-entropy.h"
208
#include "detect-ftp-command-data.h"
209
#include "detect-ftp-completion-code.h"
210
#include "detect-ftp-reply.h"
211
#include "detect-ftp-mode.h"
212
#include "detect-ftp-reply-received.h"
213

214
#include "detect-bypass.h"
215
#include "detect-ftpdata.h"
216
#include "detect-engine-content-inspection.h"
217

218
#include "detect-transform-pcrexform.h"
219
#include "detect-transform-luaxform.h"
220

221
#include "util-rule-vars.h"
222

223
#include "app-layer.h"
224
#include "app-layer-protos.h"
225
#include "app-layer-htp.h"
226
#include "app-layer-smtp.h"
227
#include "detect-frame.h"
228
#include "detect-tls.h"
229
#include "detect-tls-cert-validity.h"
230
#include "detect-tls-version.h"
231
#include "detect-http-stat-code.h"
232
#include "detect-ssl-version.h"
233
#include "detect-ssl-state.h"
234
#include "detect-modbus.h"
235
#include "detect-dnp3.h"
236
#include "detect-vlan.h"
237
#include "detect-email.h"
238

239
#include "action-globals.h"
240
#include "tm-threads.h"
241

242
#include "pkt-var.h"
243

244
#include "conf.h"
245
#include "conf-yaml-loader.h"
246

247
#include "stream-tcp.h"
248
#include "stream-tcp-inline.h"
249

250
#include "util-lua.h"
251
#include "util-var-name.h"
252
#include "util-classification-config.h"
253
#include "util-threshold-config.h"
254
#include "util-print.h"
255
#include "util-unittest.h"
256
#include "util-unittest-helper.h"
257
#include "util-debug.h"
258
#include "util-hashlist.h"
259
#include "util-privs.h"
260
#include "util-profiling.h"
261
#include "util-validate.h"
262
#include "util-optimize.h"
263
#include "util-path.h"
264
#include "util-mpm-ac.h"
265
#include "runmodes.h"
266

267
int DETECT_TBLSIZE = 0;
268
int DETECT_TBLSIZE_IDX = DETECT_TBLSIZE_STATIC;
269

270
static void PrintFeatureList(const SigTableElmt *e, char sep)
271
{
×
272
    const uint32_t flags = e->flags;
×
273

274
    int prev = 0;
×
275
    if (flags & SIGMATCH_NOOPT) {
×
276
        printf("No option");
×
277
        prev = 1;
×
278
    }
×
279
    if (flags & SIGMATCH_IPONLY_COMPAT) {
×
280
        if (prev == 1)
×
281
            printf("%c", sep);
×
282
        printf("compatible with IP only rule");
×
283
        prev = 1;
×
284
    }
×
285
    if (flags & SIGMATCH_DEONLY_COMPAT) {
×
286
        if (prev == 1)
×
287
            printf("%c", sep);
×
288
        printf("compatible with decoder event only rule");
×
289
        prev = 1;
×
290
    }
×
291
    if (flags & SIGMATCH_INFO_CONTENT_MODIFIER) {
×
292
        if (prev == 1)
×
293
            printf("%c", sep);
×
294
        printf("content modifier");
×
295
        prev = 1;
×
296
    }
×
297
    if (flags & SIGMATCH_INFO_STICKY_BUFFER) {
×
298
        if (prev == 1)
×
299
            printf("%c", sep);
×
300
        printf("sticky buffer");
×
301
        prev = 1;
×
302
    }
×
303
    if (flags & SIGMATCH_SUPPORT_FIREWALL) {
×
304
        if (prev == 1)
×
305
            printf("%c", sep);
×
306
        printf("supports firewall");
×
307
        prev = 1;
×
308
    }
×
309
    if (flags & SIGMATCH_INFO_MULTI_BUFFER) {
×
310
        if (prev == 1)
×
311
            printf("%c", sep);
×
312
        printf("multi buffer");
×
313
        prev = 1;
×
314
    }
×
315
    if (flags & (SIGMATCH_INFO_UINT8 | SIGMATCH_INFO_UINT16 | SIGMATCH_INFO_UINT32 |
×
316
                        SIGMATCH_INFO_UINT64)) {
×
317
        if (prev == 1)
×
318
            printf("%c", sep);
×
319
        if (flags & SIGMATCH_INFO_MULTI_UINT)
×
320
            printf("multi ");
×
321
        if (flags & SIGMATCH_INFO_ENUM_UINT)
×
322
            printf("enum ");
×
323
        if (flags & SIGMATCH_INFO_BITFLAGS_UINT)
×
324
            printf("bitflags ");
×
325
        if (flags & SIGMATCH_INFO_UINT8)
×
326
            printf("uint8");
×
327
        if (flags & SIGMATCH_INFO_UINT16)
×
328
            printf("uint16");
×
329
        if (flags & SIGMATCH_INFO_UINT32)
×
330
            printf("uint32");
×
331
        if (flags & SIGMATCH_INFO_UINT64)
×
332
            printf("uint64");
×
333
        prev = 1;
×
334
    } else {
×
335
        DEBUG_VALIDATE_BUG_ON(flags & (SIGMATCH_INFO_MULTI_UINT | SIGMATCH_INFO_ENUM_UINT |
×
336
                                              SIGMATCH_INFO_BITFLAGS_UINT));
×
337
    }
×
338
    if (e->Transform) {
×
339
        if (prev == 1)
×
340
            printf("%c", sep);
×
341
        printf("transform");
×
342
        prev = 1;
×
343
    }
×
344
    if (e->SupportsPrefilter) {
×
345
        if (prev == 1)
×
346
            printf("%c", sep);
×
347
        printf("prefilter");
×
348
        prev = 1;
×
349
    }
×
350
    if (prev == 0) {
×
351
        printf("none");
×
352
    }
×
353
}
×
354

355
static void SigMultilinePrint(size_t i, const char *prefix)
356
{
×
357
    if (sigmatch_table[i].desc) {
×
358
        printf("%sDescription: %s\n", prefix, sigmatch_table[i].desc);
×
359
    }
×
360
    printf("%sFeatures: ", prefix);
×
361
    PrintFeatureList(&sigmatch_table[i], ',');
×
362
    if (sigmatch_table[i].url) {
×
363
        printf("\n%sDocumentation: %s%s", prefix, GetDocURL(), sigmatch_table[i].url);
×
364
    }
×
365
    if (sigmatch_table[i].alternative) {
×
366
        printf("\n%sReplaced by: %s", prefix, sigmatch_table[sigmatch_table[i].alternative].name);
×
367
    }
×
368
    printf("\n");
×
369
}
×
370

371
/** \brief Check if a keyword exists. */
372
bool SCSigTableHasKeyword(const char *keyword)
373
{
815✔
374
    for (int i = 0; i < DETECT_TBLSIZE; i++) {
314,071✔
375
        const char *name = sigmatch_table[i].name;
313,781✔
376

377
        if (name == NULL || strlen(name) == 0) {
313,781✔
378
            continue;
26,985✔
379
        }
26,985✔
380

381
        if (strcmp(keyword, name) == 0) {
286,796✔
382
            return true;
525✔
383
        }
525✔
384
    }
286,796✔
385

386
    return false;
290✔
387
}
815✔
388

389
int SigTableList(const char *keyword)
UNCOV
390
{
×
UNCOV
391
    size_t size = DETECT_TBLSIZE;
×
UNCOV
392
    size_t i;
×
393

UNCOV
394
    if (keyword == NULL) {
×
UNCOV
395
        printf("=====Supported keywords=====\n");
×
UNCOV
396
        for (i = 0; i < size; i++) {
×
UNCOV
397
            const char *name = sigmatch_table[i].name;
×
UNCOV
398
            if (name != NULL && strlen(name) > 0) {
×
UNCOV
399
                if (name[0] == '_' || strcmp(name, "template") == 0)
×
UNCOV
400
                    continue;
×
401

UNCOV
402
                printf("- %s\n", name);
×
UNCOV
403
            }
×
UNCOV
404
        }
×
UNCOV
405
    } else if (strcmp("csv", keyword) == 0) {
×
406
        printf("name;description;app layer;features;documentation\n");
×
407
        for (i = 0; i < size; i++) {
×
408
            const char *name = sigmatch_table[i].name;
×
409
            if (name != NULL && strlen(name) > 0) {
×
410
                if (name[0] == '_' || strcmp(name, "template") == 0)
×
411
                    continue;
×
412

413
                printf("%s;", name);
×
414
                if (sigmatch_table[i].desc) {
×
415
                    printf("%s", sigmatch_table[i].desc);
×
416
                }
×
417
                /* Build feature */
418
                printf(";Unset;"); // this used to be alproto
×
419
                PrintFeatureList(&sigmatch_table[i], ':');
×
420
                printf(";");
×
421
                if (sigmatch_table[i].url) {
×
422
                    printf("%s%s", GetDocURL(), sigmatch_table[i].url);
×
423
                }
×
424
                printf(";");
×
425
                printf("\n");
×
426
            }
×
427
        }
×
428
    } else if (strcmp("all", keyword) == 0) {
×
429
        for (i = 0; i < size; i++) {
×
430
            const char *name = sigmatch_table[i].name;
×
431
            if (name != NULL && strlen(name) > 0) {
×
432
                if (name[0] == '_' || strcmp(name, "template") == 0)
×
433
                    continue;
×
434
                printf("%s:\n", sigmatch_table[i].name);
×
435
                SigMultilinePrint(i, "\t");
×
436
            }
×
437
        }
×
438
    } else {
×
439
        for (i = 0; i < size; i++) {
×
440
            if ((sigmatch_table[i].name != NULL) &&
×
441
                strcmp(sigmatch_table[i].name, keyword) == 0) {
×
442
                printf("= %s =\n", sigmatch_table[i].name);
×
443
                SigMultilinePrint(i, "");
×
444
                return TM_ECODE_DONE;
×
445
            }
×
446
        }
×
447
        printf("Non existing keyword\n");
×
448
        return TM_ECODE_FAILED;
×
449
    }
×
UNCOV
450
    return TM_ECODE_DONE;
×
UNCOV
451
}
×
452

453
static void DetectFileHandlerRegister(void)
454
{
3✔
455
    for (int i = 0; i < DETECT_TBLSIZE_STATIC; i++) {
705✔
456
        if (filehandler_table[i].name)
702✔
457
            DetectFileRegisterFileProtocols(&filehandler_table[i]);
12✔
458
    }
702✔
459
}
3✔
460

461
static void SigCleanCString(SigTableElmt *base)
UNCOV
462
{
×
UNCOV
463
    SCSigTableNamesElmt kw;
×
464
    // remove const for mut to release
UNCOV
465
    kw.name = (char *)base->name;
×
UNCOV
466
    kw.desc = (char *)base->desc;
×
UNCOV
467
    kw.url = (char *)base->url;
×
UNCOV
468
    SCDetectSigMatchNamesFree(&kw);
×
UNCOV
469
}
×
470

471
void SCDetectHelperKeywordSetCleanCString(uint16_t id)
472
{
220✔
473
    sigmatch_table[id].Cleanup = SigCleanCString;
220✔
474
}
220✔
475

476
void SigTableCleanup(void)
UNCOV
477
{
×
UNCOV
478
    if (sigmatch_table != NULL) {
×
UNCOV
479
        for (int i = 0; i < DETECT_TBLSIZE; i++) {
×
UNCOV
480
            if ((sigmatch_table[i].Cleanup) == NULL) {
×
UNCOV
481
                continue;
×
UNCOV
482
            }
×
UNCOV
483
            sigmatch_table[i].Cleanup(&sigmatch_table[i]);
×
UNCOV
484
        }
×
UNCOV
485
        SCFree(sigmatch_table);
×
UNCOV
486
        sigmatch_table = NULL;
×
UNCOV
487
        DETECT_TBLSIZE = 0;
×
UNCOV
488
    }
×
UNCOV
489
}
×
490

491
#define ARRAY_CAP_STEP 16
4✔
492
static void (**PreregisteredCallbacks)(void) = NULL;
493
static size_t preregistered_callbacks_nb = 0;
494
static size_t preregistered_callbacks_cap = 0;
495

496
// Plugins can preregister keywords with this function :
497
// When an app-layer plugin is loaded, it wants to register its keywords
498
// But the plugin is loaded before keywords can register
499
// The preregistration callbacks will later be called by SigTableSetup
500
int SCSigTablePreRegister(void (*KeywordsRegister)(void))
501
{
4✔
502
    if (preregistered_callbacks_nb == preregistered_callbacks_cap) {
4✔
503
        void *tmp = SCRealloc(PreregisteredCallbacks,
4✔
504
                sizeof(void *) * (preregistered_callbacks_cap + ARRAY_CAP_STEP));
4✔
505
        if (tmp == NULL) {
4✔
506
            return 1;
×
507
        }
×
508
        preregistered_callbacks_cap += ARRAY_CAP_STEP;
4✔
509
        PreregisteredCallbacks = tmp;
4✔
510
    }
4✔
511
    PreregisteredCallbacks[preregistered_callbacks_nb] = KeywordsRegister;
4✔
512
    preregistered_callbacks_nb++;
4✔
513
    return 0;
4✔
514
}
4✔
515

516
void SigTableInit(void)
517
{
3✔
518
    if (sigmatch_table == NULL) {
3✔
519
        DETECT_TBLSIZE = DETECT_TBLSIZE_STATIC + DETECT_TBLSIZE_STEP;
3✔
520
        sigmatch_table = SCCalloc(DETECT_TBLSIZE, sizeof(SigTableElmt));
3✔
521
        if (sigmatch_table == NULL) {
3✔
522
            DETECT_TBLSIZE = 0;
×
523
            FatalError("Could not allocate sigmatch_table");
×
524
        }
×
525
    }
3✔
526
}
3✔
527

528
void SigTableSetup(void)
529
{
3✔
530
    DetectRegisterAppLayerHookLists();
3✔
531

532
    DetectSidRegister();
3✔
533
    DetectPriorityRegister();
3✔
534
    DetectPrefilterRegister();
3✔
535
    DetectRevRegister();
3✔
536
    DetectClasstypeRegister();
3✔
537
    DetectReferenceRegister();
3✔
538
    DetectTagRegister();
3✔
539
    DetectThresholdRegister();
3✔
540
    DetectMetadataRegister();
3✔
541
    DetectMsgRegister();
3✔
542
    DetectAckRegister();
3✔
543
    DetectSeqRegister();
3✔
544
    DetectContentRegister();
3✔
545
    DetectUricontentRegister();
3✔
546

547
    /* NOTE: the order of these currently affects inspect
548
     * engine registration order and ultimately the order
549
     * of inspect engines in the rule. Which in turn affects
550
     * state keeping */
551
    DetectHttpUriRegister();
3✔
552
    DetectHttpRequestLineRegister();
3✔
553
    DetectHttpClientBodyRegister();
3✔
554
    DetectHttpResponseLineRegister();
3✔
555
    DetectHttpServerBodyRegister();
3✔
556
    DetectHttpHeaderRegister();
3✔
557
    DetectHttpRequestHeaderRegister();
3✔
558
    DetectHttpResponseHeaderRegister();
3✔
559
    DetectHttpHeaderNamesRegister();
3✔
560
    DetectHttpHeadersRegister();
3✔
561
    DetectHttpProtocolRegister();
3✔
562
    DetectHttpStartRegister();
3✔
563
    DetectHttpRawHeaderRegister();
3✔
564
    DetectHttpMethodRegister();
3✔
565
    DetectHttpCookieRegister();
3✔
566

567
    DetectFilenameRegister();
3✔
568
    DetectFilestoreRegister();
3✔
569
    DetectFilemagicRegister();
3✔
570
    DetectFileMd5Register();
3✔
571
    DetectFileSha1Register();
3✔
572
    DetectFileSha256Register();
3✔
573
    DetectFilesizeRegister();
3✔
574

575
    DetectHttpUARegister();
3✔
576
    DetectHttpHHRegister();
3✔
577

578
    DetectHttpStatMsgRegister();
3✔
579
    DetectHttpStatCodeRegister();
3✔
580
    DetectHttp2Register();
3✔
581

582
    DetectDnsNameRegister();
3✔
583
    DetectDnsResponseRegister();
3✔
584
    DetectModbusRegister();
3✔
585
    DetectDNP3Register();
3✔
586

587
    DetectTlsSniRegister();
3✔
588
    DetectTlsIssuerRegister();
3✔
589
    DetectTlsSubjectRegister();
3✔
590
    DetectTlsSerialRegister();
3✔
591
    DetectTlsFingerprintRegister();
3✔
592
    DetectTlsCertsRegister();
3✔
593
    DetectTlsCertChainLenRegister();
3✔
594
    DetectTlsSubjectAltNameRegister();
3✔
595
    DetectTlsAlpnRegister();
3✔
596
    DetectTlsRandomRegister();
3✔
597

598
    DetectTlsJa3HashRegister();
3✔
599
    DetectTlsJa3StringRegister();
3✔
600
    DetectTlsJa3SHashRegister();
3✔
601
    DetectTlsJa3SStringRegister();
3✔
602

603
    DetectAppLayerEventRegister();
3✔
604
    DetectAppLayerStateRegister();
3✔
605
    /* end of order dependent regs */
606

607
    DetectFrameRegister();
3✔
608

609
    DetectPcreRegister();
3✔
610
    DetectDepthRegister();
3✔
611
    DetectNocaseRegister();
3✔
612
    DetectRawbytesRegister();
3✔
613
    DetectBytetestRegister();
3✔
614
    DetectBytejumpRegister();
3✔
615
    DetectBytemathRegister();
3✔
616
    DetectEntropyRegister();
3✔
617
    DetectSameipRegister();
3✔
618
    DetectGeoipRegister();
3✔
619
    DetectL3ProtoRegister();
3✔
620
    DetectIPProtoRegister();
3✔
621
    DetectWithinRegister();
3✔
622
    DetectDistanceRegister();
3✔
623
    DetectOffsetRegister();
3✔
624
    DetectReplaceRegister();
3✔
625
    DetectFlowRegister();
3✔
626
    DetectFlowAgeRegister();
3✔
627
    DetectFlowPktsRegister();
3✔
628
    DetectFlowPktsToServerRegister();
3✔
629
    DetectFlowPktsToClientRegister();
3✔
630
    DetectFlowBytesRegister();
3✔
631
    DetectFlowBytesToServerRegister();
3✔
632
    DetectFlowBytesToClientRegister();
3✔
633
    DetectFlowElephantRegister();
3✔
634
    DetectRequiresRegister();
3✔
635
    DetectWindowRegister();
3✔
636
    DetectRpcRegister();
3✔
637
    DetectFtpbounceRegister();
3✔
638
    DetectFtpdataRegister();
3✔
639
    DetectFtpDynamicPortRegister();
3✔
640
    DetectIsdataatRegister();
3✔
641
    DetectIdRegister();
3✔
642
    DetectDsizeRegister();
3✔
643
    DetectDatasetRegister();
3✔
644
    DetectDatarepRegister();
3✔
645
    DetectFlowvarRegister();
3✔
646
    DetectFlowintRegister();
3✔
647
    DetectPktvarRegister();
3✔
648
    DetectNoalertRegister();
3✔
649
    DetectFlowbitsRegister();
3✔
650
    DetectHostbitsRegister();
3✔
651
    DetectXbitsRegister();
3✔
652
    DetectEngineEventRegister();
3✔
653
    DetectIpOptsRegister();
3✔
654
    DetectFlagsRegister();
3✔
655
    DetectFragBitsRegister();
3✔
656
    DetectFragOffsetRegister();
3✔
657
    DetectGidRegister();
3✔
658
    DetectMarkRegister();
3✔
659
    DetectCsumRegister();
3✔
660
    DetectStreamSizeRegister();
3✔
661
    DetectTtlRegister();
3✔
662
    DetectTosRegister();
3✔
663
    DetectFastPatternRegister();
3✔
664
    DetectITypeRegister();
3✔
665
    DetectICodeRegister();
3✔
666
    DetectIcmpIdRegister();
3✔
667
    DetectIcmpSeqRegister();
3✔
668
    DetectIcmpv4HdrRegister();
3✔
669
    DetectIGMPHdrRegister();
3✔
670
    DetectIGMPTypeRegister();
3✔
671
    DetectDceIfaceRegister();
3✔
672
    DetectDceOpnumRegister();
3✔
673
    DetectDceStubDataRegister();
3✔
674
    DetectTlsRegister();
3✔
675
    DetectTlsValidityRegister();
3✔
676
    DetectTlsVersionRegister();
3✔
677
    SCDetectNfsProcedureRegister();
3✔
678
    DetectNfsVersionRegister();
3✔
679
    DetectUrilenRegister();
3✔
680
    DetectBsizeRegister();
3✔
681
    DetectDetectionFilterRegister();
3✔
682
    DetectAsn1Register();
3✔
683
    DetectSslStateRegister();
3✔
684
    DetectSslVersionRegister();
3✔
685
    DetectByteExtractRegister();
3✔
686
    DetectFiledataRegister();
3✔
687
    DetectPktDataRegister();
3✔
688
    DetectLuaRegister();
3✔
689
    DetectIPRepRegister();
3✔
690
    DetectAppLayerProtocolRegister();
3✔
691
    DetectBase64DecodeRegister();
3✔
692
    DetectBase64DataRegister();
3✔
693
    DetectTemplateRegister();
3✔
694
    DetectTemplate2Register();
3✔
695
    DetectTcphdrRegister();
3✔
696
    DetectUdphdrRegister();
3✔
697
    DetectTcpmssRegister();
3✔
698
    DetectTcpWscaleRegister();
3✔
699
    DetectICMPv6hdrRegister();
3✔
700
    DetectICMPv6mtuRegister();
3✔
701
    DetectIPAddrBufferRegister();
3✔
702
    DetectIpv4hdrRegister();
3✔
703
    DetectIpv6hdrRegister();
3✔
704
    DetectKrb5CNameRegister();
3✔
705
    DetectKrb5ErrCodeRegister();
3✔
706
    SCDetectKrb5MsgTypeRegister();
3✔
707
    DetectKrb5SNameRegister();
3✔
708
    DetectKrb5TicketEncryptionRegister();
3✔
709
    DetectSipMethodRegister();
3✔
710
    DetectSipUriRegister();
3✔
711
    DetectTargetRegister();
3✔
712
    DetectJa4HashRegister();
3✔
713
    DetectFtpCommandRegister();
3✔
714
    DetectFtpCommandDataRegister();
3✔
715
    DetectFtpCompletionCodeRegister();
3✔
716
    DetectFtpReplyRegister();
3✔
717
    DetectFtpModeRegister();
3✔
718
    DetectFtpReplyReceivedRegister();
3✔
719

720
    DetectBypassRegister();
3✔
721
    DetectConfigRegister();
3✔
722

723
    DetectTransformCompressWhitespaceRegister();
3✔
724
    DetectTransformStripWhitespaceRegister();
3✔
725
    DetectTransformStripPseudoHeadersRegister();
3✔
726
    DetectTransformMd5Register();
3✔
727
    DetectTransformSha1Register();
3✔
728
    DetectTransformSha256Register();
3✔
729
    DetectTransformDotPrefixRegister();
3✔
730
    DetectTransformPcrexformRegister();
3✔
731
    DetectTransformUrlDecodeRegister();
3✔
732
    DetectTransformXorRegister();
3✔
733
    DetectTransformToLowerRegister();
3✔
734
    DetectTransformToUpperRegister();
3✔
735
    DetectTransformHeaderLowercaseRegister();
3✔
736
    DetectTransformFromBase64DecodeRegister();
3✔
737
    SCDetectTransformDomainRegister();
3✔
738
    DetectTransformLuaxformRegister();
3✔
739
    DetectTransformGunzipRegister();
3✔
740
    DetectTransformZlibDeflateRegister();
3✔
741

742
    DetectFileHandlerRegister();
3✔
743

744
    DetectVlanIdRegister();
3✔
745
    DetectVlanLayersRegister();
3✔
746

747
    DetectEmailRegister();
3✔
748

749
    SCDetectSMTPRegister();
3✔
750
    SCDetectDHCPRegister();
3✔
751
    SCDetectWebsocketRegister();
3✔
752
    SCDetectEnipRegister();
3✔
753
    SCDetectMqttRegister();
3✔
754
    SCDetectRfbRegister();
3✔
755
    SCDetectSipRegister();
3✔
756
    SCDetectTemplateRegister();
3✔
757
    SCDetectLdapRegister();
3✔
758
    SCDetectSdpRegister();
3✔
759
    SCDetectDNSRegister();
3✔
760
    SCDetectPgsqlRegister();
3✔
761
    SCDetectSshRegister();
3✔
762
    SCDetectQuicRegister();
3✔
763
    SCDetectSmbRegister();
3✔
764
    SCDetectIkeRegister();
3✔
765

766
    for (size_t i = 0; i < preregistered_callbacks_nb; i++) {
6✔
767
        PreregisteredCallbacks[i]();
3✔
768
    }
3✔
769

770
    /* close keyword registration */
771
    DetectBufferTypeCloseRegistration();
3✔
772
}
3✔
773

774
#ifdef UNITTESTS
775
void SigTableRegisterTests(void)
776
{
777
    /* register the tests */
778
    for (int i = 0; i < DETECT_TBLSIZE; i++) {
779
        g_ut_modules++;
780
        if (sigmatch_table[i].RegisterTests != NULL) {
781
            sigmatch_table[i].RegisterTests();
782
            g_ut_covered++;
783
        } else {
784
            SCLogDebug("detection plugin %s has no unittest "
785
                   "registration function.", sigmatch_table[i].name);
786

787
            if (coverage_unittests)
788
                SCLogWarning("detection plugin %s has no unittest "
789
                             "registration function.",
790
                        sigmatch_table[i].name);
791
        }
792
    }
793
}
794
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc