USB Sentinel - Advanced USB Security System

Description
USB Sentinel — Advanced USB Security & Device Control System
USB Sentinel is a complete Windows-focused cybersecurity source-code project built with Python for monitoring, analyzing and controlling USB devices through a modern security-oriented desktop interface. The project combines USB device detection, security policies, threat analysis, quarantine workflows, administrator approval, role-based access control, monitoring, audit logging, PostgreSQL persistence, a FastAPI backend and an integrated AI assistant. It is designed for developers, cybersecurity students, researchers and organizations looking for a customizable foundation for USB device security and endpoint-control projects.
Key Features
USB Device Detection & Monitoring
- Real-time USB device monitoring
- Device insertion and removal detection
- VID/PID identification
- Serial and device information collection
- Device fingerprinting
- Windows PnP and USB telemetry
- Device status tracking
USB Security Workflow
- Zero-Trust inspired device handling
- Pending device approval
- Allow device for current session
- Block device for current session
- Permanent device blocking
- Device quarantine workflow
- Whitelist and blacklist management
- Administrator approval controls
- Global USB port-lock controls
###strong/strong###
- USB threat scoring
- Risk classification
- Suspicious device detection ###li/li###
- HID behavior analysis
- Suspicious enumeration detection
- Network-emulation indicators
- Security findings and recommended actions
USB Storage Scanner
- Suspicious file-type detection
- Autorun detection
- Executable and script-file checks
- Hidden-file analysis
- File entropy analysis
- Risk-score generation
- Optional Microsoft Defender integration
Authentication & Access Control
- Secure administrator authentication
- Password hashing
- Role-Based Access Control (RBAC)
- SUPER_ADMIN
- SECURITY_ANALYST
- OPERATOR
- STANDARD_USER
- Permission-based protected actions
- Session management
- Reauthentication controls
- Login protection
- OTP password recovery
Security Controls
- Safe Mode
- Panic Mode
- Global USB Lock
- Hardware security-token support
- Integrity verification
- Sensitive-action protection
- Rate limiting
- Session security
- Recovery mechanisms
Security Dashboard
- Real-time security overview
- USB device status
- Pending approval requests ###li/li###
- System metrics
- Security alerts
- Recent events
- Active sessions
- Driver status and diagnostics
User Management
- User administration
- Role assignment
- Permission management
- Session visibility
- Login history
- Access information
Logging & Monitoring
- Structured security logging
- Audit logging
- SIEM-oriented events
- USB event history
- Authentication history ###li/li###
- System telemetry
- Network monitoring
- Security event history
PostgreSQL Database The project includes a structured PostgreSQL database layer covering users, authentication, RBAC, USB devices, device registry, access requests, policies, USB history, threat assessments, threat intelligence, security alerts, SIEM events, telemetry, system metrics, AI observability, settings and support requests. A repository and service architecture separates database operations from business logic and the user interface. FastAPI Backend USB Sentinel includes a FastAPI backend providing protected REST endpoints for authentication, security data, logs, USB events, threat information, system metrics, system status and AI functionality. Authentication uses signed JWT access tokens and permission-based endpoint protection. Real-Time WebSocket Security Events The backend includes a protected WebSocket security stream. Authorized clients can receive historical and live security events through an in-process event bus without continuously polling the server. The WebSocket connection validates JWT authentication and RBAC permissions before streaming security events. Sentinel AI Assistant An integrated cybersecurity assistant is available directly from the application. The AI architecture includes:
- Google Gemini integration
- Application-specific system instructions
- Page-aware assistance
- Retrieval-Augmented Generation (RAG)
- Semantic documentation retrieval
- Gemini embeddings
- FAISS vector search
- Conversation memory
- Sensitive-data redaction
- AI safety filtering
- Structured responses
- AI observability and diagnostics
When online AI functionality is unavailable, USB Sentinel can use its local application documentation through a keyword-based retrieval fallback. No separate offline generative LLM is included. Windows Integration USB Sentinel uses Windows-specific security and device-management capabilities including:
- Windows PnP telemetry
- PowerShell device information
- WMI/CIM information
- SetupAPI telemetry
- Windows Registry integration
- pnputil-based user-mode enforcement
Some device-control operations require Administrator privileges. Experimental KMDF Driver Integration The source code also contains an experimental Windows KMDF driver integration layer, including a driver bridge, IOCTL-oriented communication architecture, health monitoring and fallback mechanisms. The kernel driver functionality is experimental and disabled by default. It is provided for development and research purposes and should not be considered production-ready without additional Windows driver validation, signing and controlled deployment testing.
User Interface
USB Sentinel includes a custom cybersecurity-inspired desktop interface with:
- Splash and initialization screens
- Authentication screens
- Security dashboard
- Device management
- Scan history
- Security controls
- User management
- Logs
- Settings
- Technical support
- Sentinel AI chat
- USB approval screens
- Security warnings
- Panic Mode and recovery interfaces
The interface supports both dark and light appearance modes.
Multilingual Interface
The project includes interface string packs for:
- English
- French
- Arabic
- Tamazight
Technologies
- Python
- Tkinter
- FastAPI
- Uvicorn
- PostgreSQL
- psycopg2
- Pydantic
- JWT
- bcrypt
- Google Gemini
- LangChain
- FAISS
- Google Generative AI Embeddings
- Requests
- psutil
- Cryptography
- PowerShell
- Windows PnP
- WMI/CIM
- SetupAPI
- pnputil
- Windows Registry
- WebSocket
- SMTP / OTP ###li/li###
- AsyncIO
Architecture
The project follows a modular architecture separating:
- Desktop UI
- Core security services
- Business services
- Repository/data-access layer
- USB telemetry
- USB security runtime
- Policy engine ###li/li###
- Scanner
- Quarantine
- Monitoring
- Event bus
- Backend API
- AI services
- PostgreSQL database
- Experimental driver integration
This structure makes the source code easier to understand, maintain, extend and customize.
Included Documentation
The source package includes detailed technical documentation covering:
- Project overview
- Installation
- Requirements
- Configuration
- Environment variables
- Application architecture
- Authentication
- RBAC
- USB telemetry
- USB security workflow ###li/li###
- Storage scanning
- Policy system
- PostgreSQL database
- Repository architecture
- FastAPI backend
- REST API
- WebSocket event streaming
- Sentinel AI
- Gemini integration
- RAG
- Local AI fallback
- Logging and monitoring
- Security controls
- Experimental driver architecture
- Customization
- Troubleshooting
- Developer reference
Customizable Source Code
The project is designed to be customized. Developers can modify the interface, branding, security policies, roles, permissions, scanner heuristics, threat rules, database structure, AI knowledge base and other application components according to their requirements.
Important Requirements
- Windows operating system
- Compatible Python environment
- PostgreSQL
- Administrator privileges for certain USB enforcement operations
- Internet connection and Gemini API configuration for online AI functionality
The Gemini integration is optional for the core USB security application. A local documentation retrieval fallback is available when online AI services are unavailable.
Important Notice
USB Sentinel is intended for legitimate defensive cybersecurity, administration, education, research and authorized security use. Some low-level Windows security functionality, particularly the included KMDF driver integration, is experimental and disabled by default. Actual hardware behavior may vary depending on Windows configuration, device drivers, permissions and connected USB hardware. The source code is provided for customization and further development.
Features
- Real-time USB device detection and monitoring
- USB insertion and removal tracking
- VID/PID, serial number and device fingerprint identification
- Zero-Trust inspired USB approval workflow
- Allow once, block once and permanent block actions
- Device quarantine and restricted-access workflow
- USB whitelist and blacklist management
- Configurable USB security policies
- USB storage scanning and suspicious-file detection
- Risk scoring and threat-level classification ###li/li###
- HID and suspicious-enumeration behavior analysis
- Network-emulation device indicators
- Optional Microsoft Defender-assisted scanning
- Secure administrator authentication
- OTP-based password recovery
- Role-Based Access Control (RBAC)
- SUPER_ADMIN, SECURITY_ANALYST, OPERATOR and STANDARD_USER roles
- Permission-based protected actions
- Session management and reauthentication controls
- Login protection and rate limiting
- Safe Mode and Panic Mode protection
- Global USB lock controls
- Optional hardware security-token support
- Application integrity verification
- Security dashboard with real-time operational information
- USB scan history and device history
- User and access management
- Structured audit logging
- SIEM-oriented security events
- System and network monitoring
- PostgreSQL database architecture
- Repository and service-layer architecture
- FastAPI REST backend
- JWT authentication
- Protected WebSocket security-event streaming
- Integrated Sentinel AI assistant
- Google Gemini integration
- Retrieval-Augmented Generation (RAG)
- Gemini embeddings and FAISS semantic search
- Page-aware AI assistance
- AI conversation memory
- Sensitive-data redaction and AI safety filtering
- Local documentation keyword fallback when Gemini is unavailable
- Dark and light interface modes
- English, French, Arabic and Tamazight interface strings
- Windows PnP, PowerShell, WMI/CIM and SetupAPI integration
- User-mode USB enforcement through Windows tools
- Experimental KMDF driver integration and driver bridge
- Detailed Markdown technical documentation
- Modular and customizable source code
Requirements
- Windows 10 or Windows 11 64-bit
- Python 3.12 or a compatible Python 3 environment
- PostgreSQL database server
- Python package manager (pip)
- Administrator privileges for USB enable/disable and other protected Windows device-control operations
- PowerShell available on the Windows system
- Windows Plug and Play / PnP services enabled
- Internet connection only when online Gemini AI functionality is required
- Google Gemini API key for online AI generation and semantic embedding features
- SMTP account/configuration if OTP email recovery is used
- Compatible Python packages listed in the project documentation
- Visual Studio and Windows Driver Kit are required only for developers who want to build or experiment with the included KMDF driver
- Driver signing/test-signing and an isolated Windows VM are strongly recommended for KMDF driver experimentation
- Basic knowledge of Python, PostgreSQL and Windows administration is recommended for customization
Instructions
- Download and extract the USB Sentinel source-code package to a local folder.
- Read the included documentation starting with
docs/00_INDEX.md. - Make sure Python and PostgreSQL are installed on the Windows computer.
- Create a Python virtual environment:
python -m venv .venv - Activate the virtual environment and install the required Python dependencies.
- Create a PostgreSQL database and configure the required database credentials.
- Execute the SQL files included in the
dbdirectory in numerical order to initialize the database schema, indexes, reference data and USB security workflow tables. - Copy the provided environment example file to
.env. - Configure the required environment variables, including database connection information.
- If online Sentinel AI functionality is required, add a valid Gemini API key to the environment configuration.
- If OTP email recovery is required, configure the SMTP settings.
- Keep the experimental KMDF driver disabled unless you are intentionally testing the driver in a controlled Windows development environment.
- Start the desktop application from the project root using:
python app.py
- Run the application with Administrator privileges when real Windows USB enable/disable operations are required.
- If the FastAPI backend and Sentinel AI are required, start the included backend service according to the backend instructions in the documentation.
- Create or authenticate with an administrator account.
- Connect a test USB device and verify that it appears in the device monitoring or pending-approval workflow.
- Use the dashboard to scan, review, allow or block devices according to your test environment.
- Review Scan History, Logs, Security Controls and User Management to confirm that database persistence and security events are working.
- Test Safe Mode, Panic Mode and other security controls only in a controlled environment.
- For customization, consult the included documentation covering architecture, database, USB telemetry, policies, threat scanning, AI/RAG, WebSocket, RBAC and UI customization.
Important: Some USB enforcement operations depend on Windows permissions, hardware, drivers and operating-system configuration. The KMDF driver integration included with the project is experimental and disabled by default.
| Author | charafsbai |
|---|---|
| Category | Scripts & Code / Python |
| Price | $205 |
| Extended License | $615 |
| Likes | 1 |
| First Release | Aug 15, 2026 |
| Last Update | Aug 15, 2026 |
| Files included | .py, .sql |
Categories
Tags
External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.
Products of the Week.
Submit🥇
Free LinkedIn Likes From Real Members | LinkedInLikes
Get free LinkedIn likes on your posts from real members who react by hand. No password needed: you only share a link.
Website · 12,847 views · 46 clicksWebsite · Week 49 · 12,847 views · 46 clicks
🥈
Free Medium Claps From Real Writers | MediumPlace
Free Medium claps on your stories from verified accounts of real writers, each given by hand. No bots, no Medium password, nothing to pay. Paste a link.
Website · 7,964 views · 10 clicksWebsite · Week 49 · 7,964 views · 10 clicks
🥉
Free GitHub Stars From Real Developers | GitWow
Get free GitHub stars on your repository from real developers who star by hand. No token or password, and it's free.
Website · 15,624 views · 28 clicksWebsite · Week 49 · 15,624 views · 28 clicks
#4
Free Substack Likes From Real Writers | StackRooms
Free Substack likes on your posts and Notes from verified accounts of real writers, given by hand. Free to ask, free to receive. Just share a link.
Website · 7,784 views · 2 clicksWebsite · Week 49 · 7,784 views · 2 clicks
#5
Free Twitter Likes From Real People | SupaTwitter
Free Twitter likes on your tweets from verified accounts of real people, each given by hand. No bots, no Twitter password, nothing to pay. Paste a link.
Website · 7,679 views · 4 clicksWebsite · Week 49 · 7,679 views · 4 clicks
#6
Free X Likes From Real People, Given by Hand | XFast
Free X likes on your posts from verified accounts of real people, each one given by hand. No bots, no X password, no conditions. Paste a link to start.
Website · 7,591 views · 0 clicksWebsite · Week 49 · 7,591 views · 0 clicks