Skip to content

Commit

Permalink
alerts: display quic sni if available
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonish committed Jun 25, 2024
1 parent 1cebe97 commit 4f8783d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/elastic/eventrepo/alerts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl ElasticEventRepo {
"timestamp",
// So we can display the SNI in the alert list.
"tls.sni",
"quic.sni",
// So we can display the query name in the alert list.
"dns.query",
])
Expand Down
3 changes: 3 additions & 0 deletions src/sqlite/eventrepo/alerts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl SqliteEventRepo {
.selectjs("alert.action")
.selectjs2("dns")
.selectjs2("tls")
.selectjs2("quic")
.selectjs("app_proto")
.selectjs("dest_ip")
.selectjs("src_ip")
Expand Down Expand Up @@ -173,6 +174,7 @@ impl SqliteEventRepo {
let host: Option<String> = row.try_get("host").unwrap_or(None);
let tls: serde_json::Value = row.try_get("tls").unwrap_or(serde_json::Value::Null);
let dns: serde_json::Value = row.try_get("dns").unwrap_or(serde_json::Value::Null);
let quic: serde_json::Value = row.try_get("quic").unwrap_or(serde_json::Value::Null);

if let Some(host) = host {
sensors.insert(host);
Expand All @@ -192,6 +194,7 @@ impl SqliteEventRepo {
},
"tls": tls,
"dns": dns,
"quic": quic,
});

let key = format!("{alert_signature_id}{src_ip}{dest_ip}");
Expand Down
5 changes: 5 additions & 0 deletions webapp/src/Alerts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,11 @@ export function AlertDescription(props: { event: EventWrapper }) {
{props.event._source.tls!.sni}
</span>
</Show>
<Show when={props.event._source.quic?.sni}>
<span class="badge text-bg-secondary me-2">
{props.event._source.quic!.sni}
</span>
</Show>
<Show when={props.event._source.dns?.query}>
<span class="badge text-bg-secondary me-2">
{props.event._source.dns?.query![0].rrname}
Expand Down

0 comments on commit 4f8783d

Please sign in to comment.