A lightweight daemon that monitors open ports and alerts on unexpected changes via webhook or email.
go install github.com/yourusername/portwatch@latestOr build from source:
git clone https://github.com/yourusername/portwatch.git && cd portwatch && go build -o portwatch .Create a config file (config.yaml):
interval: 60s
baseline:
- 22
- 80
- 443
alerts:
webhook: "https://hooks.example.com/notify"
email: "ops@example.com"Run the daemon:
portwatch --config config.yamlportwatch will scan open ports at the specified interval and send an alert whenever a port appears or disappears outside your defined baseline.
| Flag | Default | Description |
|---|---|---|
--config |
config.yaml |
Path to config file |
--interval |
60s |
Scan interval |
--once |
false |
Run a single scan and exit |
{
"event": "port_opened",
"port": 8080,
"timestamp": "2024-11-01T12:34:56Z"
}MIT © 2024 yourusername