Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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…

benson666от 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: curl the Release tarball for their OS, extract, sudo ./INSTALL
  • From source: download the source tarball, CGO_ENABLED=0 go build -o credagent ./cmd/credagent (same for credctl, credreq; on macOS use CGO_ENABLED=1 and build natively), then sudo ./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 with sudo 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, not git

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 be true or false
    • true: 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., 2 for SSH during git push)
  • --writable: Optional, default false. Set true for 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 root with o-w (others cannot write)
  • ✅ Entire directory tree owned by root with o-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
Полный SKILL.md на ClawHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить CredAgent с