RAD Security MCP Server
官方與RAD Security平台互動,該平台為Kubernetes和雲端環境提供AI驅動的安全洞察。
文件
RAD Security MCP 伺服器
一個適用於 RAD Security 的模型上下文協定 (MCP) 伺服器,為 Kubernetes 和雲端環境提供 AI 驅動的安全洞察。
安裝
npm install @rad-security/mcp-server
使用方式
先決條件
- Node.js 20.x 或更高版本
環境變數
使用 Rad Security 的 MCP 伺服器需要設定以下環境變數:
RAD_SECURITY_ACCESS_KEY_ID="your_access_key"
RAD_SECURITY_SECRET_KEY="your_secret_key"
RAD_SECURITY_ACCOUNT_ID="your_account_id"
選用環境變數:
RAD_SECURITY_TENANT_ID="your_tenant_id" # Optional: If not provided, will be fetched automatically from the account
選用:篩選工具組
您可以使用以下環境變數來控制 MCP 伺服器公開哪些工具組:
INCLUDE_TOOLKITS:要包含的工具組逗號分隔清單(僅啟用這些工具組)EXCLUDE_TOOLKITS:要排除的工具組逗號分隔清單(除這些之外全部啟用)
可用工具組:
containers- 容器清單操作clusters- Kubernetes 叢集操作identities- 身分管理操作audit- 稽核日誌操作images- 容器映像操作kubeobject- Kubernetes 資源操作misconfigs- 錯誤設定偵測runtime- 執行階段分析操作findings- 安全發現操作cves- CVE 資料庫操作inbox- 收件匣項目操作workflows- 工作流程執行操作knowledge_base- 知識庫搜尋操作radql- rad 資料平台查詢介面
範例:
# Only enable workflow toolkit
INCLUDE_TOOLKITS="workflows"
# Enable only containers and images toolkits
INCLUDE_TOOLKITS="containers,images"
# Exclude workflow toolkit (enable all others)
EXCLUDE_TOOLKITS="workflows"
# Exclude runtime toolkit
EXCLUDE_TOOLKITS="runtime"
注意:如果設定了 INCLUDE_TOOLKITS,則會忽略 EXCLUDE_TOOLKITS。
無需驗證的操作
您也可以在不驗證的情況下使用少數操作:
- 列出 CVE
- 取得特定 CVE 的詳細資訊
- 取得最新 30 個 CVE
- 列出 Kubernetes 資源錯誤設定政策
在 Cursor IDE 中
在 Cursor IDE 中設定環境變數相當麻煩。
因此,您可以使用以下 start.sh 腳本來啟動伺服器。
./start.sh
請先在 start.sh 腳本中設定環境變數!
在 Claude Desktop 中
您可以使用以下設定在 Claude Desktop 中啟動伺服器。
{
"mcpServers": {
"rad-security": {
"command": "npx",
"args": ["-y", "@rad-security/mcp-server"],
"env": {
"RAD_SECURITY_ACCESS_KEY_ID": "<your-access-key-id>",
"RAD_SECURITY_SECRET_KEY": "<your-secret-key>",
"RAD_SECURITY_ACCOUNT_ID": "<your-account-id>"
}
}
}
}
若要篩選工具組,請將 INCLUDE_TOOLKITS 或 EXCLUDE_TOOLKITS 新增至 env:
{
"mcpServers": {
"rad-security": {
"command": "npx",
"args": ["-y", "@rad-security/mcp-server"],
"env": {
"RAD_SECURITY_ACCESS_KEY_ID": "<your-access-key-id>",
"RAD_SECURITY_SECRET_KEY": "<your-secret-key>",
"RAD_SECURITY_ACCOUNT_ID": "<your-account-id>",
"EXCLUDE_TOOLKITS": "workflows"
}
}
}
作為 Docker 容器 - 使用可串流的 HTTP
docker build -t rad-security/mcp-server .
docker run \
-e TRANSPORT_TYPE=streamable \
-e RAD_SECURITY_ACCESS_KEY_ID=your_access_key \
-e RAD_SECURITY_SECRET_KEY=your_secret_key \
-e RAD_SECURITY_ACCOUNT_ID=your_account_id \
-p 3000:3000 \
rad-security/mcp-server
使用工具組篩選器:
docker run \
-e TRANSPORT_TYPE=streamable \
-e RAD_SECURITY_ACCESS_KEY_ID=your_access_key \
-e RAD_SECURITY_SECRET_KEY=your_secret_key \
-e RAD_SECURITY_ACCOUNT_ID=your_account_id \
-e INCLUDE_TOOLKITS=workflows,containers \
-p 3000:3000 \
rad-security/mcp-server
作為 Docker 容器 - 使用 SSE(已棄用)
注意: SSE 傳輸現已棄用,建議改用可串流的 HTTP。為了向下相容仍支援 SSE,但建議改用可串流的 HTTP。
docker build -t rad-security/mcp-server .
docker run \
-e TRANSPORT_TYPE=sse \
-e RAD_SECURITY_ACCESS_KEY_ID=your_access_key \
-e RAD_SECURITY_SECRET_KEY=your_secret_key \
-e RAD_SECURITY_ACCOUNT_ID=your_account_id \
-p 3000:3000 \
rad-security/mcp-server
功能
-
帳戶清單
- 列出叢集及其詳細資訊*
-
容器清單
- 列出容器及其詳細資訊*
-
安全發現
- 列出並分析安全發現*
-
執行階段安全
- 取得執行中容器的處理程序樹*
- 取得執行中容器的執行階段基準*
- 分析執行中容器的處理程序行為*
-
網路安全
- 監控 HTTP 請求*
- 追蹤網路連線*
- 分析網路模式*
-
身分與存取
- 列出身分*
- 取得身分詳細資訊*
-
稽核
- 列出誰曾進入 Pod 的 Shell*
-
雲端安全
- 列出並監控雲端資源*
- 取得資源詳細資訊與合規狀態*
-
映像
- 取得 SBOM*
- 列出映像及其漏洞*
- 取得漏洞最多的映像*
-
Kubernetes 物件
- 取得特定 Kubernetes 資源的詳細資訊*
- 列出 Kubernetes 資源*
- 列出 Kubernetes 資源錯誤設定政策*
-
CVE
- 列出 CVE
- 取得特定 CVE 的詳細資訊
- 取得最新 30 個 CVE
-
RadQL(進階查詢)
- 列出可查詢的可用資料類型(容器、發現、kubernetes_resources 等)*
- 取得特定資料類型的結構描述/中繼資料*
- 列出篩選欄位的可能值*
- 使用篩選、搜尋和聚合執行 RadQL 查詢*
- 從結構化條件以程式化方式建構查詢*
- 平行執行多個查詢*
* - 需要驗證和 Rad Security 帳戶。
開發
# Install dependencies
npm install
# Run type checking
npm run type-check
# Run linter
npm run lint
# Build
npm run build
授權
MIT 授權 - 詳情請參閱 LICENSE 檔案