Skip to content

codingstark-dev/tinyshield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TinyShield - Network Monitoring & Protection for macOS

A powerful network monitoring and protection application built with Tauri, Rust, and React. TinyShield provides real-time visibility into your Mac's network connections and allows you to block unwanted traffic at the application level.

πŸš€ Features

Core Monitoring

  • Real-time Network Monitoring: Track all TCP and UDP connections in real-time
  • Hostname Resolution: Automatically resolve IP addresses to human-readable domain names
  • Process Attribution: Identify which applications are making network connections
  • Traffic Statistics: Monitor data sent and received for each connection

Security & Blocking

  • Domain Blocking: Block specific websites and domains with wildcard support
  • Application Blocking: Prevent specific applications from accessing the internet
  • IP Address Filtering: Block connections to specific IP addresses or CIDR ranges
  • Port-based Rules: Control access based on destination ports
  • Flexible Rule Engine: Support for wildcards, regex patterns, and CIDR notation

User Interface

  • Modern macOS Interface: Native-feeling UI built with React and Tauri
  • Real-time Updates: Live connection monitoring without performance impact
  • Intuitive Rule Management: Easy-to-use interface for creating and managing block rules
  • Traffic Visualization: Charts and graphs showing network activity
  • Detailed Statistics: Comprehensive view of network usage by domain and application

Data Management

  • SQLite Database: Local storage for rules, logs, and statistics
  • Export/Import Rules: Backup and share your blocking configurations
  • Historical Data: Keep logs of past connections and blocked attempts
  • Data Cleanup: Automatic cleanup of old logs to save disk space

πŸ›  Technical Architecture

Backend (Rust)

  • Network Monitoring: Uses netstat and lsof for connection discovery
  • DNS Resolution: Async hostname resolution with caching
  • Rule Engine: Flexible pattern matching for blocking decisions
  • Database Layer: SQLite integration for persistent storage
  • Event System: Real-time communication between monitoring service and UI

Frontend (React)

  • TypeScript: Type-safe React components
  • Modern UI: Clean, responsive interface with dark/light mode support
  • Real-time Updates: WebSocket-like communication with backend via Tauri events
  • Data Visualization: Charts and graphs using Recharts
  • Icon System: Lucide React icons for consistent UI

Integration

  • Tauri Framework: Bridge between Rust backend and React frontend
  • Native macOS: Full access to system-level networking APIs
  • IPC Communication: Efficient inter-process communication
  • Event-driven Architecture: Reactive updates without polling

πŸ“‹ Prerequisites

  • macOS 15 or later
  • Rust (latest stable version)
  • Node.js 18+ or Bun
  • Xcode Command Line Tools

πŸš€ Installation & Development

Clone the Repository

git clone <repository-url>
cd tinyshield

Install Dependencies

Frontend dependencies:

bun install
# or
npm install

Backend dependencies will be automatically installed when building.

Development Mode

bun tauri dev
# or
npm run tauri dev

Build for Production

bun tauri build
# or
npm run tauri build

πŸ”§ Configuration

Network Monitoring Settings

  • Refresh Interval: How often to scan for new connections (default: 1000ms)
  • Protocol Monitoring: Enable/disable TCP and UDP monitoring
  • Hostname Resolution: Toggle DNS lookups for better performance
  • Logging: Control what gets logged to the database

Rule Types

Domain Rules

  • example.com - Block specific domain
  • *.example.com - Block domain and all subdomains
  • *.ads.* - Block domains containing "ads"

Application Rules

  • chrome - Block Chrome browser
  • *torrent* - Block any application with "torrent" in the name

IP Address Rules

  • 192.168.1.100 - Block specific IP
  • 192.168.1.0/24 - Block entire subnet
  • 10.*.*.* - Block private network range

Port Rules

  • 80 - Block HTTP traffic
  • 80-443 - Block port range
  • 80,443,8080 - Block specific ports

πŸ”’ Security Considerations

System Permissions

TinyShield requires elevated privileges to monitor network connections. The application:

  • Uses standard Unix tools (netstat, lsof) for network discovery
  • Does NOT intercept or modify actual network traffic in this version
  • Stores all data locally in SQLite database
  • Never sends data to external servers

Privacy

  • All monitoring data stays on your local machine
  • No telemetry or analytics are collected
  • Rules and logs are stored in local SQLite database
  • Export/import functions use local JSON files only

πŸ›£ Roadmap

Current Version (1.0)

  • βœ… Basic network monitoring
  • βœ… Rule-based filtering
  • βœ… SQLite storage
  • βœ… React UI
  • βœ… Real-time updates

Future Enhancements

  • macOS System Extension: True packet-level filtering
  • Advanced SNI Decryption: Extract hostnames from encrypted traffic
  • Network Extension Integration: System-level blocking
  • VPN Detection: Monitor VPN connections
  • Bandwidth Monitoring: Track data usage per application
  • Custom Block Pages: Show custom pages for blocked requests
  • Scheduling: Time-based rule activation
  • Parental Controls: Kid-safe browsing features
  • Network Profiles: Different rules for different network environments

🀝 Contributing

We welcome contributions! Please see our contributing guidelines for more information.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Areas for Contribution

  • System Extension Development: Help implement true system-level filtering
  • Performance Optimization: Improve monitoring efficiency
  • UI/UX Improvements: Enhance the user interface
  • Testing: Add comprehensive test coverage
  • Documentation: Improve docs and tutorials

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

⚠️ Disclaimer

TinyShield is a network monitoring tool designed for legitimate system administration and security purposes. Users are responsible for complying with all applicable laws and regulations when using this software. The authors are not responsible for any misuse of this tool.

πŸ†˜ Support

  • Issues: Report bugs and request features on GitHub Issues
  • Discussions: Join community discussions on GitHub Discussions
  • Documentation: Check the wiki for detailed guides and tutorials

πŸ™ Acknowledgments

  • Built with Tauri - The Rust-powered app framework
  • UI powered by React and Lucide Icons
  • Charts provided by Recharts
  • Inspired by tools like Little Snitch and LuLu for macOS

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors