Files
cve-dashboard/.kiro/specs/queue-hostname-ip-display/tasks.md

2.7 KiB

Implementation Plan: Queue Hostname & IP Display

Overview

Add hostname tracking to the Ivanti todo queue across database, backend API, and frontend display layers. All changes are additive and backward-compatible.

Tasks

  • 1. Create database migration to add hostname column

    • Create backend/migrations/add_todo_queue_hostname.js following the exact pattern of add_todo_queue_ip_address.js
    • Use ALTER TABLE ivanti_todo_queue ADD COLUMN hostname TEXT
    • Handle duplicate column name error for idempotency
    • Log appropriate messages for success and skip scenarios
    • Requirements: 1.1, 1.2, 1.3
  • 2. Update backend API endpoints to accept and store hostname

    • 2.1 Update POST / (single-item) endpoint in backend/routes/ivantiTodoQueue.js

      • Extract hostname from req.body
      • Sanitize: if present and a string, trim and slice to 255 chars; otherwise null
      • Add hostname to the INSERT column list and parameter array
      • Requirements: 2.1, 2.3
    • 2.2 Update POST /batch endpoint in backend/routes/ivantiTodoQueue.js

      • For each finding, extract hostname from f.hostname
      • Apply same sanitization as single-item (trim, slice to 255, or null)
      • Add hostname to the per-row INSERT column list and parameter array
      • Requirements: 2.2, 2.3
  • 3. Checkpoint

    • Ensure all backend changes are consistent, ask the user if questions arise.
  • 4. Update frontend to pass hostname and display it in the queue panel

    • 4.1 Update addToQueue function in ReportingPage.js

      • Add hostname: finding.hostName || null to the POST request body
      • Requirements: 3.1
    • 4.2 Update submitBatch function in ReportingPage.js

      • Add hostname: f.hostName || null to each finding object in the payload
      • Requirements: 3.2
    • 4.3 Update CARD section rendering in QueuePanel (ReportingPage.js)

      • Display hostname below finding_id (when present)
      • Display ip_address below hostname (when present)
      • Handle all combinations: both present, only hostname, only ip_address, neither
      • Use monospace styling at 0.68rem consistent with existing ip_address display
      • Requirements: 4.1, 4.2, 4.3, 4.4, 4.5
    • 4.4 Update vendor section (FP/Archer) rendering in QueuePanel (ReportingPage.js)

      • Display hostname below the CVE list (when present)
      • Display ip_address below hostname or below CVE list if no hostname
      • Handle all combinations: both present, only one, neither
      • Use monospace styling at 0.62rem / 0.68rem with muted colors matching existing design
      • Requirements: 5.1, 5.2, 5.3, 5.4
  • 5. Final checkpoint

    • Ensure all changes are wired together end-to-end, ask the user if questions arise.