suricata
output-json-dns.c File Reference
#include "suricata-common.h"
#include "conf.h"
#include "threadvars.h"
#include "util-debug.h"
#include "util-mem.h"
#include "app-layer-parser.h"
#include "output.h"
#include "output-json.h"
#include "output-json-dns.h"
#include "rust.h"
Include dependency graph for output-json-dns.c:

Go to the source code of this file.

Data Structures

struct  LogDnsFileCtx_
 
struct  LogDnsLogThread_
 

Macros

#define QUERY   0
 
#define LOG_QUERIES   BIT_U64(0)
 
#define LOG_ANSWERS   BIT_U64(1)
 
#define LOG_A   BIT_U64(2)
 
#define LOG_NS   BIT_U64(3)
 
#define LOG_MD   BIT_U64(4)
 
#define LOG_MF   BIT_U64(5)
 
#define LOG_CNAME   BIT_U64(6)
 
#define LOG_SOA   BIT_U64(7)
 
#define LOG_MB   BIT_U64(8)
 
#define LOG_MG   BIT_U64(9)
 
#define LOG_MR   BIT_U64(10)
 
#define LOG_NULL   BIT_U64(11)
 
#define LOG_WKS   BIT_U64(12)
 
#define LOG_PTR   BIT_U64(13)
 
#define LOG_HINFO   BIT_U64(14)
 
#define LOG_MINFO   BIT_U64(15)
 
#define LOG_MX   BIT_U64(16)
 
#define LOG_TXT   BIT_U64(17)
 
#define LOG_RP   BIT_U64(18)
 
#define LOG_AFSDB   BIT_U64(19)
 
#define LOG_X25   BIT_U64(20)
 
#define LOG_ISDN   BIT_U64(21)
 
#define LOG_RT   BIT_U64(22)
 
#define LOG_NSAP   BIT_U64(23)
 
#define LOG_NSAPPTR   BIT_U64(24)
 
#define LOG_SIG   BIT_U64(25)
 
#define LOG_KEY   BIT_U64(26)
 
#define LOG_PX   BIT_U64(27)
 
#define LOG_GPOS   BIT_U64(28)
 
#define LOG_AAAA   BIT_U64(29)
 
#define LOG_LOC   BIT_U64(30)
 
#define LOG_NXT   BIT_U64(31)
 
#define LOG_SRV   BIT_U64(32)
 
#define LOG_ATMA   BIT_U64(33)
 
#define LOG_NAPTR   BIT_U64(34)
 
#define LOG_KX   BIT_U64(35)
 
#define LOG_CERT   BIT_U64(36)
 
#define LOG_A6   BIT_U64(37)
 
#define LOG_DNAME   BIT_U64(38)
 
#define LOG_OPT   BIT_U64(39)
 
#define LOG_APL   BIT_U64(40)
 
#define LOG_DS   BIT_U64(41)
 
#define LOG_SSHFP   BIT_U64(42)
 
#define LOG_IPSECKEY   BIT_U64(43)
 
#define LOG_RRSIG   BIT_U64(44)
 
#define LOG_NSEC   BIT_U64(45)
 
#define LOG_DNSKEY   BIT_U64(46)
 
#define LOG_DHCID   BIT_U64(47)
 
#define LOG_NSEC3   BIT_U64(48)
 
#define LOG_NSEC3PARAM   BIT_U64(49)
 
#define LOG_TLSA   BIT_U64(50)
 
#define LOG_HIP   BIT_U64(51)
 
#define LOG_CDS   BIT_U64(52)
 
#define LOG_CDNSKEY   BIT_U64(53)
 
#define LOG_SPF   BIT_U64(54)
 
#define LOG_TKEY   BIT_U64(55)
 
#define LOG_TSIG   BIT_U64(56)
 
#define LOG_MAILA   BIT_U64(57)
 
#define LOG_ANY   BIT_U64(58)
 
#define LOG_URI   BIT_U64(59)
 
#define LOG_FORMAT_GROUPED   BIT_U64(60)
 
