Skip to main content

CyberSec-AI Agent — 企业级网络安全智能体系统

基于文章《这就是AI筛选出来的理想型企业级网络安全智能体》构建

架构概览

┌─────────────────────────────────────────────────┐
│  工作台 (Workbench) — 角色选择:红/蓝/紫队         │
├─────────────────────────────────────────────────┤
│  感知层 (Perception) — NLP/多模态输入解析          │
├─────────────────────────────────────────────────┤
│  编排层 (Orchestrator) — LLM驱动/状态机/RPA集成    │
├─────────────────────────────────────────────────┤
│  工具层 (Tools) — 7个专业安全智能体               │
│  ├─ 威胁情报 Agent (THREAT_INTEL)                │
│  ├─ 漏洞扫描 Agent (VULN_SCAN)                   │
│  ├─ 威胁狩猎 Agent (THREAT_HUNT)                 │
│  ├─ 应急响应 Agent (INCIDENT_RESPONSE)           │
│  ├─ 渗透测试 Agent (PEN_TEST)                    │
│  ├─ 报告生成 Agent (REPORT_GEN)                  │
│  └─ 风险评估 Agent (RISK_ASSESS)                 │
├─────────────────────────────────────────────────┤
│  反馈层 (Feedback) — 指标监控/自动恢复/持续优化    │
├─────────────────────────────────────────────────┤
│  支撑层 (Infrastructure) — 多云/容器/向量库       │
└─────────────────────────────────────────────────┘

核心公式:Agent = 推理能力 + 执行能力 + 结果闭环

项目结构

cybersec-agent/
├── core/
│   ├── base.py          # 智能体基类 + 编排器框架
│   ├── perception.py    # 感知层:意图解析、实体抽取
│   └── feedback.py      # 反馈层:指标评估、自动恢复
├── agents/
│   ├── threat_intel.py  # 威胁情报智能体
│   ├── vuln_scanner.py  # 漏洞扫描智能体
│   ├── threat_hunter.py # 威胁狩猎智能体
│   ├── incident_response.py  # 应急响应智能体
│   ├── pen_test.py      # 渗透测试智能体
│   ├── report_gen.py    # 报告生成智能体
│   └── risk_assessor.py # 风险评估智能体
├── main.py              # 入口:编排器主流程
└── README.md

快速开始

cd cybersec-agent
python main.py

各智能体功能

智能体 角色 主要功能
ThreatIntelAgent 蓝 IOC聚合(STIX/TAXII)、ATT&CK映射、APT归因
VulnScanAgent 蓝 资产发现、漏洞扫描、CVSS/EPSS评分
ThreatHuntAgent 蓝 假设驱动狩猎、Sigma/YARA规则生成、横向移动检测
IncidentResponseAgent 蓝 事件分级、证据采集(内存/进程/网络)、遏制清除、复盘报告
PenTestAgent 红 侦察→扫描→利用→后渗透全流程、kill chain覆盖
ReportAgent 紫 多源整合、Markdown/HTML输出、等保2.0合规映射
RiskAssessmentAgent 紫 资产价值×威胁×脆弱性=风险值、风险矩阵、P0-P3优先级

评价指标(来自原文)

  • 任务执行时间:平均耗时 vs 人工对比
  • 自动化覆盖率:可独立完成的任务占比
  • 漏洞修复成功率:执行准确性
  • 漏洞发现数量:威胁检出率
  • 决策正确率:人工审核验证
  • 人工干预频率:自主决策能力
  • 多步骤任务完成率:复杂任务成功率
  • MTTR降低率:直接影响业务连续性

运行示例

from main import CyberSecOrchestrator
from core.base import Role

orch = CyberSecOrchestrator()

# 漏洞扫描流程
result = await orch.run(
    "对 192.168.1.0/24 进行漏洞扫描并评估风险",
    role=Role.BLUE
)

# 渗透测试流程(红队视角)
result = await orch.run(
    "对 example.com 进行渗透测试",
    role=Role.RED
)

Metadata

Release files for cybersec-agent 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for cybersec-agent 0.1.0
File Interpreter ABI Platform Actions
cybersec_agent-0.1.0-py3-none-any.whl Python 3 none any Details for cybersec_agent-0.1.0-py3-none-any.whl

Release files / cybersec_agent-0.1.0-py3-none-any.whl

Download URL cybersec_agent-0.1.0-py3-none-any.whl
Size 40.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
399ade62fa3902b2ceab3cb6d76ca3fd3caac902f5a69e5795d8188b9ed3c7ad
BLAKE2b-256 checksum
How to use checksums
bd5f667f2a0685ddee44442691359062917c452ea67e010426a7fd9063272df5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for cybersec-agent 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page