Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ import {

const COLORS = ['#2563eb', '#16a34a', '#f59e0b', '#dc2626']

const ATTACK_TACTICS = [
'initial-access',
'execution',
'persistence',
'privilege-escalation',
'defense-evasion',
'credential-access',
'discovery',
'lateral-movement',
'collection',
'exfiltration'
]

export default function HomePage() {
const [dashboard, setDashboard] = useState(null)

Expand All @@ -40,6 +53,15 @@ export default function HomePage() {
? Object.entries(dashboard.maturity).map(([name, value]) => ({ name, value }))
: []

const tacticData = dashboard?.status || {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use tactic counts for the heatmap

The heatmap is keyed by ATT&CK tactic names, but this line feeds it dashboard.status; /dashboard currently returns statuses such as experimental, testing, and stable (see detlab/api.py), so every tacticData[tactic] lookup falls back to 0 for normal detections. As a result the new heatmap always renders empty coverage until the endpoint exposes the existing analytics tactics counts and the client reads that field instead.

Useful? React with 👍 / 👎.


function tacticColor(value) {
if (value >= 10) return '#dc2626'
if (value >= 5) return '#f59e0b'
if (value >= 1) return '#16a34a'
return '#334155'
}

return (
<main
style={{
Expand Down Expand Up @@ -125,6 +147,45 @@ export default function HomePage() {
</ResponsiveContainer>
</div>
</div>

<div
style={{
marginTop: '3rem',
background: '#1e293b',
padding: '1.5rem',
borderRadius: '12px'
}}
>
<h2>ATT&CK Coverage Heatmap</h2>

<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(5, 1fr)',
gap: '1rem',
marginTop: '1.5rem'
}}
>
{ATTACK_TACTICS.map((tactic) => {
const value = tacticData[tactic] || 0

return (
<div
key={tactic}
style={{
background: tacticColor(value),
padding: '1rem',
borderRadius: '10px',
minHeight: '90px'
}}
>
<h3 style={{ fontSize: '0.95rem' }}>{tactic}</h3>
<p style={{ fontSize: '2rem', marginTop: '0.5rem' }}>{value}</p>
</div>
)
})}
</div>
</div>
</main>
)
}
Loading