Skip to content

v3.8.0

Latest

Choose a tag to compare

@ygalnezri ygalnezri released this 23 Nov 10:07
· 1 commit to master since this release
830f20b

v3.8.0

This release replaces the local AI pipeline of Threats Watcher (BART / BERT-NER / FLAN-T5) with a multi-LLM gateway built on LiteLLM: breaking news, keyword summaries and the weekly report can now be generated by OpenAI, Anthropic, Gemini, Ollama or any endpoint supported by LiteLLM, with a local Hugging Face model as an offline fallback. Summaries can be regenerated on demand, notifications get new Slack, email and Citadel layouts, and user profiles gain interface zoom and typewriter settings.

Update Procedure

⚠️ This release includes database migrations. Back up your database before updating.

Run every command below from the deployment/ directory, in this order:

  1. Back up the database (the stack must still be running):

    make backup

    The dump is written to deployment/backups/db_<date>_<time>.sql. Check that the file is not empty before going further.

  2. Update deployment/.env (see the configuration changes below).

  3. Pull the new images:

    make pull
  4. Stop the stack:

    make down
  5. Start the stack on the new images:

    make up

    Wait until the watcher container is healthy (docker compose ps), which takes about a minute.

  6. Apply the database migrations. This step is required: the watcher container does not run them on its own at startup.

    make migrate
  7. As a superuser, open the Connectors page, configure your LLM provider, run its health check, then enable Set as Default LLM on it.

⚠️ A Default LLM must be selected. Configuring a provider is not enough: as long as no connector is set as Default LLM, every summary is generated by the local Hugging Face fallback model.

⚠️ Corporate proxy users: LLM requests follow the proxy configured in .env. If your LLM endpoint is an internal service (an internal API marketplace, a self-hosted Ollama, etc.), add its hostname to NO_PROXY / no_proxy in deployment/.env before running make up, otherwise the request is sent to the corporate proxy, which may reject it (CONNECT tunnel failed, response 403).

ℹ️ The weekly report is now generated on Thursday at 9:30 instead of Monday.

ℹ️ The Watcher Default theme is replaced by Darkly; users who had it selected are switched automatically.

Configuration Changes

New optional variables in .env (see LLM Settings in the documentation):

  • OPENAI_API_KEY, OPENAI_MODEL, OPENAI_BASE_URL (and the same for ANTHROPIC_* and GEMINI_*), OLLAMA_API_KEY, OLLAMA_MODEL, OLLAMA_API_URL, GENERIC_LLM_URL, GENERIC_LLM_KEY, GENERIC_LLM_MODEL: LLM providers. They can also be set from the Connectors page.
  • SSL_CERT_FILE: CA bundle used to verify the LLM endpoints. When your LLM endpoint uses a certificate signed by an internal authority, point it to a bundle that contains this authority (for example the image's system bundle, /etc/ssl/certs/ca-certificates.crt, like REQUESTS_CA_BUNDLE for the other outgoing requests), otherwise the health check fails with self-signed certificate in certificate chain.
  • LITELLM_VERIFY_SSL: TLS verification of the LLM endpoints.
  • HF_LOCAL_MODEL: local fallback model (default Qwen/Qwen2.5-0.5B-Instruct).
  • WEEKLY_SUMMARY_DAY, WEEKLY_SUMMARY_HOUR: weekly report schedule (default Thursday at 09:30).
  • LITELLM_LOCAL_MODEL_COST_MAP=True: recommended behind a proxy, so LiteLLM uses its bundled model price list instead of downloading it at startup.

What's Changed

LLM Gateway

  • New llm_gateway app built on LiteLLM, supporting OpenAI, Anthropic, Gemini, Ollama and any other endpoint supported by LiteLLM (Generic LLM Provider).
  • Default LLM: one LLM connector can be selected as the provider used by every AI feature, from a switch on the Connectors page (superusers only). Selecting a new one replaces the previous choice.
  • Automatic fallback to a local Hugging Face model when no Default LLM is selected, the API is unreachable or no API key is configured, so summaries keep working offline.
  • Local endpoints (localhost, 127.0.0.1, private networks) bypass the proxy, and the TLS verification policy follows LITELLM_VERIFY_SSL.
  • Shared health check for every LLM connector.
  • LLM connector fields are prefixed by provider, show a placeholder with the expected format, and the base URL of OpenAI, Anthropic and Gemini shows the official API URL known by LiteLLM (LiteLLM default badge, resettable).

AI Summaries

  • Breaking news: impact level, targeted sectors, threat actors, malware and CVEs, with an alert score.
  • Keyword summaries: extraction of CVEs, APT groups, malware, MITRE ATT&CK techniques, sectors and countries, with a relevance score based on your organization.
  • Weekly report: the top threats of the week grouped into at most 5 clusters by severity, with an executive summary and the first publication date of each threat. Clusters are collapsed by default, and their expanded state is remembered. CVEs and threat actors are only shown when they appear in the source articles.
  • The AI model used and the generation date are shown under each summary.
  • Entity extraction is done by the LLM; the local dslim/bert-base-NER model is kept as a fallback.
  • Faster generation: articles are fetched in parallel and the weekly prompt is shared equally across topics, so the weekly report takes about 20 seconds with a cloud LLM and covers every topic, with fewer tokens spent.

On-demand Regeneration

  • Regenerate button on the weekly report, the breaking news and the keyword summaries.
  • Global cooldown shared by all users, set by superusers from their profile with a slider, from 1 minute to 24 hours (default 15 minutes). The remaining time is shown on the button.
  • Manual regenerations never send notifications.
  • If the weekly report regeneration fails, the API returns an error together with the most recent report, instead of reporting success.

Notifications

  • New layouts for the weekly report and the breaking news: Slack attachments with severity colors, email-safe HTML, and Matrix HTML for Citadel.
  • Citadel: requests now have a timeout and network errors are logged; the health check uses the Matrix whoami endpoint, with an explicit message on a 401.

Profile & Interface

  • Interface zoom (75%, 80%, 90%, 100%), applied to the whole application and saved in the user profile.
  • Typewriter effect toggle for AI summaries, with a bounded duration so long summaries display quickly.
  • The zoom and cooldown settings are step sliders, with a visible track on every theme.
  • Connectors page: connectors are grouped by category by default, and the connector version moved from the card to the Edit window.

API

  • New endpoints under /api/threats_watcher/summary/: regenerate-weekly/, by-keyword/<keyword>/regenerate/, by-keyword/<keyword>/regenerate-breaking/ (POST) and config/ (GET for every authenticated user, POST for superusers, value from 1 to 1440 minutes).
  • New /api/connectors/<id>/set-default-llm/ endpoint (POST, superusers only).

Tests & CI

  • New backend tests for the LLM router, connectors, regeneration, cooldown and permissions, and notification formats.
  • New Cypress tests for the profile settings and the Threats Watcher widgets. CyberWatch Cypress fixtures now match the real (non-paginated) API.
  • The CI test jobs are pinned to Ubuntu 24.04 and use the same PyTorch versions as the Docker image.

Documentation

  • README and documentation updated: LLM settings, Default LLM, regeneration and cooldown, new notification layouts, profile settings and new API endpoints.

Dependencies

  • Add litellm and tiktoken.
  • Bump tokenizers to 0.22.2.
  • Remove the local summarization models (BART, FLAN-T5); Hugging Face Transformers is kept for the local fallback models.
  • Declare six, used by DNS Threats and no longer installed by python-dateutil 4.

Contributors

Ideas

  • @schsebgto for the ideas and feedback that shaped this release

Full Changelog: v3.7.0...v3.8.0