Cross‑platform Go agent/service that:
- Collects comprehensive OS‑level metrics (CPU, memory, disk, network)
- Gathers detailed agent information (serial number, battery condition, local users, OSQuery version)
- Sends agent updates to Supabase (configurable intervals)
- Checks for updates once per day from GitHub Releases and self‑updates
- Runs as a service on Windows, Linux (systemd), and macOS (launchd)
- CPU: Model name, cores, usage percentage
- Memory: Total, used, free, usage percentage
- Disk: Total, used, free space
- Network: Interface statistics and IP addresses
- Device Serial Number: Cross-platform hardware identification
- Battery Condition: Real-time battery status and charge level
- Local User Accounts: Human user accounts (excludes system accounts)
- OSQuery Version: Detection of installed OSQuery version
- Disk Encryption: Cross-platform disk encryption status detection
- System Information: Hostname, OS, platform, architecture, uptime
- Linux:
/sys/class/dmi/id/,/etc/machine-id,/sys/class/power_supply/,/etc/passwd - macOS:
system_profiler,pmset,dsclcommands - Windows:
wmiccommands for hardware and user information
- Download the binary for your OS from GitHub Releases.
- Follow the OS‑specific installation guide in the
doc/folder:
# Build for current platform only
make build
# Or build all platforms
make release# Build with specific version
make release VERSION=v1.0.0
# Build using git tag (auto-detected)
make release
# Create GitHub release (requires gh CLI)
./scripts/release.sh --release --version v1.0.0- Copy environment template:
cp .env.example .env- Edit .env file with your Supabase credentials:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-supabase-anon-key
API_TOKEN=your-api-tokenThe Supabase credentials are loaded from environment variables at runtime instead of being embedded in the binary.
The agent requires Supabase credentials to be set via environment variables. You can optionally override defaults like software sync interval or GitHub repo:
- Create a
.envfile in the same directory as the binary or set system environment variables:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-supabase-anon-key
API_TOKEN=your-api-token- Windows:
C:\ProgramData\sentinelgo\config.json - Linux:
/etc/sentinelgo/config.json - macOS:
/etc/sentinelgo/config.json
Example:
{
"update_interval": "5m0s",
"github_owner": "habib45",
"github_repo": "SentinelGo",
"current_version": "v2.0.8",
"auto_update": false,
"software_sync_enabled": true
}update_interval: How often to sync software information (supports "5m0s" format or seconds)github_owner: GitHub repository owner for updatesgithub_repo: GitHub repository name for updatescurrent_version: Current agent versionauto_update: Enable automatic updates (default: false)software_sync_enabled: Enable software synchronization (default: true)
./sentinelgo -install # Install as a service (requires admin/root)
./sentinelgo -uninstall # Uninstall the service
./sentinelgo -run # Run in foreground (console mode)
./sentinelgo -config <path> # Use custom config fileThe agent updates its information in the agents table:
{
"serial_number": "44069f5e9a494441b9e1c2c864bd820e",
"osquery_version": "not installed",
"battery_condition": "Charging (98%)",
"local_users": ["bs01463", "bs-support", "sbt", "sentinelgo"],
"disk_encryption": "yes",
"last_restart": 384732
}Local Users Storage: The local_users field is stored as a JSON array in the database, containing only human user account names (system accounts are filtered out).
The agent requires these tables in your Supabase database:
- Every 24 hours, the agent queries GitHub Releases for the latest tag.
- If newer, it downloads the matching asset for the current OS/arch.
- It replaces the running binary and restarts.
- On Windows, a batch script handles the replace-after-exit.
The agent includes comprehensive tests for all agent information collection features:
# Run all tests
go test ./tests/ -v
# Run benchmarks
go test ./tests/ -bench=. -benchmem
# Run specific test
go test ./tests/ -run TestGetLocalUsers -v
# Test agent information collection
go test ./tests/ -run TestSystemInfoCollection -v- ✅ Local Users Collection: Detects and validates user accounts
- ✅ Serial Number Collection: Cross-platform hardware identification
- ✅ Battery Condition: Real-time battery status monitoring
- ✅ OSQuery Detection: Version detection and validation
- ✅ System Information: Complete system metrics collection
- ✅ Performance Benchmarks: Memory and timing analysis
make build # Build for current platform
make release # Build all platforms
make test # Run tests
make clean # Clean build artifacts
make deps # Download dependenciestests/agent_info_test.go: Unit tests for agent information collectiontests/benchmark_test.go: Performance benchmarks- Tests validate cross-platform compatibility and data accuracy
- Tag the release:
git tag v1.0.0
git push origin v1.0.0-
Automatic Release (GitHub Actions will trigger):
- Runs tests
- Builds all platforms
- Creates GitHub release with assets
-
Manual Release (alternative):
./scripts/release.sh --release --version v1.0.0- Versions are injected at build time via ldflags
- Use semantic versioning (v1.0.0, v1.0.1, etc.)
- Git tags are automatically detected for versioning
The agent collects the following information for device management and monitoring:
- Hardware Details: CPU model, memory, disk space, network interfaces
- Operating System: OS name, version, architecture, uptime
- Network Information: Private and public IP addresses
- Device Serial Number: Hardware identifier for device tracking
- Battery Condition: Battery status and charge level (laptops/devices with battery)
- Local User Accounts: Human user account names (excludes system accounts)
- OSQuery Version: Detection of security tool installation
- User Privacy: Local user accounts collection excludes system accounts and only captures usernames
- Data Minimization: Only essential information required for device management is collected
- Secure Transmission: All data is transmitted via HTTPS to Supabase
- Access Control: Agent requires proper authentication tokens to update database
- Review collected data to ensure compliance with your organization's privacy policies
- Consider implementing Row Level Security (RLS) in Supabase for data access control
- Use environment variables for sensitive configuration (API keys, tokens)
- Regularly update the agent to benefit from security improvements
- Linux: Requires root access for full system metrics collection
- macOS: Requires administrator privileges for hardware information
- Windows: Requires Administrator rights for system-level data collection
MIT