Commit Graph

15710 Commits (d3354555afdf1bdd0e442a42d002c96b66f80115)
 

Author SHA1 Message Date
Juliana Fajardini d3354555af yaml/eve/stats: remove mention exception policy
The stats config for EVE logs have a comment about exception policy
stats counters. This went in with 72146b969c, but shouldn't have,
as there are no options there.
1 year ago
Philippe Antoine 2b4e10224e output/alert: check flag before logging app-layer
Ticket: 6846
1 year ago
Philippe Antoine 910f6af54f output: do not use tx id 0 when there is no tx
Ticket: 6846

This led to packet rules logging irrelevant app-layer data
1 year ago
Jeff Lucovsky d7026b7b11 detect/ipopts: Handle multiple ip options
Issue: 6864

Multiple IP options were not handled properly as the value being OR'd
into the packet's ip option variable were enum values instead of bit
values.
1 year ago
Jeff Lucovsky ee942391f7 detect/ipopts: Remove unneeded PCRE logic
Issue: 6864

Reduce complexity by eliminating the PCRE logic and adding a unittest to
validate null/empty string handling
1 year ago
Jeff Lucovsky c27dee7a9b detect/ipopt: Misc. cleanup
Minor changes to improve readability, remove extraneous include files.
1 year ago
Philippe Antoine 0291d37009 websocket: configurable logging of payload in alerts 1 year ago
Philippe Antoine 44b6aa5e4b app-layer: websockets protocol support
Ticket: 2695
1 year ago
Philippe Antoine 78b766048e protodetect: run expected probing parser
When there is a protocol change, and a specific protocol is
expected, like WebSeocket, always run it, no matter the port.
1 year ago
Philippe Antoine 155d671b26 protodetect: allows not port-based probing parsers
As for WebSocket which is detected only by protocol change.
1 year ago
Philippe Antoine 97d94b1067 protodetect: remove unused field
port is used in AppLayerProtoDetectProbingParserPort
and not in AppLayerProtoDetectProbingParserElement
1 year ago
Philippe Antoine f83ec543e3 http2: add settings from newer RFCs
Including the one for websocket over HTTP/2
1 year ago
Philippe Antoine 9075e58973 enip: register on default 44818/tcp port
if no config option is found,
as is done for udp

Ticket: 6304
1 year ago
Philippe Antoine 240e068b81 conf: avoid quadratic complexity
Ticket: 6878

Follow up on 15649424a7

When adding many sequence nodes, either from start or scalar event

We add "sequence nodes" whose name is an integer cf sequence_node_name
and then run ConfNodeLookupChild to see if it had been already set
(from the command line cf comment in the code)
And ConfNodeLookupChild iterates the whole linked list...

1. We add node 1
2. To add node 2, we check if node 1 equals this new node
3. To add node 3, we check if nodes 1, or 2 equals this new node's name
And so on...

This commits avoids these checks ig the list is empty at the beginning
1 year ago
Andreas Herz 1f9600e487 dataset: cleanup datasets that hit the memcap while loading
Datasets that hit the memcap limit need to be discarded if the memcap is
hit or otherwise the datasets are still loaded with partial data while
the signature is not loaded due to the memcap error.

Ticket: #6678
1 year ago
Victor Julien dc5b78ec71 decode/ppp: fix iplen check int handling
** CID 1596376:    (CONSTANT_EXPRESSION_RESULT)
/src/decode-ppp.c: 64 in DecodePPPCompressedProto()
/src/decode-ppp.c: 55 in DecodePPPCompressedProto()

________________________________________________________________________________________________________
*** CID 1596376:    (CONSTANT_EXPRESSION_RESULT)
/src/decode-ppp.c: 64 in DecodePPPCompressedProto()
58             case 0x57: { /* PPP_IPV6 */
59                 if (unlikely(len < (data_offset + IPV6_HEADER_LEN))) {
60                     ENGINE_SET_INVALID_EVENT(p, PPPIPV6_PKT_TOO_SMALL);
61                     return TM_ECODE_FAILED;
62                 }
63                 DEBUG_VALIDATE_BUG_ON(len < data_offset);
>>>     CID 1596376:    (CONSTANT_EXPRESSION_RESULT)
>>>     "65535 /* 32767 * 2 + 1 */ < (uint16_t)(len - data_offset)" is always false regardless of the values of its operands. This occurs as the logical first operand of "?:".
64                 uint16_t iplen = MIN(USHRT_MAX, (uint16_t)(len - data_offset));
65                 return DecodeIPV6(tv, dtv, p, pkt + data_offset, iplen);
66             }
67             case 0x2f: /* PPP_VJ_UCOMP */
68                 if (unlikely(len < (data_offset + IPV4_HEADER_LEN))) {
69                     ENGINE_SET_INVALID_EVENT(p, PPPVJU_PKT_TOO_SMALL);
/src/decode-ppp.c: 55 in DecodePPPCompressedProto()
49             case 0x21: { /* PPP_IP */
50                 if (unlikely(len < (data_offset + IPV4_HEADER_LEN))) {
51                     ENGINE_SET_INVALID_EVENT(p, PPPVJU_PKT_TOO_SMALL);
52                     return TM_ECODE_FAILED;
53                 }
54                 DEBUG_VALIDATE_BUG_ON(len < data_offset);
>>>     CID 1596376:    (CONSTANT_EXPRESSION_RESULT)
>>>     "65535 /* 32767 * 2 + 1 */ < (uint16_t)(len - data_offset)" is always false regardless of the values of its operands. This occurs as the logical first operand of "?:".
55                 uint16_t iplen = MIN(USHRT_MAX, (uint16_t)(len - data_offset));
56                 return DecodeIPV4(tv, dtv, p, pkt + data_offset, iplen);
57             }
58             case 0x57: { /* PPP_IPV6 */
59                 if (unlikely(len < (data_offset + IPV6_HEADER_LEN))) {
60                     ENGINE_SET_INVALID_EVENT(p, PPPIPV6_PKT_TOO_SMALL);
1 year ago
Juliana Fajardini ce1556cefd pgsql: check for eol when parsing response
It was brought to my attention by GLongo that Pgsql parser handled eof
diffrently for requests and responses, and apparently there isn't a good
reason for such a difference therefore, apply same logic used for
rs_pgsql_parse_request for checking for eof when parsing a response.
1 year ago
Juliana Fajardini 54ea6c5983 eve/alert: add missing pgsql metadata
Bug #6092
1 year ago
Sascha Steinbiss 120313f4da ja4: implement for TLS and QUIC
Ticket: OISF#6379
1 year ago
Sascha Steinbiss 9d0db71ebf ja3: make feature compile time configurable 1 year ago
Sascha Steinbiss 32f23b6d2f suricata: initialize feature tracking earlier
This gives app layer code a chance to access feature
information.
1 year ago
Jeff Lucovsky c305ed149c flow/inject: Select thread_id by flow flag
Issue: 6957

Rather than selecting the thread_id index by packets traveling to the
server, use the flow flags. If the flow has been reversed, the second
slot is represents the thread id to be used.
1 year ago
Victor Julien 516441b600 decode/ppp: add missing types definitions
Recognize PPP_CCP, PPP_CBCP and PPP_COMP_DGRAM.

Does not implement decoders for these record types, so these
are logged as unsupported types. Was "wrong_type" before.
1 year ago
Victor Julien 7e3f071e49 decode/ppp: clean up ppph pointer use
No users of the pointer anymore, so remove it.
1 year ago
Victor Julien 6067955afd decode/ppp: remove ppph check in favor of flag
As we now support variable size headers, we can't use the old pointer.

Replace with a flag.
1 year ago
Victor Julien 68092ff33c decode/ppp: support different header formats
Support compressed proto and optional HDLC header.

Bug: #6942.
1 year ago
Philippe Antoine bd3bed6c31 detect/analyzer: add more details for tcp_mss
Issue: #6355
1 year ago
Philippe Antoine 49caf005a4 detect/analyzer: create tojson function for generic integers
As will be needed for tcp.mss
1 year ago
Philippe Antoine 784ce30ae1 util: remove unused bloom filter code
Ticket: 4083
1 year ago
Philippe Antoine b113bdd9e3 src: remove unused headers-exported functions
+ remove double definition of IPPairLock

Ticket: #4083
1 year ago
Jeff Lucovsky 2dfa4cecb5 stats: Memcap pressure max relocation
This commit moves the memcap pressure/pressure_max stats from the global
stats namespace into the memcap namespace.

With per-thread stats, they will be within the flow-manager's values.

Issue: 6398
1 year ago
Jeff Lucovsky 7a5a1e2560 doc: Describe noalert keyword
Issue: 6685
1 year ago
Philippe Antoine 3643b6ed4b output: generic simple tx json logger
Ticket: 3827
1 year ago
Philippe Antoine 688efe79f0 output/dns: do not add empty app-layer metadata 1 year ago
Philippe Antoine 74aa80022c output/dnp3: restrict function scope to one file 1 year ago
Victor Julien 76322368ed pcap: support LINKTYPE_IPV6 (229)
This is just another variant of DLT_RAW.

Ticket: #6943.
1 year ago
Victor Julien 49c67b2bb1 defrag: fix wrong datalink being logged
Eve's packet_info.linktype should correctly indicated what the `packet`
field contains. Until now it was using DLT_RAW even if Ethernet or other
L2+ headers were present.

This commit records the datalink of the packet creating the first
fragment, which can include the L2+ header data.

Bug: #6887.
1 year ago
Juliana Fajardini 72146b969c eve/stats: allow hiding counters whose valued is 0
Some stats can be quite verbose if logging all zero valued-counters.
This allows users to disable logging such counters. Default is still
true, as that's the expected behavior for the engine.

Task #5976
1 year ago
Lukas Sismis 10590e6d94 dpdk: support 52 byte long key on ice (E810) cards 1 year ago
Lukas Sismis d4085fceb6 dpdk: enlarge key length to 52 bytes 1 year ago
Philippe Antoine 365a66ac1c ci: clean some disk space to run CIFuzz again 1 year ago
Jason Ish 1657b6ff3c cargo: add description and license
Required for publishing to crates.io.
1 year ago
Jason Ish b9127e8b96 automake/rust: remove path.lib
Remove the path.lib parameter that is substituted into the output
Cargo.toml by autoconf. Instead, as part of the build, "cd" into the
source directory. We already set the Rust target directory to the
external build directory.

This makes the Cargo.toml more generic, and in a format suitable for
publishing to crates.io. It also makes it easier to pull in external
crates without needing to patch up their Cargo.toml, for example, it
might make pulling libhtp-rs easier.
1 year ago
Victor Julien 172775ed84 alert/syslog: fetch ipproto once 1 year ago
Victor Julien 7ad1a6b21b alert/syslog: stringify addresses outside alert loop 1 year ago
Victor Julien 291250f705 alert/syslog: minor code cleanups 1 year ago
Victor Julien 285fda5de8 alert/syslog: only hold lock for syslog call 1 year ago
Juliana Fajardini 172b55c547 log/stats: allow longer counter names
With the addition of exception policy stats counters, the human readable
version of the sats log was mis-aligned, when counters for per-app-proto
were enabled.

Width change made large enough to accomodate a counter as long as
"app_layer.error.bittorrent-dht.exception_policy.pass_packet" which
could be valid.

Task #5816
1 year ago
Juliana Fajardini 0f6dbf650e yaml: minor wording fix on Suricata package version 1 year ago
Juliana Fajardini 8defee93b2 yaml: explicitly mention exception policy in conf
While our documentation indicated what were the possible configuration
settings for exception policies, our yaml only explicitly mentioned
exception policy for the master switch. Clearly indicate which config
settings are about exception policies.

Related to
Task #5816
1 year ago