Skip to content

feat(dpi): refactor DPI section - #1889

Merged
Tbaile merged 17 commits into
mainfrom
refactor_dpi
Oct 8, 2026
Merged

Tbaile merged 17 commits into
mainfrom
refactor_dpi

Conversation

@m-dilorenzi

Copy link
Copy Markdown
Collaborator

This PR contains a rework on the DPI rule management around application groups and an ordered, first-match-wins rule list, replacing the old flat schema where every rule was a device plus a list of applications or protocols, all evaluated in parallel.

Main changes

  • Application groups as a new reusable entity, referenced by rules instead of inlining applications and protocols in each one.
  • Rules now carry a name, an action, an optional source and a priority, and halt on match, so their order decides the outcome. Two actions: block and the new allow.
  • API: rule CRUD is id-based and gains rename, enable, disable and reorder, plus the application group CRUD. Catalog lookups are split between what the engine has loaded and the downloaded catalogs. Removed list-popular, list-devices and the global exemption CRUD, replaced by an Allow rule at the top of the list.
  • Migration: a uci-defaults script converts /etc/config/dpi on the first boot after the upgrade. Legacy rules are kept with their behaviour frozen verbatim, global exemptions become Allow rules, unsupported rules are dropped with a log line naming them.
  • Generator: dpi-config orders the actions by priority, refuses to emit a rule that would produce an invalid criteria, and still handles the old schema for a box whose migration has not run yet.

@m-dilorenzi m-dilorenzi self-assigned this Sep 8, 2026
@m-dilorenzi
m-dilorenzi force-pushed the refactor_dpi branch 3 times, most recently from fbc2aa3 to e033fcc Compare September 24, 2026 10:54
@m-dilorenzi
m-dilorenzi force-pushed the refactor_dpi branch 3 times, most recently from dfc8cd5 to 2f57ecd Compare October 1, 2026 10:59
Comment thread packages/python3-nethsec/src/nethsec/dpi/__init__.py Outdated
Comment thread packages/python3-nethsec/src/nethsec/dpi/__init__.py Outdated
Comment thread packages/python3-nethsec/src/nethsec/dpi/__init__.py
Comment thread packages/python3-nethsec/src/nethsec/dpi/__init__.py Outdated
Comment thread packages/ns-api/files/ns.dpi Outdated
Comment thread packages/python3-nethsec/src/nethsec/dpi/__init__.py Outdated
Comment thread packages/ns-dpi/Makefile Outdated
@m-dilorenzi
m-dilorenzi requested a review from Tbaile October 1, 2026 15:44
@m-dilorenzi
m-dilorenzi marked this pull request as ready for review October 8, 2026 07:41
@Tbaile
Tbaile merged commit 68b0b4d into main Oct 8, 2026
7 checks passed
@Tbaile
Tbaile deleted the refactor_dpi branch October 8, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor DPI UI for a more effective filtering: firewall-like rules, reusable profiles, categories management

2 participants