Skip to content

Commit 55604ff

Browse files
committed
Prepare first stable release
1 parent 3265a01 commit 55604ff

8 files changed

Lines changed: 151 additions & 6 deletions

File tree

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mongoose (1.0.0) bookworm; urgency=medium
2+
3+
* Initial release
4+
5+
-- U+039b <hello@pts-project.org> Fri, 6 Feb 2026 09:55:52 +0100

debian/control

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Source: mongoose
2+
Section: misc
3+
Priority: optional
4+
Maintainer: U+039b <hello@pts-project.org>
5+
Build-Depends:
6+
debhelper-compat (= 13),
7+
dh-python,
8+
python3-all,
9+
python3-setuptools,
10+
quilt,
11+
Standards-Version: 4.5.1
12+
Homepage: https://github.com/PiRogueToolSuite/mongoose
13+
Rules-Requires-Root: no
14+
15+
Package: mongoose
16+
Architecture: all
17+
Depends:
18+
geoipupdate,
19+
python3-communityid,
20+
python3-geoip2,
21+
python3-nfstream
22+
python3-pydantic,
23+
python3-yaml,
24+
python3-requests,
25+
python3-sqlalchemy
26+
${python3:Depends},
27+
${misc:Depends},
28+
Description: A lightweight dead-simple Python library and daemon to collect, enrich, store and forward
29+
network events such as Suricata alerts and Deep Packet Inspection flows.

debian/copyright

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: mongoose
3+
Upstream-Contact: U+039b hello@pts-project.org
4+
Source: https://github.com/PiRogueToolSuite/mongoose
5+
6+
Files: *
7+
Copyright: 2026 U+039b <hello@pts-project.org>
8+
Defensive Lab Agency <contact@defensive-lab.agency>
9+
10+
License: GPL-3.0+
11+
This program is free software: you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation, either version 3 of the License, or
14+
(at your option) any later version.
15+
.
16+
This package is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
.
21+
You should have received a copy of the GNU General Public License
22+
along with this program. If not, see <https://www.gnu.org/licenses/>.
23+
.
24+
On Debian systems, the complete text of the GNU General
25+
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

debian/mongoose.service

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[Unit]
2+
Description=Collect, enrich and store network events
3+
Wants=networking.service
4+
5+
[Service]
6+
ExecStart=/usr/sbin/mongoosed -c /etc/mongoose/mongoose.yaml
7+
Environment=PYTHONUNBUFFERED=1
8+
Restart=on-failure
9+
RestartSec=2
10+
Type=notify
11+
KillSignal=SIGTERM
12+
TimeoutStopSec=30
13+
KillMode=control-group
14+
15+
[Install]
16+
WantedBy=default.target

debian/mongoose.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
configuration:
2+
database_path: "/var/lib/mongoose/mongoose.db"
3+
extra_configuration_dir: "/var/lib/mongoose/"
4+
5+
history:
6+
max_duration_days: 14
7+
8+
collector:
9+
suricata:
10+
socket_path: "/run/suricata.socket" # unix_dgram
11+
collect_alerts: true
12+
collect_netflow: false
13+
enable: true
14+
15+
nf_stream:
16+
interface: "eth0"
17+
active_timeout: 60 # 60 seconds
18+
max_nflows: 0
19+
enable: true
20+
21+
enrichment:
22+
geoip:
23+
maxmind_db_path: "/var/lib/GeoIP"
24+
maxmind_db:
25+
"GeoLite2-ASN.mmdb"
26+
"GeoLite2-City.mmdb"
27+
"GeoLite2-Country.mmdb"
28+
enable: true
29+
30+
forwarder:
31+
file: # grows indefinitely
32+
output_dir: /var/log/mongoose
33+
topics: [ "enriched-network-dpi", "enriched-network-alert" ]
34+
prefix: mongoose-
35+
enable: false
36+
37+
discord:
38+
- url: https://discord.com/api/webhooks/...
39+
username: mongoose-bot
40+
avatar_url: https://example.org/avatar.png
41+
allowed_mentions:
42+
parse: [ ]
43+
enable: false
44+
45+
webhooks:
46+
- url: https://example.org/hook
47+
headers:
48+
X-API-Key: secret
49+
auth_type: header
50+
auth_token: s3cr3t
51+
auth_header_name: X-API-Key
52+
verify_ssl: true
53+
retry_count: 3
54+
retry_delay: 5.0
55+
timeout: 10.0
56+
topics: ["enriched-network-dpi", "enriched-network-alert"]
57+
enable: false

debian/source/format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (native)

mongoose/entrypoints/cmd.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,27 @@
1313
import threading
1414
from pathlib import Path
1515
from typing import Optional
16+
from mongoose.core.engine import Engine
17+
1618

19+
# Systemd
1720
try:
18-
# systemd's python library exposes notify() which we can call
19-
# when running under systemd to report readiness and stopping.
2021
from systemd.daemon import notify # type: ignore
2122
except (Exception,):
2223

2324
def notify(message: str) -> None: # type: ignore
24-
"""Fallback notify no-op when systemd libraries are unavailable."""
25-
# No-op when systemd notification isn't available.
2625
return
2726

2827

29-
from mongoose.core.engine import Engine
28+
# PiRogue
29+
pirogue_isolated_iface: Optional[str] = None
30+
try:
31+
from pirogue_admin_client import PirogueAdminClientAdapter
32+
33+
admin_client = PirogueAdminClientAdapter()
34+
pirogue_isolated_iface = admin_client.get_configuration().get("ISOLATED_INTERFACE")
35+
except (Exception,):
36+
pass
3037

3138

3239
def parse_args(argv: Optional[list[str]] = None) -> argparse.Namespace:
@@ -95,6 +102,8 @@ def main(argv: Optional[list[str]] = None) -> int:
95102
log.warning("Configuration file %s does not exist; attempting to continue", config_path)
96103
return 1
97104

105+
network_interface = args.interface or pirogue_isolated_iface or None
106+
98107
try:
99108
engine = Engine(str(config_path), args.interface)
100109
except Exception as e:

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ build-backend = "hatchling.build"
33

44
requires = [ "hatchling", "uv-dynamic-versioning" ]
55

6+
[tool.hatch.build.targets.wheel]
7+
packages = ["mongoose"]
8+
69
[project]
7-
name = "mongoose"
10+
name = "pts-mongoose"
811
description = "Helpers to collect, enrich and store Suricata events and network flows."
912
readme = "README.md"
1013
license = "GPL-3.0-or-later"

0 commit comments

Comments
 (0)