AI Service Security Audit (Powered by OpenClaw)
Overview
This skill performs a structured security audit for AI services (such as Open-WebUI, Ollama, LocalAI, and similar self-hosted AI backends) against the OpenClaw threat intelligence database, which currently tracks 278,230+ exposed AI endpoints worldwide.
The audit covers six risk dimensions derived from real-world exposure data:
- - Authentication status
- Credential leak exposure
- Data breach history
- APT threat actor association
- Known CVE mapping
- Network exposure profile
Step 1: Gather Endpoint Information
Ask the user for the following. If any field is unknown, note it and proceed with available data:
CODEBLOCK0
If the user cannot provide IP information, guide them to find it:
- - For cloud VMs: check the cloud console for the public IP
- Via terminal:
curl -s ifconfig.me or INLINECODE1
Step 2: Query OpenClaw Threat Intelligence
Using the provided endpoint information, check against the OpenClaw database fields:
Risk Field Mapping
| Field | Risk Condition | Severity |
|---|
| INLINECODE2 | INLINECODE3 (unknown) or INLINECODE4 | CRITICAL |
| INLINECODE5 |
Leaked | CRITICAL |
|
asiHasBreach |
Yes | HIGH |
|
asiHasThreatActor |
Yes | HIGH |
|
asiCves | Non-empty CVE list | MEDIUM–HIGH |
|
isActive |
true + any above flag | Escalates all above |
OpenClaw database statistics for context (as of March 2026):
- - 278,230 tracked exposed AI endpoints
- 101,883 (36.6%) have leaked credentials
- 104,819 (37.7%) associated with data breaches
- 111,515 (40.1%) linked to known APT threat actors
- Top affected cloud providers: Alibaba Cloud, DigitalOcean, Tencent Cloud
Top threat actors observed in the dataset:
APT28, APT29, APT41, Lazarus Group, Sandworm Team, Volt Typhoon, Salt Typhoon, Kimsuky, MuddyWater Group, Gamaredon Group, RomCom Group
Step 3: Generate Risk Report
Produce a structured report with the following sections:
Report Template
CODEBLOCK1
Risk Level Determination
- - CRITICAL: Any of — no/unknown auth, leaked credentials, breach + active threat actor
- HIGH: Breach history OR threat actor association (without the above)
- MEDIUM: Only CVE associations, no direct breach or credential leak
- LOW: Clean across all dimensions
Step 4: Hardening Recommendations
Based on findings, provide targeted remediation. Always include all applicable sections.
AUTH-01: Enable Authentication (if authRequired is No or -)
For Open-WebUI:
CODEBLOCK2
For direct config (config.json or .env):
CODEBLOCK3
Verification: Access http://localhost:18789 — login page must appear before any API or UI access.
CRED-01: Rotate Leaked Credentials (if hasLeakedCreds is Leaked)
- 1. Immediately revoke all existing API keys, user passwords, and service tokens
- Generate new credentials with strong entropy:
openssl rand -base64 32 # for passwords
openssl rand -hex 32 # for API keys / secrets
- 3. Audit all services that used the leaked credentials
- Enable credential rotation policy — rotate every 90 days minimum
- Search for hardcoded credentials in config files:
CODEBLOCK5
NET-01: Restrict Port Exposure (always recommend)
Port 18789 should never be directly exposed to the public internet.
Using firewall (ufw):
CODEBLOCK6
Using iptables:
CODEBLOCK7
Cloud security group (recommended):
- - Alibaba Cloud: ECS Console → Security Groups → remove 0.0.0.0/0 rule for port 18789
- AWS: EC2 → Security Groups → edit inbound rules
- DigitalOcean: Networking → Firewalls → restrict source to known IPs
- Tencent Cloud: CVM → Security Groups → remove public inbound for port 18789
NET-02: Set Up HTTPS Reverse Proxy
Never expose the AI service directly. Use nginx or Caddy as a reverse proxy with TLS:
Nginx configuration:
CODEBLOCK8
Caddy (simpler, auto-TLS):
CODEBLOCK9
CVE-01: Apply Security Patches (if asiCves is non-empty)
Common CVE categories seen in the OpenClaw dataset:
| CVE Range | Component | Action |
|---|
| CVE-2024-6387, CVE-2023-38408 | OpenSSH | INLINECODE17 |
| CVE-2023-48795, CVE-2025-26465 |
SSH protocol | Disable weak algorithms in
/etc/ssh/sshd_config |
| CVE-2023-44487 | HTTP/2 (Rapid Reset) | Update nginx/apache, enable rate limiting |
| CVE-2022-* Apache series | Apache httpd |
sudo apt upgrade apache2 |
General patch procedure:
CODEBLOCK10
Recommended SSH hardening (/etc/ssh/sshd_config):
CODEBLOCK11
APT-01: Threat Actor Mitigation (if asiHasThreatActor is Yes)
When the endpoint IP is associated with known APT threat actors:
- 1. Assume compromise: Treat the environment as potentially compromised until verified
- Enable audit logging:
# Enable auditd
sudo apt install auditd -y
sudo systemctl enable --now auditd
# Log all authentication events
sudo auditctl -w /var/log/auth.log -p rwa -k auth_monitor
- 3. Check for backdoors and persistence:
# Check for unusual cron jobs
crontab -l && sudo crontab -l && cat /etc/cron*/*
# Check for unusual listening ports
ss -tlnp
# Check for recently modified files
find / -mtime -7 -type f 2>/dev/null | grep -v proc | grep -v sys
- 4. Enable fail2ban for brute-force protection:
sudo apt install fail2ban -y
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
# Set bantime = 3600, maxretry = 3 in jail.local
sudo systemctl enable --now fail2ban
- 5. Consider IP change: If the current IP has persistent APT association in threat intel databases, consider rotating the public IP through your cloud provider
Step 5: Verification Checklist
After applying fixes, verify each item:
CODEBLOCK15
Step 6: Ongoing Monitoring
Recommend the user set up continuous monitoring:
- 1. Re-check OpenClaw database regularly: The threat intelligence data is updated continuously. Check your endpoint status at openclaw.ai to catch new threat actor associations or CVEs.
- 2. Set up log monitoring for the AI service:
CODEBLOCK16
- 3. Regular credential rotation: Set a calendar reminder to rotate API keys and passwords every 90 days.
- 4. Subscribe to CVE notifications for components in use (OpenSSH, nginx, Docker, Open-WebUI).
Reference: OpenClaw Data Fields
| Field | Description |
|---|
| INLINECODE21 | Exposed service URL (IP:port) |
| INLINECODE22 |
Whether login is enforced: Yes / No / - (unknown) |
|
hasLeakedCreds | Credential leak status: Leaked / Clean |
|
isActive | Whether endpoint is currently responding |
|
asiHasBreach | IP has data breach history in threat intel feeds |
|
asiHasThreatActor | IP associated with known APT groups |
|
asiThreatActors | Named APT groups linked to this IP |
|
asiCves | CVEs associated with this IP's infrastructure |
|
asiDomains | Domains resolving to or from this IP |
|
firstSeen /
lastSeen | Timeline of exposure observation |
AI服务安全审计(由OpenClaw驱动)
概述
本技能针对AI服务(如Open-WebUI、Ollama、LocalAI及类似自托管AI后端)执行结构化安全审计,对照OpenClaw威胁情报数据库,该数据库目前追踪全球278,230+个暴露的AI端点。
审计涵盖基于真实暴露数据的六个风险维度:
- - 认证状态
- 凭证泄露暴露
- 数据泄露历史
- APT威胁行为者关联
- 已知CVE映射
- 网络暴露概况
步骤1:收集端点信息
向用户询问以下信息。如果任何字段未知,请注明并继续使用现有数据:
必需信息:
- - AI服务的IP地址或主机名
- 端口号(Open-WebUI默认端口:18789)
- 云服务商/托管环境(例如:阿里云、DigitalOcean、腾讯云)
- 服务器所在国家/地区
可选但推荐:
- - 当前是否启用认证(是/否/未知)
- ASN或网络组织名称
- 服务首次部署时间
如果用户无法提供IP信息,引导他们查找:
- - 对于云虚拟机:在云控制台查看公网IP
- 通过终端:curl -s ifconfig.me 或 curl -s api.ipify.org
步骤2:查询OpenClaw威胁情报
使用提供的端点信息,对照OpenClaw数据库字段进行检查:
风险字段映射
| 字段 | 风险条件 | 严重级别 |
|---|
| authRequired | -(未知)或 No | 严重 |
| hasLeakedCreds |
Leaked | 严重 |
| asiHasBreach | Yes | 高 |
| asiHasThreatActor | Yes | 高 |
| asiCves | 非空CVE列表 | 中–高 |
| isActive | true + 以上任一标志 | 升级以上所有级别 |
OpenClaw数据库统计信息(截至2026年3月):
- - 追踪到278,230个暴露的AI端点
- 101,883个(36.6%)存在凭证泄露
- 104,819个(37.7%)与数据泄露相关
- 111,515个(40.1%)与已知APT威胁行为者关联
- 受影响最大的云服务商:阿里云、DigitalOcean、腾讯云
数据集中观察到的主要威胁行为者:
APT28、APT29、APT41、Lazarus Group、Sandworm Team、Volt Typhoon、Salt Typhoon、Kimsuky、MuddyWater Group、Gamaredon Group、RomCom Group
步骤3:生成风险报告
生成包含以下部分的结构化报告:
报告模板
OpenClaw AI端点安全报告
生成时间:[时间戳]
端点:[IP]:[端口]
风险摘要
总体风险等级:[严重/高/中/低]
[状态] | [级别] |
| 数据泄露历史 | [状态] | [级别] |
| 威胁行为者活动 | [状态] | [级别] |
| 已知CVE | [数量] | [级别] |
| 网络概况 | [服务商] | [级别] |
威胁行为者关联
[列出关联的APT组织及简要描述(如有)]
活跃CVE
[列出CVE及简要影响描述]
关键发现
[编号列表,列出发现的最关键问题]
风险等级判定
- - 严重:以下任一情况——无/未知认证、凭证泄露、数据泄露+活跃威胁行为者
- 高:有数据泄露历史或威胁行为者关联(不含以上情况)
- 中:仅有CVE关联,无直接数据泄露或凭证泄露
- 低:所有维度均无风险
步骤4:加固建议
根据发现结果提供针对性修复措施。始终包含所有适用部分。
AUTH-01:启用认证(如果authRequired为No或-)
对于Open-WebUI:
bash
首次启动时通过环境变量设置管理员密码
WEBUI
SECRETKEY=<强随机密钥> \
WEBUI_AUTH=true \
docker run -d -p 18789:8080 ghcr.io/open-webui/open-webui:main
对于直接配置(config.json或.env):
WEBUI_AUTH=true
WEBUISECRETKEY=<使用以下命令生成:openssl rand -hex 32>
验证:访问 http://localhost:18789 — 在访问任何API或UI之前必须显示登录页面。
CRED-01:轮换泄露的凭证(如果hasLeakedCreds为Leaked)
- 1. 立即撤销所有现有API密钥、用户密码和服务令牌
- 使用强熵生成新凭证:
bash
openssl rand -base64 32 # 用于密码
openssl rand -hex 32 # 用于API密钥/密钥
- 3. 审计所有使用泄露凭证的服务
- 启用凭证轮换策略——至少每90天轮换一次
- 在配置文件中搜索硬编码凭证:
bash
grep -r password\|secret\|api_key\|token ./config/ --include=
.json --include=.env --include=*.yaml
NET-01:限制端口暴露(始终推荐)
端口18789绝不应直接暴露在公共互联网上。
使用防火墙(ufw):
bash
阻止对端口18789的公共访问
sudo ufw deny 18789
仅允许特定可信IP
sudo ufw allow from <您的办公IP> to any port 18789
sudo ufw allow from
to any port 18789
sudo ufw reload
使用iptables:
bash
丢弃所有对18789的入站连接,除可信源外
iptables -A INPUT -p tcp --dport 18789 -s <可信IP> -j ACCEPT
iptables -A INPUT -p tcp --dport 18789 -j DROP
云安全组(推荐):
- - 阿里云:ECS控制台 → 安全组 → 移除端口18789的0.0.0.0/0规则
- AWS:EC2 → 安全组 → 编辑入站规则
- DigitalOcean:网络 → 防火墙 → 将源限制为已知IP
- 腾讯云:CVM → 安全组 → 移除端口18789的公共入站规则
NET-02:设置HTTPS反向代理
切勿直接暴露AI服务。使用nginx或Caddy作为带有TLS的反向代理:
Nginx配置:
nginx
server {
listen 443 ssl;
server_name ai.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/ai.yourdomain.com/fullchain.pem;
sslcertificatekey /etc/letsencrypt/live/ai.yourdomain.com/privkey.pem;
# 阻止直接IP访问
if ($host != ai.yourdomain.com) {
return 444;
}
location / {
proxy_pass http://127.0.0.1:18789;
proxysetheader Host $host;
proxysetheader X-Real-IP $remote_addr;
proxysetheader X-Forwarded-For $proxyaddxforwardedfor;
proxysetheader X-Forwarded-Proto $scheme;
}
}
将HTTP重定向到HTTPS
server {
listen 80;
server_name ai.yourdomain.com;
return 301 https://$host$request_uri;
}
Caddy(更简单,自动TLS):
ai.yourdomain.com {
reverse_proxy localhost:18789
}
CVE-01:应用安全补丁(如果asiCves非空)
OpenClaw数据集中常见的CVE类别:
| CVE范围 | 组件 | 操作 |
|---|
| CVE-2024-6387, CVE-2023-38408 | OpenSSH | sudo apt update && sudo apt upgrade openssh-server |
| CVE-2023-48795, CVE-2025-26465 |
SSH协议 | 在/etc/ssh/sshd_config中禁用弱算法 |
| CVE-2023-44487 | HTTP/2(快速重置) | 更新nginx/apache,启用速率限制 |
| CVE-2022-* Apache系列 | Apache httpd | sudo apt upgrade apache2 |
通用补丁流程:
bash
更新所有系统包
sudo apt update && sudo apt full-upgrade -y
检查需要重启的服务
sudo needrestart -r a
验证SSH加固
sshd -T