Skip to content

Commit

Permalink
webapp/events: dns formatting for eve dns v3
Browse files Browse the repository at this point in the history
Part of #317.
  • Loading branch information
jasonish committed Jul 10, 2024
1 parent dd5ec88 commit 566842a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions webapp/src/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ export function formatEventDescription(event: Event): string {
case "dns": {
const dns = event._source.dns!;
let parts = [dns.type.toUpperCase()];
if (dns.rrtype) {
parts.push(dns.rrtype.toUpperCase());
}
if (dns.rrname) {

if (dns.queries[0]) {
parts.push(dns.queries[0].rrtype);
parts.push(dns.queries[0].rrname);
} else if (dns.rrname) {
parts.push(dns.rrtype);
parts.push(dns.rrname);
}

if (dns.rcode && dns.rcode !== "NOERROR") {
parts.push(...["-", dns.rcode]);
}
Expand Down
5 changes: 5 additions & 0 deletions webapp/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ export interface EveDns {
rrname: string;
}[];

queries: {
rrname: string;
rrtype: string;
}[];

answers?: {
rdata: string;
rrname: string;
Expand Down

0 comments on commit 566842a

Please sign in to comment.