Files
EvoFirewall/docs/agents.md
T
DenozordecandCursor 90d50c2556
Build and Push EvoFirewall Docker Image / build-and-push (push) Successful in 1m46s
Build and Push EvoFirewall Docker Image / create-release (push) Skipped
feat(api, web): implement policy mode management for agents and rules
- 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 <cursoragent@cursor.com>
2026-07-21 02:16:51 +07:00

2.4 KiB
Raw Blame History

Agents

Short install (рекомендуется)

В UI /agentsДобавить агента:

  1. Создаётся агент со статусом Invited (сразу виден в таблице) + install-ссылка.
  2. Скопируйте one-liner (колонка Install или Sheet):

Linux:

curl -fsSL https://<cp>/agent-install/<id> | bash

MikroTik:

/tool fetch url="https://<cp>/agent-install/<id>" dst-path=evofw-install.rsc; /import file-name=evofw-install.rsc
  1. После enroll статус станет Pending — одобрите агента (Approve).
  2. Approved — агент синхронизирует политику.

API (auth): POST /api/v1/install-links { "name": "web-01", "platform": "linux" | "mikrotik" }.

Linux (legacy one-liner)

curl -fsSL https://<cp>/v1/agent/install.sh | \
  EVOFW_CP_URL=https://<cp> \
  EVOFW_SEED=<seed> \
  EVOFW_CLIENT_NAME="web-01" \
  bash

Создаёт нового агента со статусом Pending (без Invited).

Файлы: /etc/evofw/agent.conf, /usr/local/sbin/evofw-firewall.sh, timer evofw-firewall.timer (default 1min).

Backend auto-detect: nft → ipset → iptables.

Whitelist: nft chain policy drop + allow set. Blacklist: policy accept + deny set.

MikroTik (RouterOS 7.21+)

В UI /agentsДобавить агента → platform MikroTik. Скопируйте one-liner:

/tool fetch url="https://<cp>/agent-install/<id>" dst-path=evofw-install.rsc; /import file-name=evofw-install.rsc

Или короткий slug: https://<cp>/<slug>.

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 (списки + режим).

Режим фильтра задаётся на наборе правил (/rules), не на агенте:

  • blacklist — по умолчанию ACCEPT; deny-CIDR блокируются
  • whitelist — по умолчанию DROP (forward); только allow-CIDR

Все наборы, назначенные агенту, должны иметь один режим.

Force sync

sudo rm -f /var/lib/evofw/last_hash
sudo /usr/local/sbin/evofw-firewall.sh