Commit Graph

26 Commits (b4565004c7f7585e69e29d5e11b5d28bb66125fa)

Author SHA1 Message Date
Victor Julien 2eb941f9d9 output dns: fix bit declarations 9 years ago
Tom DeCanio 0f6c8806a0 output-json-dns: dns output filtering. 9 years ago
Victor Julien a8da6bbd71 output: use safer logic for fingerprint printing 9 years ago
Jason Ish 73a0451070 output-json-dns: allocate correct size hexstring buffer
The buffer allocated for the hexstring was not large enough
for a ':' separated hex string.
9 years ago
Jason Ish f397e7bfc2 dns: directional logging
Register loggers for to server and to client so requests
and responses can be logged independently of each other.

This results in the request log having the actual timestamp of
the request instead of the reply.
9 years ago
Victor Julien 1334859379 dns: add support for sshfp records
Update parser to process the records.

Update json output to log it.
9 years ago
maxtors 69863f7b1c Corrected and unified debugmessages for init data errors in *ThreadInit. 9 years ago
Victor Julien c446abeb47 jansson: include in suricata-common.h 10 years ago
Tom DeCanio 8f059b2841 output-json-dns: add logging of NS answer record content. 10 years ago
Victor Julien 8bb1cf08ef eve: fix mishandling of big messages
When the string representation of a JSON message grew bigger than
64k, the JSON record would just be truncated. This lead to errors
in the parser(s) of the JSON stream.

This patch changes the buffer logic to grow the buffer on demand.
10 years ago
Jason Ish b512580bbe logging: integrate rotation into SCConfLogOpenGeneric.
Addresses issue 1492, and will make it harder to omit
rotation on new outputs.
10 years ago
David Cannings 2918a75da1 Added support for full parsing of the rcode header in DNS answer
packets. Where rcode isn't "no error" this is displayed in both DNS and
JSON logs.

Note that this changes the current "No such domain" to "NXDOMAIN" in DNS
logs. This could be fixed if desired to maintain compatibility with
anybody crazy enough to parse the DNS log.

When the rcode is not "no error" (for example NXDOMAIN or SERVFAIL) it
is unlikely that there will be answer RRs. Therefore the rname from the
query is used.

Because the rcode applies to a whole answer packet (not individual
queries) it is impossible to determine which query RR caused the error.
Because of this most DNS servers currently reject multiple queries per
packet. Therefore each query RR is output instead with the relevant
error code, likely to be FORMERR if queries > 1.
10 years ago
Ken Steele 8f1d75039a Enforce function coding standard
Functions should be defined as:

int foo(void)
{
}

Rather than:
int food(void) {
}

All functions where changed by a script to match this standard.
11 years ago
Victor Julien de4e2221d8 eve: add tx_id to output for alerts and events
Add tx_id field for correlating alerts and events per tx.
11 years ago
Victor Julien 462f9de134 dns: unify type to string logging utility
Both DNS loggers had their own CreateTypeString. This patch unifies
them.
11 years ago
Victor Julien 5e87257845 dns: add names for common types
Add names for SRV, NAPTR, DS, RRSIG, NSEC, NSEC3 types.
11 years ago
Victor Julien bddb2c3bdc dns json: log TXT response data
Log TXT data in the rdata field.
11 years ago
Tom DeCanio 11ca25ddca eve-log: swap ip/port pairs in dns answers 11 years ago
Victor Julien 7ee3b456a3 dns-json: fix cleanup
Use specialized cleanup function for sub-module case. Freeing the
LogFileCtx is not the responsibility of a sub-module.
11 years ago
Victor Julien 4ce1fd347e json dns: fix tx logic
The JSON DNS logger would still have some conditions in the main
Logger function. This led to some transactions not beeing logged.
12 years ago
Victor Julien a3b0577a1f output: add TM_FLAG_LOGAPI_TM thread module flag
The TM_FLAG_LOGAPI_TM flag indicates that a module is run by the log
api, not by the 'regular' thread module call functions.

Set flag in all all Log API users' registration code.

Purpose of this flag is in profiling. In profiling output it will be
used to list log api thread modules separately.
12 years ago
Victor Julien 74fb60c010 Replace remaining SCStrndup calls
Replace them with BytesToString().
12 years ago
Eric Leblond 6fd9b4b255 json: add event_type key
This patch adds an event_type key to the generated events. Current
value is one of "dns", "alert, "file", "tls", "http", "drop". It is
then easy to differentiate in log analysis tools the events based on
source inside Suricata.
12 years ago
Eric Leblond 93a84180dc json dns: do not use array to output answer
Without this patch DNS answers for a single query are stored in a
single json event. The result is an array in the object like this one:
 {"type":"answer","id":45084,"rrname":"s-static.ak.facebook.com","rrtype":"CNAME","ttl":734},
 {"type":"answer","id":45084,"rrname":"s-static.ak.facebook.com.edgekey.net","rrtype":"CNAME","ttl":1710},
This type of output is not well supported in logstash. It is
displayed as it is written above and it is not possible to
query the fields.

I think the reason is that this is not logical if we consider search
query. For example if we search for "rrname" equal "s-static.ak.facebook.com"
we got one entry with two values in it. That's against the logic
of event. Furthermore, if we want to get a complete query, we can
used the id.

This patch splits the answer part in mulitple message. The result
is then accepted by logstash and fields can be queried easily.
12 years ago
Eric Leblond eab0b7fae9 json-dns: sync field names with draft rfc2629
This patch updates DNS field name to be in sync with RFC 2629:
 https://github.com/adulau/pdns-qof
This will allow to easily use Suricata with other passive DNS tools.
12 years ago
Victor Julien 6cecb4e4d2 json dns: rename output-dnslog -> output-json-dns 12 years ago