suricata
detect-krb5-sname.c
Go to the documentation of this file.
1/* Copyright (C) 2018-2022 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 Pierre Chifflier <chifflier@wzdftpd.net>
22 */
23
24#include "suricata-common.h"
25#include "util-unittest.h"
26
27#include "detect-parse.h"
28#include "detect-engine.h"
30#include "detect-engine-mpm.h"
31#include "detect-engine-state.h"
34
35#include "detect-krb5-sname.h"
36
37#include "rust.h"
38#include "util-profiling.h"
39
40static int g_krb5_sname_buffer_id = 0;
41
42static int DetectKrb5SNameSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
43{
44 if (SCDetectBufferSetActiveList(de_ctx, s, g_krb5_sname_buffer_id) < 0)
45 return -1;
46
48 return -1;
49
50 return 0;
51}
52
54{
57 sigmatch_table[DETECT_KRB5_SNAME].url = "/rules/kerberos-keywords.html#krb5-sname";
58 sigmatch_table[DETECT_KRB5_SNAME].Setup = DetectKrb5SNameSetup;
60 sigmatch_table[DETECT_KRB5_SNAME].desc = "sticky buffer to match on Kerberos 5 server name";
61
63 "krb5_sname", ALPROTO_KRB5, SIG_FLAG_TOCLIENT, 1, SCKrb5TxGetSname, 2);
64
66 "Kerberos 5 ticket server name");
67
68 g_krb5_sname_buffer_id = DetectBufferTypeGetByName("krb5_sname");
69
71}
@ ALPROTO_KRB5
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
@ DETECT_KRB5_SNAME
Data structures and function prototypes for keeping state for the detection engine.
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
void DetectBufferTypeSupportsMultiInstance(const char *name)
void DetectAppLayerMultiRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectionMultiBufferGetDataPtr GetData, int priority)
int DetectBufferTypeGetByName(const char *name)
void DetectKrb5SNameRegister(void)
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
SigTableElmt * sigmatch_table
#define SIGMATCH_NOOPT
Definition detect.h:1651
#define SIG_FLAG_TOCLIENT
Definition detect.h:272
#define SIGMATCH_INFO_STICKY_BUFFER
Definition detect.h:1676
DetectEngineCtx * de_ctx
main detection engine ctx
Definition detect.h:932
const char * url
Definition detect.h:1462
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition detect.h:1441
uint16_t flags
Definition detect.h:1450
const char * desc
Definition detect.h:1461
const char * alias
Definition detect.h:1460
const char * name
Definition detect.h:1459
Signature container.
Definition detect.h:668