#define LOG_FORMAT_DETAILED   BIT_U64(61)
 
#define LOG_HTTPS   BIT_U64(62)
 
#define LOG_FORMAT_ALL   (LOG_FORMAT_GROUPED|LOG_FORMAT_DETAILED)
 
#define LOG_ALL_RRTYPES   (~(uint64_t)(LOG_QUERIES|LOG_ANSWERS|LOG_FORMAT_DETAILED|LOG_FORMAT_GROUPED))
 
#define MODULE_NAME   "JsonDnsLog"
 

Typedefs

typedef struct LogDnsFileCtx_ LogDnsFileCtx
 
typedef struct LogDnsLogThread_ LogDnsLogThread
 

Enumerations

enum  DnsRRTypes {
  DNS_RRTYPE_A = 0, DNS_RRTYPE_NS, DNS_RRTYPE_MD, DNS_RRTYPE_MF,
  DNS_RRTYPE_CNAME, DNS_RRTYPE_SOA, DNS_RRTYPE_MB, DNS_RRTYPE_MG,
  DNS_RRTYPE_MR, DNS_RRTYPE_NULL, DNS_RRTYPE_WKS, DNS_RRTYPE_PTR,
  DNS_RRTYPE_HINFO, DNS_RRTYPE_MINFO, DNS_RRTYPE_MX, DNS_RRTYPE_TXT,
  DNS_RRTYPE_RP, DNS_RRTYPE_AFSDB, DNS_RRTYPE_X25, DNS_RRTYPE_ISDN,
  DNS_RRTYPE_RT, DNS_RRTYPE_NSAP, DNS_RRTYPE_NSAPPTR, DNS_RRTYPE_SIG,
  DNS_RRTYPE_KEY, DNS_RRTYPE_PX, DNS_RRTYPE_GPOS, DNS_RRTYPE_AAAA,
  DNS_RRTYPE_LOC, DNS_RRTYPE_NXT, DNS_RRTYPE_SRV, DNS_RRTYPE_ATMA,
  DNS_RRTYPE_NAPTR, DNS_RRTYPE_KX, DNS_RRTYPE_CERT, DNS_RRTYPE_A6,
  DNS_RRTYPE_DNAME, DNS_RRTYPE_OPT, DNS_RRTYPE_APL, DNS_RRTYPE_DS,
  DNS_RRTYPE_SSHFP, DNS_RRTYPE_IPSECKEY, DNS_RRTYPE_RRSIG, DNS_RRTYPE_NSEC,
  DNS_RRTYPE_DNSKEY, DNS_RRTYPE_DHCID, DNS_RRTYPE_NSEC3, DNS_RRTYPE_NSEC3PARAM,
  DNS_RRTYPE_TLSA, DNS_RRTYPE_HIP, DNS_RRTYPE_CDS, DNS_RRTYPE_CDNSKEY,
  DNS_RRTYPE_HTTPS, DNS_RRTYPE_SPF, DNS_RRTYPE_TKEY, DNS_RRTYPE_TSIG,
  DNS_RRTYPE_MAILA, DNS_RRTYPE_ANY, DNS_RRTYPE_URI, DNS_RRTYPE_MAX
}
 

Functions

bool AlertJsonDns (void *txptr, JsonBuilder *js)
 
void JsonDnsLogRegister (void)
 

Detailed Description

Author
Tom DeCanio td@np.nosp@m.ulse.nosp@m.tech..nosp@m.com

Implements JSON DNS logging portion of the engine.

Definition in file output-json-dns.c.

Macro Definition Documentation

◆ LOG_A

#define LOG_A   BIT_U64(2)

Definition at line 48 of file output-json-dns.c.

◆ LOG_A6

#define LOG_A6   BIT_U64(37)

Definition at line 83 of file output-json-dns.c.

◆ LOG_AAAA

#define LOG_AAAA   BIT_U64(29)

Definition at line 75 of file output-json-dns.c.

◆ LOG_AFSDB

#define LOG_AFSDB   BIT_U64(19)

