Steampipe
$ steampipe 官方出品 低风险steampipe 将 AWS、GCP、Azure、GitHub、Kubernetes 及本地 CSV/JSON 文件映射为嵌入式 PostgreSQL 外部表。Agent 可直接执行只读 SQL steampipe query "SELECT ..." --output json,免去编写繁琐的 API 分页脚本。
brew install turbot/tap/steampipe steampipe 用一条 --output json SQL 命令即可关联本地文件与在线云 API,在只读资产盘点场景下比多步 MCP 调用更稳健。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
steampipe query 原生支持 --output json、--output csv、--output line 与 --export,传入 SQL 字符串或 .sql 文件即可无头运行。
steampipe query "..." --output jsonand--exportwork non-interactively
面向云 API 的外部表 SQL 查询本质上只读,并复用标准厂商环境变量与 .spc 配置。
- Read-only SQL inventory queries over standard provider credentials
可通过 brew install turbot/tap/steampipe 与 Linux 包安装,但 Windows 需使用 WSL2 且首次运行会下载嵌入式 Postgres。
- Supports macOS and Linux (WSL2 on Windows); downloads embedded Postgres on init
用标准 PostgreSQL SQL 统一 100+ 云与 SaaS API,并自带缓存与跨源 JOIN。
- Single SQL layer across AWS, GCP, GitHub, Kubernetes, and local CSV/JSON
由 Turbot 维护(turbot/steampipe),采用 Apache-2.0 协议。
- Official
turbot/steampiperepository under Apache-2.0
steampipe.io/docs 提供详尽的 CLI 参数与插件表结构文档。
- Complete CLI and table docs at steampipe.io
安全边界、鉴权与放权指南
从 ~/.steampipe/config/*.spc 读取插件连接配置,并自动继承 AWS_*、GITHUB_TOKEN、GOOGLE_APPLICATION_CREDENTIALS 等标准环境变量。
Apache-2.0 开源 CLI 免费;插件查询会消耗对应云服务或 SaaS 的 API 配额。
# Steampipe Agent Rules - Always pass `--output json` (or `--output csv`) on `steampipe query` for structured results. - Use `WHERE` filters and `LIMIT` so plugin API calls do not trigger rate limits. - Check `steampipe plugin list` before querying a provider table.
Agent 高频安全命令配方
只读查询(安全推荐)
steampipe query "SELECT id, title, state FROM github_my_issue LIMIT 10" --output json
通过 SQL 查询已配置的 Steampipe 插件表并输出整洁的 JSON。
steampipe plugin list --output json
查询前先以 JSON 检查已安装的 Steampipe 插件与版本。
核心优势
- + 为 100+ 云与 SaaS API 提供只读 SQL 接口与
--output json输出。 - + 无缝复用
AWS_*、GITHUB_TOKEN等现有凭据并支持响应缓存。
注意事项与踩坑点
- ! 在大规模云账号下执行无过滤查询可能触发上游 API 限流。
- ! 首次启动需初始化嵌入式 PostgreSQL 服务并按需安装插件(
steampipe plugin install)。