osint-dashboard/deploy/README.md
Sirius DevOps 085061492e
All checks were successful
build-and-deploy / build (push) Successful in 2m0s
masscan: active RTSP (554) camera discovery service
Continuous whole-IPv4 rolling sweep for open TCP 554, feeding the same
cameras table as the passive scraper (discovery_source=masscan).

- masscan_config.py: env-driven knobs (range, ports, rate, retries, excludes)
- masscan_scanner.py: JSON-lines parser, rtsp://IP/ URL + url_hash dedupe,
  ip-api geolocation, insert/refresh, NATS publish for new finds
- run_masscan_service.py: long-lived rolling-sweep runner (streams results
  in, restarts on pass completion); fails closed without an excludefile
- deploy/: systemd unit + README + excludes file for the Pi host
- .env.example: masscan section

Verified end-to-end against a local Postgres: parse, insert, and dedupe
(0 new on re-ingest) all pass.
2026-08-24 22:23:36 -04:00

31 lines
1.4 KiB
Markdown

# systemd unit template — copy to /etc/systemd/system/osint-masscan.service
#
# The masscan service is a CONTINUOUS rolling sweep (a full IPv4 pass at a
# conservative rate takes ~5 days), so it runs as a long-lived service, NOT a
# daily timer. The [Install] WantedBy means it starts at boot and Restart=always
# keeps it up. Install steps (run once on the Pi, as root):
#
# apt install -y masscan # or: apt-get install masscan
# mkdir -p /etc/osint-dashboard /opt/siriusdevops
# cp deploy/masscan-excludes.txt /etc/osint-dashboard/masscan-excludes.txt
#
# # Optional tuning (override env in this file; the DB_* values in the unit
# # already point at the host-published Postgres on 127.0.0.1:5432):
# cat > /etc/osint-dashboard/masscan.env <<'EOF'
# MASSCAN_RANGE=0.0.0.0/0
# MASSCAN_PORTS=554
# MASSCAN_RATE=10000
# EOF
#
# # Venv for the scanner (host-level, not the compose image):
# cd /opt/siriusdevops/osint-dashboard
# python3 -m venv .venv-masscan
# .venv-masscan/bin/pip install -r app/requirements.txt
#
# install -m 644 deploy/osint-masscan.service /etc/systemd/system/
# systemctl daemon-reload
# systemctl enable --now osint-masscan
#
# Watch: journalctl -u osint-masscan -f
# DB: writes into the same Postgres the compose stack uses (127.0.0.1:5432)
# so findings appear on the dashboard camera map automatically.