360 Secure SkillHub
360 安全技能中心

Infisical Reader

通过 Infisical 通用认证 REST API 获取访问令牌,列出项目,并按工作区与环境读取全部密钥或单个密钥原始值;附带 Python 脚本,凭据来自宿主环境文件,令牌短时效需每次会话重新认证。

分类:安全
achikochikorogaru
achikochikorogaru
热度 14.96
最近更新 2026-06-14 16:52:20

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add achikochikorogaru/infisical-reader
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
infisical-reader
description
Direct REST API reader for Infisical secrets. Lightweight, no middleware. Use when the agent needs to fetch API keys or credentials from Infisical.

Infisical

Read secrets from Infisical via REST API.

User Setup

  1. Create Machine Identity: Organization → Access Control → Machine Identities.
  2. Add Universal Auth to the identity → save Client ID + Client Secret.
  3. Grant identity access to each project: Project Settings → Access Control → Identities → add as Member.
  4. Store credentials in ~/.openclaw/.env:
INFISICAL_CLIENT_ID=<client-id>
INFISICAL_CLIENT_SECRET=***

Agent Workflow

  1. POST /api/v1/auth/universal-auth/login → {"clientId":"...","clientSecret":"***"} → accessToken
  2. GET /api/v1/workspace → list projects (id, slug, environments)
  3. GET /api/v3/secrets/raw?workspaceId=<id>&environment=<env>&secretPath=/ → secrets

Script

# List projects
python3 {baseDir}/scripts/infisical.py --list-projects

# Read all secrets
python3 {baseDir}/scripts/infisical.py -w <workspaceId> -e prod

# Get single secret (raw value)
python3 {baseDir}/scripts/infisical.py -w <wid> -e prod -k OPENAI_API_KEY --raw

Requires INFISICAL_CLIENT_ID and INFISICAL_CLIENT_SECRET in ~/.openclaw/.env.

Notes

  • Use workspaceId (not projectSlug) — slug may not work in all API versions.
  • Tokens are short-lived; re-authenticate each session.
  • Too many failed logins temporarily locks Universal Auth.
  • Free tier: up to 5 Machine Identities.
  • Detailed API reference: see {baseDir}/references/api.md