Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
1f9ef47
feat: add alert_dedup workflow for security alert deduplication
duguwanglong May 8, 2026
1752b5b
refactor: align alert_dedup workflow with full LogProcessPipeline (4 …
duguwanglong May 8, 2026
746bb83
fix(alert_dedup): align filter logic with aisoc_mini LogFilter and pa…
duguwanglong May 8, 2026
f8f0c83
feat(alert_dedup): add explicit branch nodes for log-type and filter-…
duguwanglong May 8, 2026
44fdca5
refactor(workflow): rename alert_dedup → network_alert_dedup, simplif…
duguwanglong May 8, 2026
edd9d63
chore(workflow): remove aisoc_mini references from network_alert_dedup
duguwanglong May 8, 2026
7b2cbd0
feat(workflow): add branch_has_alerts after filter_logs in network_al…
duguwanglong May 8, 2026
4f59e98
refactor(workflow): rename network_alert_dedup → http_alert_dedup
duguwanglong May 8, 2026
248aa19
refactor(workflow): remove branch_has_alerts and dedup_empty from htt…
duguwanglong May 8, 2026
7ef901b
feat(workflow): replace brute-force Jaccard with MinHash LSH in dedup…
duguwanglong May 8, 2026
89019d3
refactor(workflow): English comments and expose _lsh_cluster_id in de…
duguwanglong May 8, 2026
ce4a920
feat(workflow): persist LSH state to disk in dedup_logs
duguwanglong May 8, 2026
df2f372
fix(workflow): harden LSH state persistence in dedup_logs
duguwanglong May 8, 2026
02f67c7
fix(workflow): cross-platform file lock + cleaner stats in dedup_logs
duguwanglong May 8, 2026
56d3478
fix(run_workflow): handle JSON-encoded string path and bad dict input…
duguwanglong May 8, 2026
2580cef
fix(run_workflow): split non-dict json.loads branches with clear per-…
duguwanglong May 8, 2026
6322b36
fix(run_workflow): merge conflict — keep type branches, add workflow …
duguwanglong May 9, 2026
da58f7b
Merge branch 'dev' of github.com:AgentFlocks/flocks into feat/alert-d…
duguwanglong May 9, 2026
6265dd1
fix(workflow): re-apply workspace path for LSH state (lost in dev merge)
duguwanglong May 9, 2026
9930b72
feat(workflow): record invocation stats for published-service invoke …
duguwanglong May 9, 2026
276beab
feat(workflow): add alert dedup-triage pipeline and harden LSH eviction
duguwanglong May 9, 2026
5b86c29
feat(workflow): add syslog ingestion trigger and integration tab
duguwanglong May 9, 2026
bc5e0f9
refactor(ingest): rename flocks/syslog → flocks/ingest/syslog
duguwanglong May 9, 2026
18e6521
feat(alert_dedup_triage): support syslog real-time input mode
duguwanglong May 10, 2026
a2ea64a
refactor(alert_dedup_triage): embed sub-workflow calls via engine, re…
duguwanglong May 10, 2026
3f49f2b
style(alert_dedup_triage): translate all comments and UI strings to E…
duguwanglong May 10, 2026
ce8ef77
fix(generate_summary): remove duplicate '(cached)' label in summary t…
duguwanglong May 10, 2026
af6d142
feat(alert_dedup_triage): skip summary in syslog mode, generate full …
duguwanglong May 10, 2026
1f94e80
fix(ingest/syslog): persist execution records and stats for syslog-tr…
duguwanglong May 10, 2026
db1d260
feat(workflows): support mixed TDP/Skyeye batches and flat-format TDP…
duguwanglong May 10, 2026
2b0fd1b
Merge branch 'dev' of github.com:AgentFlocks/flocks into feat/alert-d…
duguwanglong May 12, 2026
1b5e36a
feat(ingest/workflow): add stream_alert_dedup workflow and iso3164 sy…
duguwanglong May 12, 2026
97c72fc
feat(workflows): add tdp_alert_pull_dedup workflow for TDP API polling
duguwanglong May 12, 2026
4a73d7b
fix(windows-installer): require elevation for installer shortcuts
May 12, 2026
a8b4156
feat(windows): bundle python-build-standalone runtime in installer st…
xiami762 May 12, 2026
10498b8
fix(channel_message): attach Bearer API token on local HTTP send
duguwanglong May 12, 2026
c13ef59
refactor(channel_message): reuse API_TOKEN_SECRET_ID and clarify fall…
duguwanglong May 12, 2026
b33ba18
docs: add contributing guide (#257)
xiami762 May 12, 2026
2b312bc
feat(server,webui): phased startup, route timing, session/tools UX (#…
xiami762 May 12, 2026
2415272
chore: bump package version to v2026.5.12
May 12, 2026
e211501
Merge branch 'dev' of github.com:AgentFlocks/flocks into feat/tdp-ale…
duguwanglong May 13, 2026
fd9a4df
fix(workflow): concurrent subagent task / SQLite contention (#229) (#…
xiami762 May 13, 2026
21ca0d7
Merge branch 'dev' of github.com:AgentFlocks/flocks into feat/tdp-ale…
duguwanglong May 13, 2026
4651c79
docs(skills): web2cli flow, capture path, and browser experience in s…
xiami762 May 13, 2026
eee08fc
Updater: npm install then ci fallback; export build_updated_frontend …
xiami762 May 14, 2026
f5aeb03
fix(storage): avoid invalid f-string in FTS query builder (#265)
xiami762 May 14, 2026
bba801b
docs(skills): web2cli flow, capture path, and browser experience in s…
xiami762 May 13, 2026
a1a324d
fix(workflow,plugin): stop watcher reload loop and harden execution path
duguwanglong May 14, 2026
785147d
Merge branch 'dev' of github.com:AgentFlocks/flocks into feat/tdp-ale…
duguwanglong May 14, 2026
9c53a56
chore(workflows): drop legacy dedup workflows and rewrite tdp_alert_t…
duguwanglong May 14, 2026
50e7ed5
chore: bump package version to v2026.5.14
stephamie7 May 14, 2026
d5f7dfb
Merge pull request #268 from AgentFlocks/chore--bump-package-version-…
xiami762 May 14, 2026
7a66670
Merge branch 'dev' of github.com:AgentFlocks/flocks into feat/tdp-ale…
duguwanglong May 14, 2026
a0fcab4
fix(syslog/watcher): address PR-267 review — backpressure, atomic-sav…
duguwanglong May 14, 2026
c0e0d28
Merge pull request #267 from AgentFlocks/feat/tdp-alert-pull-workflow
xiami762 May 14, 2026
59f5f6b
fix(tools): align OneSEC v2.8.2 connectivity probe with handler (#270)
xiami762 May 14, 2026
95c1605
fix(webui): harden agents and workflow list hooks on errors (#271)
xiami762 May 14, 2026
26af43c
fix(workflow,syslog): stop FD exhaustion under sustained syslog flood
duguwanglong May 14, 2026
d2757c8
fix(workflow,syslog): address PR #272 review notes
duguwanglong May 14, 2026
c2a8cca
Merge pull request #272 from AgentFlocks/fix/syslog-fd-leak-and-queue…
xiami762 May 14, 2026
5568b4d
fix(workflow,syslog): prevent syslog-driven memory growth in stream_a…
duguwanglong May 14, 2026
0528f0c
fix(workflow): compact inputParams before persisting execution record
duguwanglong May 14, 2026
b9b63d4
fix(install): use nvm toolchain when PATH still resolves stale Node (…
xiami762 May 15, 2026
7d5fe49
fix(workflow): address PR #273 review notes
duguwanglong May 15, 2026
9ced911
Merge pull request #273 from AgentFlocks/fix/stream-alert-dedup-memor…
xiami762 May 15, 2026
e0d1b83
fix(syslog): validate listener port range on save
duguwanglong May 15, 2026
003f071
Merge pull request #276 from AgentFlocks/fix/syslog-port-range-valida…
xiami762 May 15, 2026
01ac2cf
feat(skills): add sangfor-edr-use and sangfor-xdr-use skills
duguwanglong May 15, 2026
fbd3c70
Merge pull request #277 from AgentFlocks/feat/sangfor-skills-migration
xiami762 May 15, 2026
99e3370
feat(task): five-field cron validation and schedule timezone display …
xiami762 May 18, 2026
2ef16c7
refactor(session): modular system prompts and runner wiring (#254)
xiami762 May 18, 2026
6e289ed
docs(skills): add PowerShell guidance for flocks browser -c (#278)
xiami762 May 18, 2026
251ca57
fix(workflow): isolate nested tool context and stabilize delegate UI …
xiami762 May 18, 2026
1852411
fix(mcp): thread-safe MCP client across loops; workflow service MCP l…
xiami762 May 18, 2026
99140d1
fix(webui): sync task detail drawer with backend polling (#282)
xiami762 May 18, 2026
0f8c1dd
fix(logging): compact OpenAI request logs and demote high-volume INFO…
xiami762 May 18, 2026
fae9fda
fix(session): WebUI /clear fallback, memory bootstrap paths, runtime …
xiami762 May 18, 2026
e405d1a
fix(agent): persist API-created agents across restarts (#286)
JohnYin-hub May 19, 2026
b6159a3
fix(feishu): stabilize legacy WebSocket client loop lifecycle (#288)
xiami762 May 19, 2026
5f2fa3c
refactor(command): unify slash direct handlers and agent-safe tool sc…
xiami762 May 19, 2026
8ea87a9
fix(webui): truncate long tool params in session chat cards (#289)
xiami762 May 19, 2026
c472fae
chore: update version to v2026.5.19 in pyproject.toml and uv.lock
stephamie7 May 19, 2026
f367c03
Merge pull request #290 from AgentFlocks/chore-bump-package-version-t…
xiami762 May 19, 2026
8468fa8
Merge branch 'main' into dev
xiami762 May 19, 2026
f207ec6
fix(provider): classify API builtin status from descriptor path
May 19, 2026
b83216e
Merge pull request #292 from AgentFlocks/fix/api-service-builtin-by-d…
xiami762 May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flocks/flocks.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"provider": {},
"mcp": {},
"channels": {},
"plugin": [],
"api_services": {
"greynoise": {
"enabled": false
Expand Down
2 changes: 0 additions & 2 deletions .flocks/plugins/agents/asset-survey/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ tags:
- asset-survey
tools:
- read
- list
- glob
- grep
- edit
- write
- bash
- todoread
- todowrite
- file_search
- websearch
- webfetch
- threatbook_mcp_hrti_query
Expand Down
2 changes: 0 additions & 2 deletions .flocks/plugins/agents/host-forensics/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ temperature: 0.3

tools:
- read
- list
- glob
- grep
- edit
Expand All @@ -44,7 +43,6 @@ tools:
- virustotal_domain_query
- virustotal_file_query
- virustotal_url_query
- file_search
- websearch
- webfetch

Expand Down
2 changes: 0 additions & 2 deletions .flocks/plugins/agents/hrti_threat_intelligence/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ tags:
- threat-intelligence
tools:
- read
- list
- glob
- grep
- edit
Expand All @@ -30,7 +29,6 @@ tools:
- threatbook_mcp_hrti_list_query
- threatbook_mcp_hrti_query
- threatbook_mcp_web_search
- file_search
- websearch
- webfetch
- virustotal_ip_query
Expand Down
3 changes: 0 additions & 3 deletions .flocks/plugins/agents/ndr-analyst/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ temperature: 0.3

tools:
- read
- list
- glob
- grep
- edit
Expand All @@ -26,8 +25,6 @@ tools:
- todoread
- todowrite
- tool_search
- file_search
- codesearch
- websearch
- webfetch
- threatbook_mcp_ip_query
Expand Down
2 changes: 0 additions & 2 deletions .flocks/plugins/agents/phishing-detector/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ temperature: 0.3

tools:
- read
- list
- glob
- grep
- edit
Expand All @@ -24,7 +23,6 @@ tools:
- todoread
- todowrite
- tool_search
- file_search
- websearch
- webfetch
- virustotal_ip_query
Expand Down
2 changes: 0 additions & 2 deletions .flocks/plugins/agents/ti-analyst/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ tags:
- ioc-analysis
tools:
- read
- list
- glob
- grep
- edit
Expand All @@ -42,6 +41,5 @@ tools:
- virustotal_domain_query
- virustotal_url_query
- virustotal_file_query
- file_search
- websearch
- webfetch
2 changes: 0 additions & 2 deletions .flocks/plugins/agents/vul_threat_intelligence/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ tags:
- vulnerability
tools:
- read
- list
- glob
- grep
- edit
Expand All @@ -39,7 +38,6 @@ tools:
- threatbook_mcp_threat_actor_query
- threatbook_mcp_threat_actor_list_query
- threatbook_mcp_hrti_query
- file_search
- websearch
- webfetch
- virustotal_ip_query
Expand Down
8 changes: 0 additions & 8 deletions .flocks/plugins/skills/agent-builder/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ tools:
- read
- grep
- glob
- codesearch
```

**Read-only + network** (e.g. documentation lookup, threat intelligence):
Expand All @@ -152,7 +151,6 @@ tools:
- bash
- websearch
- webfetch
- codesearch
```

**Full execution** (e.g. code generation, refactoring):
Expand Down Expand Up @@ -182,19 +180,13 @@ After generating files, verify:
3. **Directory structure**: ensure files are inside `~/.flocks/plugins/agents/{name}/`, NOT as flat files like `agents/{name}.yaml`
4. **Name uniqueness**: ensure no collision with built-in agents (reserved names: rex, hephaestus, oracle, librarian, explore, general, metis, momus, multimodal-looker, rex-junior, build, plan, compaction, title, summary)
5. **Tool names**: verify every listed tool exists in the current registry; if the repo exposes a `/tools` or tool listing command, check against that instead of relying on memory
6. **Trigger reload**: call the refresh API so Rex recognizes the new agent immediately — **no restart needed**:
```bash
curl -s -X POST http://localhost:8000/api/agents/refresh
```
A successful response looks like `{"count": N}` where N is the total number of loaded agents. If the count increased, the new agent has been picked up correctly.

### 7. Output

After creation, inform the user:
- File paths created (e.g. `~/.flocks/plugins/agents/{name}/agent.yaml` and `prompt.md`)
- Agent name and role
- Can be invoked via `delegate_task(subagent_type="{name}", ...)`
- Takes effect immediately after calling `POST /api/agents/refresh` (no restart needed)

---

Expand Down
2 changes: 2 additions & 0 deletions .flocks/plugins/skills/browser-use/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ browser: not connected — 请确保 Chrome / Chromium / Edge 已打开,然后

然后等待用户进一步指示。如果用户确认已开启后,不要立刻重跑 `flocks browser --doctor`;先执行一次 `flocks browser --setup`,或直接执行 `flocks browser -c 'print(page_info())'` 触发 attach,再运行 `flocks browser --doctor` 做只读确认。

如果用户在 `Windows PowerShell` 中执行 `flocks browser -c`,优先使用单行代码并用分号分隔;多行单引号字符串容易因为换行/转义处理差异而触发假失败。

- 如果 `--setup` / `-c` 成功,或随后 `--doctor` 通过:立即使用 `CDP 直连`,并立刻阅读 `references/cdp-direct.md`
- 如果仍未通过:继续提示用户检查 remote debugging,或提示切到 `agent-browser`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ print(page_info())

- `flocks browser -c '...'` 执行的是一段 Python 代码,不是交互式 REPL;如果希望看到结果,必须显式 `print(...)`。
- 多行代码请直接写成真正的多行 shell 字符串或 heredoc;不要把 `\n` 当字面量塞进单引号参数里。
- 在 `Windows PowerShell` 中,优先把 `flocks browser -c` 写成单行并用分号分隔;多行单引号字符串的换行/转义处理不稳定,容易让代码没有完整传给 Python。

常用 helpers:

Expand Down
86 changes: 86 additions & 0 deletions .flocks/plugins/skills/sangfor-edr-use/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
name: sangfor-edr-use
description: 用于处理深信服 EDR(终端检测与响应)相关任务,通过浏览器(CDP 直连)进行以下任务:终端状态查询、终端概况统计、失陷设备排查、设备运行状态查看等。只要用户提到 深信服 EDR、EDR、sangfor EDR 等需求时,必须先加载本 skill。本 skill 是 EDR 平台操作的唯一决策入口:在未阅读本 skill 前,不要直接使用 browser-use skill。
---

# 深信服 EDR Use

## First

> ⚠️ **EDR 没有开放 API**,所有操作必须通过浏览器(CDP 直连)完成。

进入浏览器模式前,**必须询问用户 EDR URL**(如 `https://edr.example.com/`),然后阅读浏览器模式使用指南。

## 浏览器模式使用指南

请阅读以下文档获取完整流程:
- [references/cdp-workflow.md](references/cdp-workflow.md)

### CDP 模式适用场景

- **首页仪表盘**(`/ui/#/index`):设备 CPU/内存/硬盘使用率、终端概况(在线/离线/服务器/PC)、失陷设备统计
- **威胁资产分析**:已失陷终端列表(需点击"已失陷终端"标签页,不是默认的"全部")
- 页面详情、交互式筛选

### 可用工具脚本

| 脚本路径 | 功能 | 必需参数 |
|---------|------|---------|
| `references/fetch_edr_system_state.py` | 设备状态抓取 | `--url {EDR_URL}` |

脚本位于 skill 目录的 `references/` 下,无硬编码 URL 或敏感信息。

### 执行示例

脚本位于 `<flocks-plugins-root>/skills/sangfor-edr-use/references/fetch_edr_system_state.py`,请按当前平台选择对应命令。

**Windows(PowerShell)**

```powershell
powershell -Command "& '<FLOCKS_VENV>\Scripts\python.exe' '<FLOCKS_PLUGINS>\skills\sangfor-edr-use\references\fetch_edr_system_state.py' --url '{EDR_URL}'"
```

**macOS / Linux(bash / zsh)**

```bash
"<FLOCKS_VENV>/bin/python" "<FLOCKS_PLUGINS>/skills/sangfor-edr-use/references/fetch_edr_system_state.py" --url "{EDR_URL}"
```

**占位符说明**

| 占位符 | Windows 典型值 | macOS/Linux 典型值 |
|--------|---------------|-------------------|
| `<FLOCKS_VENV>` | `D:\Flocks Project\flocks\.venv` | `~/Flocks/flocks/.venv`(取决于实际安装位置) |
| `<FLOCKS_PLUGINS>` | `%USERPROFILE%\.flocks\plugins` | `~/.flocks/plugins` |

> 必须使用 Flocks 虚拟环境(`.venv`)执行;系统 Python 可能缺少依赖。如不确定 venv 位置,先执行 `flocks --version` 或检查 Flocks 安装目录。

## 关键坑点(必须避免)

| 坑 | 原因 | 解法 |
|---|---|---|
| `flocks browser -c js(...)` 返回空文本 | daemon session 指向错误的 tab | 用 Python socket 直连 daemon,通过 `Runtime.evaluate` 在正确 context 执行 |
| `flocks browser -c new_tab()` 后后续命令无响应 | tab 切换导致 session 错位 | 用 `switch_tab(targetId)` 明确切到 EDR tab |
| 多行代码转义失败 | PowerShell 引号嵌套 | 使用 `fetch_edr_system_state.py` 脚本,无需手动转义 |
| EDR 页面数据为空 | EDR 内容在跨域 iframe 中 | 用 CDP direct 方式 attach 到 EDR tab,在正确 frame context 执行 JS |
| 失陷设备数量不匹配 | 读取的是"全部"筛选而非"已失陷"筛选 | 需点击"已失陷终端"标签页获取准确数量 |

## 失陷设备查询 SOP

**问题**:首页仪表盘显示"已失陷 N 台",但威胁资产分析页面默认只列出部分。

**成功路径**:
1. 在 EDR 首页仪表盘确认"已失陷 N 台"的数量
2. 如需具体清单,进入 `威胁资产分析` → 点击 `已失陷终端` 标签页(不是默认的"全部")
3. 只有点击"已失陷终端"标签页,列表数量才会与仪表盘一致

**⚠️ 必须避免**:直接读取威胁资产分析的默认"全部"筛选结果作为失陷设备清单,这是错误的。

## 执行规范

**必须使用 Flocks 虚拟环境(`.venv`)执行 Python 脚本,禁止使用系统 Python。**

- ✅ 正确:`<FLOCKS_VENV>/bin/python`(Unix)或 `<FLOCKS_VENV>\Scripts\python.exe`(Windows)
- ❌ 禁止:`python script.py` / `python3 script.py`(直接调用 PATH 中的 Python)

**原因**:Flocks 虚拟环境包含了所有项目依赖,系统 Python 可能缺少必要的包。完整跨平台示例见上一节"执行示例"。
Loading
Loading