Skip to content

[FEATURE REQUEST]: Implement Threat Analytics Dashboard and Backend Rate Limiting #172

Description

@Rashi-AI7

Problem

  1. Analytics: Currently, CyberShield scans URLs in real-time but doesn't keep a history. The README.md and dashboard.html propose a Threat Analytics Dashboard, but it is currently just a placeholder.
  2. Security: The backend server (server.js) does not currently throttle incoming requests, which could allow malicious actors to spam the /check endpoint and exhaust the Google Safe Browsing API quota.

Proposed Solution

  1. Threat Analytics Dashboard: Store scan results locally using localStorage for a demo version. Implement dashboard.js using Chart.js to render a "Safe vs. Threat" pie chart, a "Threat Types" bar chart, and populate a table showing recent scans.
  2. Backend Rate Limiting: Implement the express-rate-limit package (already in package.json) to configure a limiter (e.g., max 100 requests per 15 minutes) on the /check POST endpoint.

Why It's Needed

  • The dashboard fulfills a planned roadmap feature, giving users historical visibility into their scans and providing a more premium experience.
  • Rate limiting is an essential security practice to protect the backend infrastructure and API quotas.

Alternatives Considered

  • For analytics, a backend database was considered, but sticking to localStorage (as suggested in the README) keeps the demo lightweight.
  • For rate limiting, custom middleware could be written, but using the industry-standard express-rate-limit is safer and easier to maintain.

Additional Context

I am very interested in implementing these features. I am comfortable with both Chart.js for the frontend and express middleware for the backend. Please let me know if you would like me to work on this, and I would be happy to be assigned to the issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions