USB Port Access Controller for System Security (Python + Whitelisting) | Tour2Tech
Home / Projects / USB Port Access Controller
LIMITED OFFER
Get up to ₹1,000 OFF
Use coupon MYProject when you book via WhatsApp/Call. We don’t sell online.
Python • pyudev/pywinusb • psutil • SQLite • Flask/Tkinter

USB Port Access Controller — Whitelist, Block, and Alert in Real Time

Stop data leaks and malware via USB ports. Monitor devices live, whitelist by VID/PID, auto-block unauthorized storage, and keep an audit trail — all from a simple dashboard.

  • Hardware-ID whitelisting (Vendor ID / Product ID)
  • Background daemon/service with instant alerts
  • Cross-platform: Windows & Linux support
Delivery in 3–5 days • Pan-India support
*Demo video placeholder. Replace with your link.
1. Introduction

The USB Port Access Controller for System Security is a Python-based endpoint protection project that monitors and controls USB usage. It enables administrators to enable/disable ports, whitelist known devices by hardware IDs, and block unauthorized connections automatically. Continuous real-time monitoring and alerts harden systems against data theft, malware ingress, and tampering.

2. Existing System vs Proposed System
Existing System
  • Manual OS controls with limited policy depth.
  • No instant alerts for unauthorized insertions.
  • No automated whitelisting by hardware IDs.
Proposed System
  • Automated background monitoring & control.
  • Secure whitelisting via Vendor ID / Product ID.
  • Real-time block/eject of unknown storage.
  • Complete logs and optional email/desktop alerts.
3. Working
  1. Device Detection: Continuous scan of connected USB devices.
  2. Identification: Extract name, VID, and PID via pyudev/pywinusb/psutil.
  3. Verification: Compare against authorized whitelist in SQLite.
  4. Access Decision: Authorized → allow; Unauthorized → disable/eject device.
  5. Logging & Alerts: Record events and notify admin instantly.
  6. Policy Management: Add/remove devices; toggle monitoring & alerting.
4. Technology Stack
  • Language: Python
  • Libraries: psutil, pyudev (Linux), pywinusb (Windows), os, subprocess, sqlite3, smtplib
  • Database: SQLite3 for device whitelist, logs, settings
  • Interface: Flask web dashboard or Tkinter desktop GUI
  • Security: Hardware-ID whitelisting, password-protected admin, background service
5. Modules
Device Detection

Scan & enumerate USB devices.

  • Hotplug events
  • VID/PID parsing
Authentication

Whitelist matching.

  • Exact/partial match
  • Per-user policy*
Access Control

Allow/Block/Eject.

  • Windows PowerShell
  • Linux udev/udisks
Logging

Audit trails.

  • Timestamps & IDs
  • CSV/SQLite export
Alerts

Notify on violations.

  • Email via SMTP
  • Desktop toasts
Admin Dashboard

Policy & reports.

  • Add/remove whitelist
  • Start/stop monitor
*Optional based on institute requirements.
6. Advantages
  • Prevents data leakage via rogue USB storage.
  • Centralized control over all USB connections.
  • Lightweight background service with minimal overhead.
  • Works on Windows and Linux.
  • Customizable for enterprise/lab environments.
7. Applications
  • Corporate & government endpoints.
  • Education & research labs.
  • Banking/defence high-confidentiality systems.
  • Personal systems to block unknown drives.
  • Cybersecurity training & demos.
Python Integration Sketch (pyudev/pywinusb + SQLite + Alerts)
# Linux hotplug (pyudev)
import pyudev, sqlite3, smtplib, subprocess, psutil, time
ctx = pyudev.Context()
mon = pyudev.Monitor.from_netlink(ctx)
mon.filter_by('usb')

def allowed(vid, pid):
    cur = db.execute("SELECT 1 FROM whitelist WHERE vid=? AND pid=?", (vid, pid))
    return cur.fetchone() is not None

for dev in iter(lambda: mon.poll(timeout=3), None):
    if dev.action == 'add' and dev.get('ID_VENDOR_ID') and dev.get('ID_MODEL_ID'):
        vid, pid = dev['ID_VENDOR_ID'], dev['ID_MODEL_ID']
        if not allowed(vid, pid):
            log_event('BLOCK', vid, pid, dev.get('ID_MODEL'))
            # Attempt to unmount/eject if storage
            subprocess.run(['udisksctl','power-off','-b', dev.device_node], capture_output=True)
            send_alert(f"Blocked USB {vid}:{pid}")
        else:
            log_event('ALLOW', vid, pid, dev.get('ID_MODEL'))

# Windows (pywinusb/PowerShell)
# - Enumerate USB storage
# - If unauthorized: Disable via 'Set-StorageDeviceProperty' or registry policy, then alert.

# Dashboard (Flask/Tk)
# - List devices, add/remove whitelist (VID/PID), toggle monitor, export logs.
              
Delivery includes cross-platform monitors, whitelist DB schema, PowerShell/udev hooks, alert adapters (SMTP/toast), GUI dashboard, and report-ready docs.
What You Get
ItemIncludedNotes
Python Source Codepsutil, pyudev/pywinusb, subprocess
Whitelist & PoliciesSQLite schema + CRUD UI
Real-time Monitor/DaemonStart/stop from dashboard
Alerts & LoggingSMTP + desktop toasts, CSV/SQLite
Demo VideoSetup & working walkthrough
Report & PPTCollege-format templates
SupportInstallation + viva Q&A (1 month)

FAQs — USB Port Access Controller

You can allow power-only by blocking USB mass-storage and MTP while keeping power enabled. Policy is configurable.

HID devices can be whitelisted globally so input peripherals remain unaffected while storage is restricted.

We match Vendor ID and Product ID; optionally include serial number for stronger binding to a specific device.

Need a no-nonsense USB security project?

Get the USB Port Access Controller with code, demo, docs, and support.

WhatsApp Us Now
Shopping Cart
Scroll to Top
Open chat
Need help in Admission?
Hello! 👋 Welcome to Tour2Tech Academy!

We’re here to help you succeed in your engineering journey with:

🌟 Final Year Projects
🎯 College Admission Consultancy
📚 Career Guidance and Skill-Building Courses

How can we assist you today? Whether you need help with a project, are looking for career guidance, or want to know more about our services, we’re just a message away! 😊