NetAssetGuard is a lightweight, strictly scoped network asset monitoring suite. Built with Go and vanilla web technologies, it provides continuous reachability and discovery polling for predefined network assets.
The application follows a monolithic architecture focused on minimal dependencies and zero external runtime requirements.
- Backend: Go 1.25+ with
go-chi/chifor routing. - Storage: Embedded SQLite using
modernc.org/sqlite(CGO-free driver). - Frontend: Vanilla HTML5, CSS3, and JavaScript utilizing Server-Sent Events (SSE) for real-time state updates.
- Data Enrichment: Built-in IEEE MAC registry via
//go:embedfor offline MAC address vendor identification.
- State Monitoring: Continuous background polling using ICMP, reverse DNS, and targeted TCP port checks.
- Network Discovery: Active ARP, mDNS, and SNMP probing within specified CIDR ranges.
- Strict Scoping: Monitors only explicitly declared assets to avoid wide-network scanning footprints.
- DNS Validation: Validates resolved reverse-DNS against expected configuration.
Deploying via Docker is the recommended approach for production environments, ensuring strict isolation and immutability.
The provided Dockerfile adheres to the following DevSecOps standards:
- Multi-Stage Build: Utilizes a builder stage to keep the final image minimal.
- Static Compilation: Compiled with
CGO_ENABLED=0for a fully static binary with no C dependencies. - Rootless Execution: The final stage runs using an unprivileged
appuser, preventing root access to the host system in the event of a container compromise.
docker build -t netassetguard:latest .docker run -d \
--name netassetguard \
-p 8080:8080 \
-v netassetguard_data:/app/data \
--restart unless-stopped \
netassetguard:latestIf containerization is not available, the application can be compiled directly on the host OS.
- Go 1.25+
- Clone the repository and navigate to the directory.
- Download dependencies:
go mod download
- Compile the binary:
go build -o netassetguard main.go
- Execute the binary:
./netassetguard
The application can be configured via environment variables:
PORT: HTTP listener port (default:8080)HOST: HTTP listener interface (default:127.0.0.1, set to0.0.0.0for Docker)DB_PATH: Absolute or relative path to the SQLite file (default:inventory.db)
Once the application is running (either via Docker or standard execution), access the web interface by navigating to:
http://localhost:8080
(Adjust the port if you modified the PORT environment variable).
- The application enforces rigid IP validation to block unspecified, multicast, and broadcast addresses.
- Reverse DNS lookups are verified against expected state to mitigate basic spoofing attempts.
MIT License