Definition at line 65 of file output-json-dns.c.

◆ LOG_ALL_RRTYPES

#define LOG_ALL_RRTYPES   (~(uint64_t)(LOG_QUERIES|LOG_ANSWERS|LOG_FORMAT_DETAILED|LOG_FORMAT_GROUPED))

Definition at line 112 of file output-json-dns.c.

◆ LOG_ANSWERS

#define LOG_ANSWERS   BIT_U64(1)

Definition at line 46 of file output-json-dns.c.

◆ LOG_ANY

#define LOG_ANY   BIT_U64(58)

Definition at line 104 of file output-json-dns.c.

◆ LOG_APL

#define LOG_APL   BIT_U64(40)

Definition at line 86 of file output-json-dns.c.

◆ LOG_ATMA

#define LOG_ATMA   BIT_U64(33)

Definition at line 79 of file output-json-dns.c.

◆ LOG_CDNSKEY

#define LOG_CDNSKEY   BIT_U64(53)

Definition at line 99 of file output-json-dns.c.

◆ LOG_CDS

#define LOG_CDS   BIT_U64(52)

Definition at line 98 of file output-json-dns.c.

◆ LOG_CERT

#define LOG_CERT   BIT_U64(36)

Definition at line 82 of file output-json-dns.c.

◆ LOG_CNAME

#define LOG_CNAME   BIT_U64(6)

Definition at line 52 of file output-json-dns.c.

◆ LOG_DHCID

#define LOG_DHCID   BIT_U64(47)

Definition at line 93 of file output-json-dns.c.

◆ LOG_DNAME

#define LOG_DNAME   BIT_U64(38)

Definition at line 84 of file output-json-dns.c.

◆ LOG_DNSKEY

#define LOG_DNSKEY   BIT_U64(46)

Definition at line 92 of file output-json-dns.c.

◆ LOG_DS

#define LOG_DS   BIT_U64(41)

Definition at line 87 of file output-json-dns.c.

◆ LOG_FORMAT_ALL

#define LOG_FORMAT_ALL   (LOG_FORMAT_GROUPED|LOG_FORMAT_DETAILED)

Definition at line 111 of file output-json-dns.c.

◆ LOG_FORMAT_DETAILED

#define LOG_FORMAT_DETAILED   BIT_U64(61)

Definition at line 108 of file output-json-dns.c.

◆ LOG_FORMAT_GROUPED

#define LOG_FORMAT_GROUPED   BIT_U64(60)

Definition at line 107 of file output-json-dns.c.

◆ LOG_GPOS

#define LOG_GPOS   BIT_U64(28)

Definition at line 74 of file output-json-dns.c.

◆ LOG_HINFO

#define LOG_HINFO   BIT_U64(14)

Definition at line 60 of file output-json-dns.c.

◆ LOG_HIP

#define LOG_HIP   BIT_U64(51)

Definition at line 97 of file output-json-dns.c.

◆ LOG_HTTPS

#define LOG_HTTPS   BIT_U64(62)

Definition at line 109 of file output-json-dns.c.

◆ LOG_IPSECKEY

#define LOG_IPSECKEY   BIT_U64(43)

Definition at line 89 of file output-json-dns.c.

◆ LOG_ISDN

#define LOG_ISDN   BIT_U64(21)

Definition at line 67 of file output-json-dns.c.

◆ LOG_KEY

#define LOG_KEY   BIT_U64(26)

Definition at line 72 of file output-json-dns.c.

◆ LOG_KX

#define LOG_KX   BIT_U64(35)

Definition at line 81 of file output-json-dns.c.

◆ LOG_LOC

#define LOG_LOC   BIT_U64(30)

Definition at line 76 of file output-json-dns.c.

◆ LOG_MAILA

#define LOG_MAILA   BIT_U64(57)

Definition at line 103 of file output-json-dns.c.

◆ LOG_MB

#define LOG_MB   BIT_U64(8)

Definition at line 54 of file output-json-dns.c.

◆ LOG_MD

#define LOG_MD   BIT_U64(4)

Definition at line 50 of file output-json-dns.c.

◆ LOG_MF

#define LOG_MF   BIT_U64(5)

Definition at line 51 of file output-json-dns.c.

◆ LOG_MG

#define LOG_MG   BIT_U64(9)

Definition at line 55 of file output-json-dns.c.

◆ LOG_MINFO

#define LOG_MINFO   BIT_U64(15)

Definition at line 61 of file output-json-dns.c.

◆ LOG_MR

#define LOG_MR   BIT_U64(10)

Definition at line 56 of file output-json-dns.c.

◆ LOG_MX

#define LOG_MX   BIT_U64(16)

Definition at line 62 of file output-json-dns.c.

◆ LOG_NAPTR

#define LOG_NAPTR   BIT_U64(34)

Definition at line 80 of file output-json-dns.c.

◆ LOG_NS

#define LOG_NS   BIT_U64(3)

Definition at line 49 of file output-json-dns.c.

◆ LOG_NSAP

#define LOG_NSAP   BIT_U64(23)

Definition at line 69 of file output-json-dns.c.

◆ LOG_NSAPPTR

#define LOG_NSAPPTR   BIT_U64(24)

Definition at line 70 of file output-json-dns.c.

◆ LOG_NSEC

#define LOG_NSEC   BIT_U64(45)

Definition at line 91 of file output-json-dns.c.

◆ LOG_NSEC3

#define LOG_NSEC3   BIT_U64(48)

Definition at line 94 of file output-json-dns.c.

◆ LOG_NSEC3PARAM

#define LOG_NSEC3PARAM   BIT_U64(49)

Definition at line 95 of file output-json-dns.c.

◆ LOG_NULL

#define LOG_NULL   BIT_U64(11)

Definition at line 57 of file output-json-dns.c.

◆ LOG_NXT

#define LOG_NXT   BIT_U64(31)

Definition at line 77 of file output-json-dns.c.

◆ LOG_OPT

#define LOG_OPT   BIT_U64(39)

Definition at line 85 of file output-json-dns.c.

◆ LOG_PTR

#define LOG_PTR   BIT_U64(13)

Definition at line 59 of file output-json-dns.c.

◆ LOG_PX

#define LOG_PX   BIT_U64(27)

Definition at line 73 of file output-json-dns.c.

◆ LOG_QUERIES

#define LOG_QUERIES   BIT_U64(0)

Definition at line 45 of file output-json-dns.c.

◆ LOG_RP

#define LOG_RP   BIT_U64(18)

Definition at line 64 of file output-json-dns.c.

◆ LOG_RRSIG

#define LOG_RRSIG   BIT_U64(44)

Definition at line 90 of file output-json-dns.c.

◆ LOG_RT

#define LOG_RT   BIT_U64(22)

Definition at line 68 of file output-json-dns.c.

◆ LOG_SIG

#define LOG_SIG   BIT_U64(25)

Definition at line 71 of file output-json-dns.c.

◆ LOG_SOA

#define LOG_SOA   BIT_U64(7)

Definition at line 53 of file output-json-dns.c.

◆ LOG_SPF

#define LOG_SPF   BIT_U64(54)

Definition at line 100 of file output-json-dns.c.

◆ LOG_SRV

#define LOG_SRV   BIT_U64(32)

Definition at line 78 of file output-json-dns.c.

◆ LOG_SSHFP

#define LOG_SSHFP   BIT_U64(42)

Definition at line 88 of file output-json-dns.c.

◆ LOG_TKEY

#define LOG_TKEY   BIT_U64(55)

Definition at line 101 of file output-json-dns.c.

◆ LOG_TLSA

#define LOG_TLSA   BIT_U64(50)

Definition at line 96 of file output-json-dns.c.

◆ LOG_TSIG

#define LOG_TSIG   BIT_U64(56)

Definition at line 102 of file output-json-dns.c.

◆ LOG_TXT

#define LOG_TXT   BIT_U64(17)

Definition at line 63 of file output-json-dns.c.

◆ LOG_URI

#define LOG_URI   BIT_U64(59)

Definition at line 105 of file output-json-dns.c.

◆ LOG_WKS

#define LOG_WKS   BIT_U64(12)

Definition at line 58 of file output-json-dns.c.

◆ LOG_X25

#define LOG_X25   BIT_U64(20)

Definition at line 66 of file output-json-dns.c.

◆ MODULE_NAME

#define MODULE_NAME   "JsonDnsLog"

Definition at line 588 of file output-json-dns.c.

◆ QUERY

#define QUERY   0

Definition at line 43 of file output-json-dns.c.

Typedef Documentation

◆ LogDnsFileCtx

typedef struct LogDnsFileCtx_ LogDnsFileCtx

◆ LogDnsLogThread

Enumeration Type Documentation

◆ DnsRRTypes

enum DnsRRTypes
Enumerator
DNS_RRTYPE_A 
DNS_RRTYPE_NS 
DNS_RRTYPE_MD 
DNS_RRTYPE_MF 
DNS_RRTYPE_CNAME 
DNS_RRTYPE_SOA 
DNS_RRTYPE_MB 
DNS_RRTYPE_MG 
DNS_RRTYPE_MR 
DNS_RRTYPE_NULL 
DNS_RRTYPE_WKS 
DNS_RRTYPE_PTR 
DNS_RRTYPE_HINFO 
DNS_RRTYPE_MINFO 
DNS_RRTYPE_MX 
DNS_RRTYPE_TXT 
DNS_RRTYPE_RP 
DNS_RRTYPE_AFSDB 
DNS_RRTYPE_X25 
DNS_RRTYPE_ISDN 
DNS_RRTYPE_RT 
DNS_RRTYPE_NSAP 
DNS_RRTYPE_NSAPPTR 
DNS_RRTYPE_SIG 
DNS_RRTYPE_KEY 
DNS_RRTYPE_PX 
DNS_RRTYPE_GPOS 
DNS_RRTYPE_AAAA 
DNS_RRTYPE_LOC 
DNS_RRTYPE_NXT 
DNS_RRTYPE_SRV 
DNS_RRTYPE_ATMA 
DNS_RRTYPE_NAPTR 
DNS_RRTYPE_KX 
DNS_RRTYPE_CERT 
DNS_RRTYPE_A6 
DNS_RRTYPE_DNAME 
DNS_RRTYPE_OPT 
DNS_RRTYPE_APL 
DNS_RRTYPE_DS 
DNS_RRTYPE_SSHFP 
DNS_RRTYPE_IPSECKEY 
DNS_RRTYPE_RRSIG 
DNS_RRTYPE_NSEC 
DNS_RRTYPE_DNSKEY 
DNS_RRTYPE_DHCID 
DNS_RRTYPE_NSEC3 
DNS_RRTYPE_NSEC3PARAM 
DNS_RRTYPE_TLSA 
DNS_RRTYPE_HIP 
DNS_RRTYPE_CDS 
DNS_RRTYPE_CDNSKEY 
DNS_RRTYPE_HTTPS 
DNS_RRTYPE_SPF 
DNS_RRTYPE_TKEY 
DNS_RRTYPE_TSIG 
DNS_RRTYPE_MAILA 
DNS_RRTYPE_ANY 
DNS_RRTYPE_URI 
DNS_RRTYPE_MAX 

Definition at line 113 of file output-json-dns.c.

Function Documentation

◆ AlertJsonDns()

bool AlertJsonDns ( void *  txptr,
JsonBuilder *  js 
)

Definition at line 294 of file output-json-dns.c.

◆ JsonDnsLogRegister()

void JsonDnsLogRegister ( void  )

Definition at line 588 of file output-json-dns.c.

Referenced by OutputRegisterLoggers().

Here is the caller graph for this function:

Variable Documentation

◆ config_rrtype

const char* config_rrtype

Definition at line 177 of file output-json-dns.c.

◆ flags

uint64_t flags

Definition at line 178 of file output-json-dns.c.