feat(api): unify policy handling with default action updates
Build and Push EvoFirewall Docker Image / build-and-push (push) Successful in 1m53s
Build and Push EvoFirewall Docker Image / create-release (push) Skipped

- Updated `evofw-firewall.sh` and related scripts to replace `policy_mode` with `default_action`, enhancing clarity and consistency in policy management.
- Adjusted agent routes and evaluation logic to accommodate the new default action structure, ensuring backward compatibility with legacy modes.
- Enhanced tests to validate the new default action behavior and its integration within the agent policy framework.
- Refactored related components in the web interface to align with the updated policy handling, improving user experience and reducing confusion around policy modes.
This commit is contained in:
Denozordec
2026-07-23 10:52:28 +07:00
parent a6eb21a10d
commit 1f7273f38d
30 changed files with 1469 additions and 621 deletions
+5 -5
View File
@@ -63,14 +63,14 @@ Install RSC:
1. Enroll (с `install_link_id` → агент Invited → Pending).
2. Создаёт filter-правила `evofw-*` и address-list `EVOFW_DENY` / `EVOFW_ALLOW`.
3. Scheduler `evofw-sync` каждую минуту: `GET /v1/agent/policy.rsc``/import` (списки + режим).
3. Scheduler `evofw-sync` каждую минуту: `GET /v1/agent/policy.rsc``/import` (списки + default).
**Режим фильтра** задаётся на **наборе правил** (`/rules`), не на агенте:
**Default action** задаётся на **агенте** (`default_action: accept | drop`):
- **blacklist** — по умолчанию ACCEPT; deny-CIDR блокируются
- **whitelist** — по умолчанию DROP (forward); только allow-CIDR
- **accept** — пакет вне deny/allow пропускается
- **drop** — пакет вне deny/allow отбрасывается (forward)
Все наборы, назначенные агенту, должны иметь один режим.
Цепочка всегда: deny-drop → allow-accept → default. Наборы несут только правила deny/allow, без exclusive mode.
## Force sync