1.7 KiB
1.7 KiB
Netbox Scanner
This repository includes a simple Dockerized network scanner and a NetBox importer.
Services
scanner: runsscan.pyand saves scan results tooutput/network.txtnetbox-importer: runsipscan-v2.pyand imports scan results into NetBox
Files
scan.py: performs Nmap scans for configured networks and writesnetwork.txtipscan-v2.py: imports scan results into NetBox using environment variablesdocker-compose.yml: definesscannerandnetbox-importerservicesDockerfile: installs Python and Nmap and copies both scripts into the container
Usage
Build and run the scanner
docker compose build
docker compose up scanner
The scan output is written to:
./output/network.txt
Run the NetBox importer
docker compose up netbox-importer
Configuration
Scanner service
OUTPUT_PATH: path to save results inside container (default:/app/output/network.txt)SCAN_NETWORKS: comma-separated CIDR networks to scan (default set inscan.py)
NetBox importer service
NETBOX_URL: NetBox API URLNETBOX_TOKEN: NetBox API tokenNETWORKS: comma-separated networks to scanTENANT: NetBox tenant nameSSL_VERIFY: whether to verify SSL (false,0,nodisable verification)
Output format
The generated network.txt file includes scan results in this format:
# network.txt generated on 2026-05-20T00:00:00Z
# host status open_ports
192.168.85.1 up 22 80
192.168.85.2 down
Notes
- Ensure
nmapis installed in the container via the providedDockerfile. - If you want to run both services together, use:
docker compose up scanner netbox-importer