Your Name
|
defb09ef97
|
chore: ctr 全部放行(None),支持 k8s.io 等任意子命令命名空间
|
2026-07-25 15:16:04 +08:00 |
|
Your Name
|
841eb26ea0
|
feat: 新增 sleep/timeout/nohup 命令支持
- sleep: 诊断脚本中常用等待
- timeout: 限制命令执行时间
- nohup: 后台运行保护
|
2026-07-25 14:55:24 +08:00 |
|
Your Name
|
91ab429e5b
|
feat: cat 完全放行,不再限制路径
- 移除 _SAFE_CAT_FILES / _SAFE_CAT_DIRS / _is_safe_cat_path 及相关检查
- cat 在 SHELL_READ_ONLY_COMMANDS 为 None(任意参数均可)
- cat /etc/shadow 等所有路径现在都能正常通过
|
2026-07-25 14:54:19 +08:00 |
|
Your Name
|
00d95c4c5e
|
feat: 全面放开 shell 命令连接符(; && || > >> < 等)
现在 AI Agent 支持在单条命令中使用:
- 管道 (|): crictl ps -a | grep nginx | head -5
- 重定向 (> / >>): journalctl -u kubelet > /tmp/log
- 分号 (;): systemctl status kubelet; df -h
- 逻辑连接符 (&& / ||): df -h && free -m
安全策略:
- FORBIDDEN_TOKENS 清空,所有 shell 操作符均放行
- 新增 _split_into_commands() 按操作符分割命令段
- 新增 _command_has_dangerous_cmds() 扫描所有段中的武器级命令
- 永远拒绝: sh/bash/dash/zsh/dd/format/.../parted 等
- 检查第一条命令的白名单,cat 不安全路径检查
- 只读白名单新增 echo printf cd pwd export test [
|
2026-07-25 14:48:32 +08:00 |
|
Your Name
|
3c3b7abda5
|
feat: rm/cp/mv/chmod/chown 等文件操作命令支持(需人工审批)
- SHELL_WRITE_COMMANDS 新增 rm cp mv chmod chown mkdir touch ln
所有文件操作命令任意参数都需人工审批
- _PIPE_DANGEROUS_TARGETS 移除 rm mv chmod chown,它们现在在
写白名单中审批执行,不再直接拒绝
- 管道分支增加写表子命令不匹配时的回退处理
|
2026-07-25 14:42:30 +08:00 |
|
Your Name
|
8852e6d0ca
|
fix: 允许 AI Agent 使用管道(|)和重定向(>)进行精准排查
之前禁止所有 shell 操作符,导致 crictl ps -a|tail / df -h | grep vda
这类常用诊断管道无法使用。
改动:
1. FORBIDDEN_TOKENS 移除了 | > >> $,保留 ; || && < << `
2. 新增 _has_shell_operators() 检测命令是否需要 shell 执行
3. 新增 _pipe_to_dangerous_target() 阻止管道后执行 sh/bash/rm 等危险命令
4. classify_shell_command 对含管道命令: 只检查管道前 binary 白名单,
子命令不做限制(管道后工具多样,精确分类无意义)
5. execute_command 对 needs_shell=True 的命令用 create_subprocess_shell 执行
6. AI Prompt 第1条安全规则改为允许管道和重定向
7. 分号仍然禁止;cat 不安全路径检查对管道场景同样生效
|
2026-07-25 14:40:12 +08:00 |
|
Your Name
|
b19975c369
|
feat: 移除 etcdutl 引用,增加 ctr/nerdctl 示例,实现 Agent 断点续传
- AI Agent Prompt 移除不存在的 etcdutl 命令引用
- Prompt 增加 containerd(ctr/nerdctl) 和 Linux 基础调优命令示例
- processing_runs 表新增 context_json 字段,保存 Agent 执行上下文
- 每次命令执行后自动保存上下文到 DB
|
2026-07-25 14:34:05 +08:00 |
|
Your Name
|
a5399bd69d
|
chore: 移除不存在的 etcdutl 命令及其相关逻辑和测试
|
2026-07-25 14:23:04 +08:00 |
|
Your Name
|
4b54e49a0d
|
feat: 扩充 shell 命令白名单(含 containerd/ctr/nerdctl),解除 AI Agent 轮数上限
- 新增 ~50 个 Linux 基础命令(du/top/iostat/sar/curl/tcpdump 等)
- 新增 containerd 系列: ctr (containers/images/tasks/snapshots),
nerdctl (ps/logs/inspect/stats 等)
- ip 命令补充 maddr/monitor/tunnel/tuntap 只读操作
- _run_agent_loop 改为 while True 循环,max_steps=0 表示不限轮数
- main.py 传入 max_steps=0,AI Agent 持续诊断直到问题解决
- 更新 Agent system prompt 第7条:明确无轮数上限
|
2026-07-25 14:17:56 +08:00 |
|
cnbugs
|
1f37cd3268
|
fix: etcdutl snapshot 未知子命令应拒绝而非默认当写
修复验证中发现的安全漏洞:
- etcdutl snapshot <bogus> 原会默认返回 write (需审批),
现改为显式拒绝 (ValueError)
- 新增 _ETCDUTL_SNAPSHOT_WRITE = {restore, make} 显式枚举写子命令
- 同时补充 etcdctl defrag 为写操作 (需审批)
验证: 65 项 ad-hoc 检查全部通过, 56 个单元测试通过
|
2026-07-25 13:52:19 +08:00 |
|
cnbugs
|
4f37c65f18
|
feat: Agent 支持 etcdctl/etcdutl 诊断命令
etcd 是 K8S 控制平面的关键组件,缺少 etcd 诊断会导致很多故障无法
继续排查。本次将 etcdctl 和 etcdutl 纳入命令白名单:
只读 (自动执行):
- etcdctl endpoint status/health/hashkv - 端点健康
- etcdctl member list - 成员列表
- etcdctl alarm list - 告警
- etcdctl auth/user/role status|list - 认证与权限查看
- etcdctl check perf/datascale - 性能检查
- etcdctl get/watch - 读取 key
- etcdctl version
- etcdutl snapshot status/hash - 快照检查
- etcdutl version
写操作 (人工审批):
- etcdctl put/del/compact/txn - 数据修改
- etcdctl snapshot save - 保存快照
- etcdctl member add/remove/update - 成员管理
- etcdctl alarm disarm - 解除告警
- etcdctl auth enable/disable - 认证开关
- etcdctl user/role add/delete/grant/revoke - 权限管理
- etcdutl snapshot restore - 恢复快照
实现细节:
- etcdctl/etcdutl 命令支持全局 flag (--endpoints/--cacert 等在子命令前)
- 两段式命令按 (verb, subverb) 组合精确分类,避免 member list (只读)
和 member remove (写) 混淆
- 新增 12 个 etcd 命令分类测试,全部 56 个测试通过
|
2026-07-25 13:50:34 +08:00 |
|
cnbugs
|
32bea0d4ea
|
feat: AI 诊断 Agent 支持执行系统诊断 shell 命令
扩展 Agent 命令工具,除 kubectl 外新增节点宿主机系统诊断命令支持:
- agent_tools.py: 新增 shell 命令白名单分类器 (classify_shell_command)
- 只读白名单: systemctl status/is-active、journalctl、crictl ps/logs、
docker ps/logs、df、free、ss、ip addr、ps、mount、lsmod、dmesg、
ping、nslookup、cat (限 /proc /sys /etc/kubernetes 等安全路径) 等 30+ 命令
- 写白名单: systemctl restart/stop/start/reload 等需人工审批
- 统一分发器 classify_agent_command 按命令前缀路由
- 统一执行入口 execute_command 走 subprocess_exec (无 shell 注入风险)
- ai_agent.py: 更新 AGENT_SYSTEM_PROMPT 告知 AI 两类可用工具及安全规则
- 三个调用点 (初始探测/分类/执行) 切换到统一接口
- main.py: 审批执行处改用 execute_command
- tests: 新增 19 个用例覆盖 shell 命令分类、混合执行、白名单拒绝
- 全部 44 个测试通过
- 前端/README: 文案与文档补充 shell 命令支持说明
安全策略不变: 禁止 shell 操作符/管道/重定向/多命令拼接,
非白名单命令 (rm/vi/apt 等) 直接拒绝。
|
2026-07-25 13:38:48 +08:00 |
|
cnbugs
|
f2254646c1
|
fix: 实现 Agent 修复验证闭环
|
2026-07-25 13:10:21 +08:00 |
|
cnbugs
|
47abfef238
|
fix: 允许 Agent 持续自主诊断
|
2026-07-25 12:50:38 +08:00 |
|
cnbugs
|
fdac1eaffc
|
feat: 持久化诊断历史并修复 Agent 命令执行
|
2026-07-25 12:40:53 +08:00 |
|
cnbugs
|
4f3a7833a0
|
feat: 增加 AI Agent 自主诊断执行模式
|
2026-07-25 12:21:54 +08:00 |
|
cnbugs
|
26ae846501
|
feat: 展示 AI 分析过程
|
2026-07-25 11:47:07 +08:00 |
|
cnbugs
|
8109204843
|
fix: 修复集群不可达时误报100分的严重bug
- 新增 check_connectivity() 连通性预检: kubectl存在性/kubeconfig/API Server连接
- 连不上集群直接返回0分+明确错误信息+排查建议(不再静默跳过)
- 每个检查项kubectl失败时必须报critical问题(不再忽略error)
- 前端: 连接失败时显示红色错误页+错误详情+排查建议+重新诊断按钮
- 智能识别常见错误: connection refused/证书过期/超时/DNS解析失败等
|
2026-07-25 11:07:03 +08:00 |
|
cnbugs
|
7a271f24d4
|
feat: 诊断过程实时进度展示 (SSE流式推送)
- 新增 GET /api/diagnose/stream SSE接口, 每完成一项检查实时推送
- 前端: 诊断中显示步骤进度条+每项检查状态(运行中/完成/问题数)
- 解决诊断过程'卡着'无反馈的体验问题
- 保留 POST /api/diagnose 兼容旧接口
|
2026-07-25 10:56:02 +08:00 |
|
cnbugs
|
d5d7e45ded
|
feat: K8S智能诊断平台 - 一键诊断+AI分析+Web仪表盘
- 后端: FastAPI + kubectl 9大检查项(Pod/Node/Event/Deploy/Service/PVC/资源/网络)
- AI Agent: OpenAI兼容接口自动分析故障根因+多轮追问对话
- 前端: Vue3 + Element Plus 仪表盘, 健康评分, 问题列表, 资源监控
- 一键启动脚本 start.sh
|
2026-07-25 10:32:26 +08:00 |
|