Skip to content

Commit

Permalink
webapp: show dissection anomalies
Browse files Browse the repository at this point in the history
aiooss-anssi committed Jul 22, 2024
1 parent 3f6242d commit a4a9bfb
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions webapp/main.py
Original file line number Diff line number Diff line change
@@ -171,6 +171,14 @@ async def api_flow_get(request):
rows = await cursor.fetchall()
result["alert"] = [row_to_dict(f) for f in rows]

# Get associated anomalies
cursor = await eve_database.execute(
"SELECT extra_data FROM anomaly WHERE flow_id = ? ORDER BY id",
[flow_id],
)
rows = await cursor.fetchall()
result["anomaly"] = [row_to_dict(f) for f in rows]

return JSONResponse(result, headers={"Cache-Control": "max-age=86400"})


2 changes: 1 addition & 1 deletion webapp/static/js/flowdisplay.js
Original file line number Diff line number Diff line change
@@ -199,7 +199,7 @@ class FlowDisplay {
cardEl.classList.add('card', 'm-3', 'bg-body', 'font-monospace', 'border-warning')
const cardHeader = document.createElement('div')
cardHeader.classList.add('card-header')
cardHeader.textContent = `Anomaly! ${JSON.stringify(data)}`
cardHeader.textContent = `Dissection anomaly: ${JSON.stringify(data)}`
cardEl.appendChild(cardHeader)
alertsDiv.appendChild(cardEl)
})

0 comments on commit a4a9bfb

Please sign in to comment.