Skip to content

Commit 8844b52

Browse files
committed
Initial commit: NetFlowMap v1.0.11
NetFlowMap is a real-time network flow visualization tool that displays NetFlow v9 data on an interactive world map. Features: - Real-time NetFlow v9 collection and visualization - Interactive world map with flow lines - GeoIP-based location mapping - FortiGate address object integration - Authentication (local + OIDC) - Role-based access control - WebSocket-based live updates
0 parents  commit 8844b52

45 files changed

Lines changed: 13600 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# Build artifacts
6+
netflowmap
7+
*.exe
8+
bin/
9+
dist/
10+
11+
# IDE
12+
.idea/
13+
.vscode/
14+
*.swp
15+
*.swo
16+
17+
# Configuration with secrets
18+
config.yml
19+
config.yaml
20+
users.yml
21+
users.yaml
22+
23+
# Data directory (downloaded at runtime)
24+
data/
25+
*.mmdb
26+
27+
# Documentation
28+
*.md
29+
!web/**/*.md
30+
31+
# Docker files (avoid recursive builds)
32+
Dockerfile
33+
docker-compose*.yml
34+
.dockerignore
35+
36+
# Test files
37+
*_test.go
38+
coverage.*
39+
40+
# Temporary files
41+
tmp/
42+
temp/
43+
*.tmp
44+
*.log
45+
46+
47+
48+
49+
50+
51+

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Configuration files with secrets
2+
config.yml
3+
users.yml
4+
5+
# GeoIP database
6+
data/
7+
*.mmdb
8+
9+
# Build artifacts (binary in root directory only)
10+
/netflowmap
11+
*.exe
12+
*.exe~
13+
*.dll
14+
*.so
15+
*.dylib
16+
17+
# Test binary
18+
*.test
19+
20+
# Go workspace
21+
go.work
22+
go.work.sum
23+
24+
# IDE
25+
.idea/
26+
.vscode/
27+
*.swp
28+
*.swo
29+
*~
30+
31+
# OS files
32+
.DS_Store
33+
Thumbs.db
34+
35+
# Debug
36+
*.log
37+
debug/
38+
39+
# Coverage
40+
coverage.out
41+
coverage.html
42+
43+
# Temporary files
44+
tmp/
45+
temp/
46+
*.tmp

Dockerfile

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Build stage
2+
FROM golang:1.25-alpine AS builder
3+
4+
WORKDIR /build
5+
6+
# Install build dependencies
7+
RUN apk add --no-cache git ca-certificates
8+
9+
# Copy go mod files first for better caching
10+
COPY go.mod go.sum ./
11+
RUN go mod download
12+
13+
# Copy source code
14+
COPY . .
15+
16+
# Build the binary
17+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o netflowmap ./cmd/netflowmap
18+
19+
# Runtime stage
20+
FROM alpine:3.19
21+
22+
WORKDIR /app
23+
24+
# Install runtime dependencies
25+
RUN apk add --no-cache ca-certificates tzdata
26+
27+
# Create non-root user
28+
RUN adduser -D -u 1000 netflowmap
29+
30+
# Copy binary from builder
31+
COPY --from=builder /build/netflowmap /app/netflowmap
32+
33+
# Copy web assets
34+
COPY --from=builder /build/web /app/web
35+
36+
# Copy example configs
37+
COPY --from=builder /build/configs /app/configs
38+
39+
# Create data directory for GeoIP database
40+
RUN mkdir -p /app/data && chown -R netflowmap:netflowmap /app
41+
42+
# Switch to non-root user
43+
USER netflowmap
44+
45+
# Expose ports
46+
# 8080 - HTTP Web UI
47+
# 2055 - NetFlow UDP
48+
EXPOSE 8080
49+
EXPOSE 2055/udp
50+
51+
# Health check
52+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
53+
CMD wget -q --spider http://localhost:8080/api/health || exit 1
54+
55+
# Run
56+
ENTRYPOINT ["/app/netflowmap"]
57+
CMD ["--config", "/app/config.yml"]
58+
59+
60+
61+
62+
63+
64+

LicenseInfo.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Lizenzinformationen
2+
3+
Dieses Dokument listet alle externen Komponenten, Bibliotheken, Frameworks und Datenquellen auf, die in NetFlowMap verwendet werden, zusammen mit ihren Lizenzen und Quellen.
4+
5+
## Backend (Go)
6+
7+
### Direkte Abhängigkeiten
8+
9+
| Komponente | Version | Quelle | Lizenz | Verwendung |
10+
|------------|---------|--------|--------|------------|
11+
| **go-chi/chi** | v5.2.3 | https://github.com/go-chi/chi | MIT License | HTTP-Router und Middleware |
12+
| **gorilla/websocket** | v1.5.3 | https://github.com/gorilla/websocket | BSD 2-Clause License | WebSocket-Kommunikation für Echtzeit-Updates |
13+
| **coreos/go-oidc** | v3.17.0 | https://github.com/coreos/go-oidc | Apache License 2.0 | OpenID Connect Authentifizierung |
14+
| **golang-jwt/jwt** | v5.3.0 | https://github.com/golang-jwt/jwt | MIT License | JWT-Token-Verarbeitung für Sessions |
15+
| **oschwald/maxminddb-golang** | v1.13.1 | https://github.com/oschwald/maxminddb-golang | Apache License 2.0 | GeoIP-Datenbank-Reader (MaxMind DB Format) |
16+
| **golang.org/x/crypto** | v0.46.0 | https://golang.org/x/crypto | BSD 3-Clause License | Kryptografische Funktionen (bcrypt für Passwort-Hashing) |
17+
| **golang.org/x/oauth2** | v0.34.0 | https://golang.org/x/oauth2 | BSD 3-Clause License | OAuth2-Client für OIDC |
18+
| **gopkg.in/yaml.v3** | v3.0.1 | https://github.com/go-yaml/yaml | Apache License 2.0 / MIT License | YAML-Konfigurationsparsing |
19+
20+
### Indirekte Abhängigkeiten
21+
22+
| Komponente | Version | Quelle | Lizenz | Verwendung |
23+
|------------|---------|--------|--------|------------|
24+
| **go-jose/go-jose** | v4.1.3 | https://github.com/go-jose/go-jose | MIT License | JOSE-Implementierung (indirekt über go-oidc) |
25+
| **golang.org/x/sys** | v0.39.0 | https://golang.org/x/sys | BSD 3-Clause License | System-Calls (indirekt über andere Pakete) |
26+
27+
### Programmiersprache
28+
29+
| Komponente | Version | Quelle | Lizenz | Verwendung |
30+
|------------|---------|--------|--------|------------|
31+
| **Go** | 1.25.3 | https://golang.org/ | BSD 3-Clause License | Programmiersprache |
32+
33+
## Frontend (JavaScript/CSS)
34+
35+
### JavaScript-Bibliotheken
36+
37+
| Komponente | Version | Quelle | Lizenz | Verwendung |
38+
|------------|---------|--------|--------|------------|
39+
| **Leaflet** | 1.9.4 | https://leafletjs.com/ | BSD 2-Clause License | Interaktive Kartenvisualisierung |
40+
41+
### Karten-Tiles (Externe Services)
42+
43+
| Komponente | Version | Quelle | Lizenz | Verwendung |
44+
|------------|---------|--------|--------|------------|
45+
| **CARTO Basemaps** | - | https://carto.com/basemaps/ | OpenStreetMap ODbL + CARTO Basemaps Terms of Service | Karten-Tiles für die Dark-Map-Ansicht |
46+
| **OpenStreetMap** | - | https://www.openstreetmap.org/ | Open Database License (ODbL) | Kartendatenquelle für CARTO Basemaps |
47+
48+
**Wichtiger Hinweis:**
49+
- CARTO Basemaps ist ein **externer Service** (keine Bibliothek), der zur Laufzeit über `cartocdn.com` aufgerufen wird
50+
- Die Karten-Tiles werden **nicht als Teil des Codes weiterverbreitet**, sondern werden zur Laufzeit vom CARTO-Server geladen
51+
- Die Attribution erfolgt automatisch im UI (siehe `web/static/js/app.js`)
52+
- CARTO Basemaps verwendet OpenStreetMap-Daten und stellt diese als kostenlosen Tile-Service zur Verfügung
53+
- **Nutzungsbedingungen:** Die spezifischen "Basemaps Terms of Service" von CARTO sollten direkt geprüft werden: https://carto.com/legal
54+
- Da es sich um einen externen Service handelt, der zur Laufzeit aufgerufen wird, verhindert dies **nicht** die Weiterverbreitung des NetFlowMap-Codes unter einer Open-Source-Lizenz
55+
56+
### Schriftarten
57+
58+
| Komponente | Version | Quelle | Lizenz | Verwendung |
59+
|------------|---------|--------|--------|------------|
60+
| **JetBrains Mono** | - | https://fonts.google.com/specimen/JetBrains+Mono | SIL Open Font License 1.1 | Monospace-Schriftart für technische Informationen |
61+
| **Space Grotesk** | - | https://fonts.google.com/specimen/Space+Grotesk | SIL Open Font License 1.1 | Hauptschriftart für UI-Elemente |
62+
63+
**Hinweis:** Die Schriftarten werden über Google Fonts CDN geladen.
64+
65+
## Datenbanken & Datenquellen
66+
67+
| Komponente | Version | Quelle | Lizenz | Verwendung |
68+
|------------|---------|--------|--------|------------|
69+
| **DB-IP Lite City** | Monatlich aktualisiert | https://db-ip.com/db/lite.php | Creative Commons Attribution 4.0 International (CC BY 4.0) | GeoIP-Standortdatenbank (Stadt, Land, Koordinaten) |
70+
| **DB-IP Lite ASN** | Monatlich aktualisiert | https://db-ip.com/db/lite.php | Creative Commons Attribution 4.0 International (CC BY 4.0) | ASN-Datenbank (Autonomous System Number, Organisation) |
71+
72+
**Hinweis:** Beide Datenbanken werden automatisch von NetFlowMap heruntergeladen und monatlich aktualisiert. Die Datenbanken werden im MaxMind DB Format bereitgestellt.
73+
74+
## Build-Tools & Runtime
75+
76+
| Komponente | Version | Quelle | Lizenz | Verwendung |
77+
|------------|---------|--------|--------|------------|
78+
| **Alpine Linux** | 3.19 | https://alpinelinux.org/ | Apache License 2.0 | Basis-Image für Docker-Container |
79+
| **golang:1.25-alpine** | - | https://hub.docker.com/_/golang | BSD 3-Clause License (Go) | Build-Container für Docker-Builds |
80+
81+
## Lizenz-Kompatibilität
82+
83+
Alle verwendeten Lizenzen sind kompatibel mit der MIT-Lizenz von NetFlowMap:
84+
85+
- **MIT License**: Mehrere Komponenten (go-chi, golang-jwt/jwt, go-jose)
86+
- **Apache License 2.0**: Mehrere Komponenten (go-oidc, maxminddb-golang, yaml.v3, Alpine Linux)
87+
- **BSD 2-Clause / BSD 3-Clause**: Go-Standard-Bibliotheken und Leaflet
88+
- **SIL Open Font License 1.1**: Schriftarten (kompatibel mit MIT)
89+
- **Creative Commons Attribution 4.0**: GeoIP-Datenbanken (CC BY 4.0 erfordert Attribution)
90+
- **Open Database License (ODbL)**: OpenStreetMap-Daten (über CARTO Basemaps)
91+
- **CARTO Basemaps**: Externer Service, keine Code-Weiterverbreitung erforderlich
92+
93+
**Wichtig:** CARTO Basemaps ist ein externer Service, der zur Laufzeit aufgerufen wird. Die Karten-Tiles werden nicht als Teil des Codes weiterverbreitet, daher verhindern die CARTO Terms of Service **nicht** die Weiterverbreitung des NetFlowMap-Codes unter einer Open-Source-Lizenz. Die Nutzungsbedingungen gelten für die Nutzung des Services zur Laufzeit, nicht für die Verteilung des Codes.
94+
95+
## Attribution-Anforderungen
96+
97+
### CC BY 4.0 (DB-IP Lite)
98+
Die GeoIP-Datenbanken von DB-IP Lite stehen unter CC BY 4.0 und erfordern Attribution. Diese erfolgt implizit durch die Verwendung der Datenbanken im Projekt.
99+
100+
### OpenStreetMap (über CARTO Basemaps)
101+
Die Attribution für OpenStreetMap und CARTO erfolgt automatisch im UI der Karte (siehe `web/templates/index.html`).
102+
103+
## Weitere Informationen
104+
105+
- **NetFlowMap Lizenz**: MIT License (siehe LICENSE-Datei)
106+
- **Projekt-Repository**: https://github.com/kai/netflowmap
107+
108+
---
109+
110+
*Letzte Aktualisierung: 2025-01-27*
111+

0 commit comments

Comments
 (0)