Skip to content
Merged

Dev #87

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_test_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ "macos-14" ]
os: [ "macos-15" ]
python-version: [ "3.12",
"3.13",
"3.14"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ jobs:
steps:
- uses: actions/checkout@v4.2.0

- name: Setup py-3.14
- name: Setup formatter Python
uses: actions/setup-python@v4
with:
python-version: '3.14'
python-version: '3.11'
cache: 'pip'
cache-dependency-path: |
requirements/requirements.*.txt
.pre-commit-config.yaml

- name: Install requirements
- name: Install pre-commit
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/requirements.dev.txt -r requirements/requirements.detector.txt -r requirements/requirements.logcollector.txt -r requirements/requirements.prefilter.txt -r requirements/requirements.inspector.txt -r requirements/requirements.logserver.txt
python -m pip install pre-commit

- name: Cache pre-commit hooks
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
key: ${{ runner.os }}-precommit-py311-${{ hashFiles('.pre-commit-config.yaml') }}

- uses: pre-commit/action@v3.0.1
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ repos:
rev: 25.11.0
hooks:
- id: black
language_version: python3.11
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.4.0
v2.4.0-dev
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ pipeline:
zeek:
sensors:
zeek:
static_analysis: false
static_analysis: true
protocols:
- dns
interfaces:
Expand Down
7 changes: 5 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,17 @@ services:
profiles: ["prod", "prod-gpu"]

zeek:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-zeek:${HAMSTRING_ZEEK_IMAGE_TAG:-2.0.5}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-zeek:${HAMSTRING_ZEEK_IMAGE_TAG:-2.0.6}"
cap_add:
- NET_ADMIN
- NET_RAW
network_mode: host
environment:
- CONTAINER_NAME=zeek
- HAMSTRING_ZEEK_KAFKA_WAIT_INTERVAL_SECONDS=${HAMSTRING_ZEEK_KAFKA_WAIT_INTERVAL_SECONDS:-15}
- HAMSTRING_ZEEK_KAFKA_WAIT_INTERVAL_SECONDS=${HAMSTRING_ZEEK_KAFKA_WAIT_INTERVAL_SECONDS:-5}
- HAMSTRING_ZEEK_KAFKA_OUTAGE_THRESHOLD_SECONDS=${HAMSTRING_ZEEK_KAFKA_OUTAGE_THRESHOLD_SECONDS:-15}
- HAMSTRING_ZEEK_KAFKA_RECOVERY_STABILITY_SECONDS=${HAMSTRING_ZEEK_KAFKA_RECOVERY_STABILITY_SECONDS:-30}
- HAMSTRING_ZEEK_ZEEKCTL_TIMEOUT_SECONDS=${HAMSTRING_ZEEK_ZEEKCTL_TIMEOUT_SECONDS:-60}
volumes:
- ../config.yaml:/opt/config.yaml
- ../data/test_pcaps/:/opt/static_files
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose/prod/docker-compose.monitoring.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
monitoring_agent:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-monitoring:${HAMSTRING_MONITORING_IMAGE_TAG:-v2.3.1}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-monitoring:${HAMSTRING_MONITORING_IMAGE_TAG:-v2.4.0}"
restart: "unless-stopped"
volumes:
- ../../../config.yaml:/app/config.yaml
Expand Down
14 changes: 7 additions & 7 deletions docker/docker-compose/prod/docker-compose.pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
logserver:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-logserver:${HAMSTRING_LOGSERVER_IMAGE_TAG:-v2.3.1}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-logserver:${HAMSTRING_LOGSERVER_IMAGE_TAG:-v2.4.0}"
restart: "unless-stopped"
networks:
hamstring:
Expand All @@ -10,7 +10,7 @@ services:
- GROUP_ID=log_storage
- HAMSTRING_WAIT_FOR=kafka
logcollector:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-logcollector:${HAMSTRING_LOGCOLLECTOR_IMAGE_TAG:-v2.3.1}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-logcollector:${HAMSTRING_LOGCOLLECTOR_IMAGE_TAG:-v2.4.0}"
restart: "unless-stopped"
volumes:
- ../../../config.yaml:/app/config.yaml
Expand All @@ -21,7 +21,7 @@ services:
- HAMSTRING_WAIT_FOR=kafka

prefilter:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-prefilter:${HAMSTRING_PREFILTER_IMAGE_TAG:-v2.3.1}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-prefilter:${HAMSTRING_PREFILTER_IMAGE_TAG:-v2.4.0}"
restart: "unless-stopped"
volumes:
- ../../../config.yaml:/app/config.yaml
Expand All @@ -35,7 +35,7 @@ services:
- HAMSTRING_WAIT_FOR=kafka

inspector:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-inspector:${HAMSTRING_INSPECTOR_IMAGE_TAG:-v2.3.1}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-inspector:${HAMSTRING_INSPECTOR_IMAGE_TAG:-v2.4.0}"
restart: "unless-stopped"
volumes:
- ../../../config.yaml:/app/config.yaml
Expand All @@ -57,7 +57,7 @@ services:
- HAMSTRING_WAIT_FOR=kafka

detector:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-detector:${HAMSTRING_DETECTOR_IMAGE_TAG:-v2.3.1}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-detector:${HAMSTRING_DETECTOR_IMAGE_TAG:-v2.4.0}"
restart: "unless-stopped"
volumes:
- ../../../config.yaml:/app/config.yaml
Expand All @@ -71,7 +71,7 @@ services:
- HAMSTRING_WAIT_FOR=kafka

detector-gpu:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-detector:${HAMSTRING_DETECTOR_IMAGE_TAG:-v2.3.1}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-detector:${HAMSTRING_DETECTOR_IMAGE_TAG:-v2.4.0}"
restart: "unless-stopped"
volumes:
- ../../../config.yaml:/app/config.yaml
Expand All @@ -93,7 +93,7 @@ services:
- NVIDIA_DRIVER_CAPABILITIES=compute,utility

alerter:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-alerter:${HAMSTRING_ALERTER_IMAGE_TAG:-v2.3.1}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-alerter:${HAMSTRING_ALERTER_IMAGE_TAG:-v2.4.0}"
restart: "unless-stopped"
volumes:
- ../../../config.yaml:/app/config.yaml
Expand Down
5 changes: 4 additions & 1 deletion docker/docker_swarm/docker-compose.swarm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ services:
restart_policy:
condition: any
zeek:
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-zeek:${HAMSTRING_ZEEK_IMAGE_TAG:-2.0.5}"
image: "${HAMSTRING_IMAGE_REGISTRY:-ghcr.io/astraos-de}/hamstring-zeek:${HAMSTRING_ZEEK_IMAGE_TAG:-2.0.6}"
cap_add:
- NET_ADMIN
- NET_RAW
Expand All @@ -400,6 +400,9 @@ services:
# environment.kafka_brokers[*].node_ip/external_port.
CONTAINER_NAME: "${ZEEK_CONTAINER_NAME:-zeek}"
HAMSTRING_ZEEK_KAFKA_WAIT_INTERVAL_SECONDS: "${HAMSTRING_ZEEK_KAFKA_WAIT_INTERVAL_SECONDS:-5}"
HAMSTRING_ZEEK_KAFKA_OUTAGE_THRESHOLD_SECONDS: "${HAMSTRING_ZEEK_KAFKA_OUTAGE_THRESHOLD_SECONDS:-15}"
HAMSTRING_ZEEK_KAFKA_RECOVERY_STABILITY_SECONDS: "${HAMSTRING_ZEEK_KAFKA_RECOVERY_STABILITY_SECONDS:-30}"
HAMSTRING_ZEEK_ZEEKCTL_TIMEOUT_SECONDS: "${HAMSTRING_ZEEK_ZEEKCTL_TIMEOUT_SECONDS:-60}"
logging: *default-logging
deploy:
mode: replicated
Expand Down
35 changes: 35 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,41 @@ Application service variables
- ``zeek``
- Container name passed to the Zeek image.

Zeek recovery
^^^^^^^^^^^^^

Compose and Swarm pass these settings to the Zeek supervisor. Values must be
positive integers in seconds. The supervisor checks and restarts missing Zeek
processes even when Kafka's TCP ports remain reachable. A sustained Kafka outage
or a failed Zeek health check schedules a full worker recycle once Kafka has
been stable for the configured recovery period. Failed recycles are retried
after another stability period.

.. list-table:: Zeek recovery variables
:header-rows: 1
:widths: 40 15 45

* - Variable
- Default
- Description
* - ``HAMSTRING_ZEEK_KAFKA_WAIT_INTERVAL_SECONDS``
- ``5``
- Interval between broker readiness and live Zeek health checks.
* - ``HAMSTRING_ZEEK_KAFKA_OUTAGE_THRESHOLD_SECONDS``
- ``15``
- Kafka outage duration that schedules a full worker recycle after recovery.
* - ``HAMSTRING_ZEEK_KAFKA_RECOVERY_STABILITY_SECONDS``
- ``30``
- Kafka stability period before recycling workers or retrying a failed recycle.
* - ``HAMSTRING_ZEEK_ZEEKCTL_TIMEOUT_SECONDS``
- ``60``
- Deadline for each ``zeekctl`` command, including shutdown.

These settings require a Zeek image containing the recovery supervisor changes.
The patched Kafka writer terminates Zeek on delivery or enqueue failures so the
supervisor can restart it. Recovery resumes capture; packets lost during an
outage are not buffered for replay.

Image variables
^^^^^^^^^^^^^^^

Expand Down
Loading