CredAgent
БесплатноБез исполняемых скриптовНе проверенProtects file-based credentials with CredAgent, a zero-trust FUSE system that encrypts a secret at rest and serves it back at the same path, so only…
от benson666319 установок в других каталогахОб этом скилле
credagent
Protect file-based credentials using CredAgent — a zero-trust FUSE-based protection system.
Core Workflow
Step 0: Verify CredAgent Is Installed
CredAgent is separate software and is not bundled with this skill. Check it is installed and running before doing anything else:
command -v credctl && credctl version # binary present?
credctl list --json >/dev/null 2>&1 && echo OK # daemon answering?
ls -d /mnt/credagent/shielded 2>/dev/null \
|| ls -d /usr/local/var/credagent/shielded 2>/dev/null # FUSE mount up?
If any check fails, stop — do not attempt to protect files. Tell the user CredAgent has to be installed first and walk them through references/installation.md:
- Prebuilt binary:
curlthe Release tarball for their OS, extract,sudo ./INSTALL - From source: download the source tarball,
CGO_ENABLED=0 go build -o credagent ./cmd/credagent(same forcredctl,credreq; on macOS useCGO_ENABLED=1and build natively), thensudo ./INSTALL - Then bootstrap once:
sudo credagent run --mount /mnt/credagent/shielded/ --socket-dir /run/credagent --baseline-file /var/lib/credagent/baseline.enc --config /usr/local/etc/credagent/engine/config.json --auto-init, Ctrl-C after "ready and serving requests", start the service, and reset the random admin password withsudo credagent init --config ...
This needs root and FUSE, so the user must approve the commands — you cannot do it silently on their behalf. Proceed to Step 1 only once credctl version prints a version and the daemon answers.
Step 1: Find the Credential File
Identify which file needs protection:
| Program | Common Credential Path |
|---|---|
| SSH/Git | ~/.ssh/id_rsa |
| Claude CLI | ~/.claude/settings.json |
| Aliyun CLI | ~/.aliyun/config.json |
| AWS CLI | ~/.aws/credentials |
| Docker | ~/.docker/config.json |
Tip: Check ~/.config/ or ~/.<program>/ directories, or consult the program's documentation.
Step 2: Find the Authorized Program
Determine which program should access the credential:
# Find binary path
which <command>
# Example: which ssh → /usr/bin/ssh
Important:
- For scripts (Python, Node.js, etc.): use the script path, not the interpreter
- For Git SSH access: use
/usr/bin/ssh, notgit
Step 3: Protect the Credential
credctl protect --strategy BASIC --program-permit <binary-path> --measure true|--false <credential-file>
Key parameters:
--program-permit: Required. Path to authorized binary--measure: Required (v0.2.0+). Must betrueorfalsetrue: Verify binary SHA256 (use for stable binaries like/usr/bin/ssh)false: Skip integrity check (use for scripts or frequently-updated binaries)
--open-frequency: Optional. Limit opens per PID (e.g.,2for SSH during git push)--writable: Optional, defaultfalse. Settruefor credentials that need updates (OAuth tokens, cookies)
Examples:
# SSH key - ssh opens twice during git operations
credctl protect --strategy BASIC --program-permit /usr/bin/ssh --measure true --open-frequency 2 ~/.ssh/id_rsa
# API key for script
credctl protect --strategy BASIC --program-permit /path/to/script.py --measure true --open-frequency 1 /path/to/api-key.txt
# OAuth config that needs updates
credctl protect --strategy BASIC --program-permit /usr/bin/aliyun --measure true --writable true ~/.aliyun/config.json
Step 4: Verify Protection
# Check symlink created
ls -la <credential-file>
# Should show: -> /mnt/credagent/shielded/<id>
# List all protected files
credctl list --json
# Inspect specific file details
credctl inspect <id>
Confirm it works: Run the authorized program and check logs:
sudo journalctl -u credagent --since "2 minutes ago" | grep permitted
Step 5: Security Risk Check (Important!)
CredAgent protects the credential file, but not the authorized program or its environment. If the program's directory tree is writable by untrusted users, attackers can inject malicious code without modifying the program itself.
Check program and entire directory tree:
# Check program file
ls -la <program-path>
# Check program directory and ALL contents
ls -laR $(dirname <program-path>)
# Find world-writable files/dirs in the tree
find $(dirname <program-path>) -perm -o+w -ls 2>/dev/null
# Check immutable flag
lsattr <program-path>
Secure configuration:
- ✅ Program owned by
rootwitho-w(others cannot write) - ✅ Entire directory tree owned by
rootwitho-w - ✅ No world-writable files or subdirectories
- ✅ Or use immutable flag on critical files:
sudo chattr +i <file>
Risk scenarios:
| Scenario | Risk | Attack Vector |
|---|---|---|
| Script in user-writable dir | CRITICAL |
Установить CredAgent в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл CredAgent?
Protects file-based credentials with CredAgent, a zero-trust FUSE system that encrypts a secret at rest and serves it back at the same path, so only authorized and SHA256-measured programs can open it. Applicable when a user asks to lock down or harden credential files (SSH keys such as `~/.ssh/id_rsa`, cloud CLI configs such as `~/.aws/credentials` or `~/.aliyun/config.json`, API tokens, OAuth cookies, `.env` secrets), restrict access so only specific authorized binaries or scripts can read them, audit which programs may read secrets, or undo/release existing protection. Triggers on mentions of credential protection, secret hardening, shielding credential files, zero-trust file access, CredAgent, credctl, or preventing AI agents and tools from exfiltrating keys and tokens.
Как установить скилл CredAgent?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл CredAgent запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic