Commit Graph

11 Commits (7b8214302caa761aae13bc0b5c4614391af088e3)

Author SHA1 Message Date
Philippe Antoine 6291e220e4 dns: improved handling of corrupt additionals
Ticket: 7228

That means log the rest of queries and answers, even if the
final field additionals is corrupt.
Set an event in this case.
2 months ago
Jason Ish 19cf0f8133 dns: provide events for recoverable parse errors
Add events for the following resource name parsing issues:

- name truncated as its too long
- maximum number of labels reached
- infinite loop

Currently these events are only registered when encountered, but
recoverable. That is where we are able to return some of the name,
usually in a truncated state.

As name parsing has many code paths, we pass in a pointer to a flag
field that can be updated by the name parser, this is done in
addition to the flags being set on a specific name as when logging we
want to designate which fields are truncated, etc. But for alerts, we
just care that something happened during the parse. It also reduces
errors as it won't be forgotten to check for the flags and set the
event if some new parser is written that also parses names.

Ticket: #7280
3 months ago
Jason Ish 833c7c64be rules/dns: fix dns event names that have changed
- not_a_request to not_request
- not_a_response to not_reponse

Ticket: #7361
4 months ago
Jason Ish c98c49d4ba dns: parse and alert on invalid opcodes
Accept DNS messages with an invalid opcode that are otherwise
valid. Such DNS message will create a parser event.

This is a change of behavior, previously an invalid opcode would cause
the DNS message to not be detected or parsed as DNS.

Issue: #5444
2 years ago
Jason Ish ca5a3f0f04 dns: cleanup: remove unused events
Removed events that are no longer used since the Rust
implementation of DNS:
- UnsolicitedResponse
- StateMemCapReached
- Flooded
5 years ago
Andreas Herz 2aad2d605d rules: add missing classtypes for event.rules 8 years ago
Jason Ish b9ba792279 dns-events: fix direction of malformed events + typo 8 years ago
Victor Julien df10559d80 dns: fix message of decoder rule 2240008
The message now reflects that the rule matches on:
    app-layer-event:dns.state_memcap_reached;
11 years ago
Victor Julien 657b83d238 dns: add event for when memcap is reached
Raise event if state-memcap is reached for a flow.
11 years ago
Victor Julien 61cdd9be6b dns: detect case of request flooding
In the case where DNS requests are sent over the same flow w/o a
reply being received, we now set an event in the flow and refuse
to add more transactions to the state. This protects the DNS
handling from getting overloaded slowing down everything.

A new option to configure this behaviour was added:

app-layer:
  protocols:
    dnsudp:
       enabled: yes
       detection-ports:
         udp:
           toserver: 53
       request-flood: 750

The request-flood parameter can be 0 (disabling this feature) or a
positive integer. It defaults to 500.

This means that if 500 unreplied requests are seen in a row an event
is set. Rule 2240007 was added to dns-events.rules to match on this.
11 years ago
Victor Julien 6229bfab5e DNS: rename dns.rules to dns-events.rules, include it in yaml 12 years ago