feat(api, web): implement policy mode management for agents and rules
Build and Push EvoFirewall Docker Image / build-and-push (push) Successful in 1m46s
Build and Push EvoFirewall Docker Image / create-release (push) Skipped

- Added support for policy modes ('blacklist' and 'whitelist') in agent and policy set management.
- Updated API endpoints to handle policy mode during agent assignment and rule operations.
- Enhanced the web UI to display and manage policy modes for agents and rules, ensuring all assigned sets share a consistent mode.
- Introduced new validation to enforce single policy mode across assigned sets for agents.
- Improved error handling for policy mode conflicts and updated documentation accordingly.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-07-21 02:16:51 +07:00
co-authored by Cursor
parent d5784b9f35
commit 90d50c2556
15 changed files with 1261 additions and 266 deletions
+4 -4
View File
@@ -56,12 +56,12 @@ Install RSC:
2. Создаёт filter-правила `evofw-*` и address-list `EVOFW_DENY` / `EVOFW_ALLOW`.
3. Scheduler `evofw-sync` каждую минуту: `GET /v1/agent/policy.rsc``/import` (списки + режим).
**Blacklist:** `drop` по `EVOFW_DENY` в `input` и `forward`.
**Whitelist:** `accept` по `EVOFW_ALLOW` + catch-all `drop` только в `forward` (input не закрывается — Winbox/SSH).
**Режим фильтра** задаётся на **наборе правил** (`/rules`), не на агенте:
Legacy: скачайте `/v1/agent/mikrotik-install.rsc`, задайте globals `EvofwCpUrl`, `EvofwSeed`, `EvofwName`, опционально `EvofwInstallLinkId`, затем `/import`.
- **blacklist** — по умолчанию ACCEPT; deny-CIDR блокируются
- **whitelist** — по умолчанию DROP (forward); только allow-CIDR
Одобрите агента в UI — после Approve sync начнёт применять политику.
Все наборы, назначенные агенту, должны иметь один режим.
## Force sync