forked from claude-did-this/claude-hub
2.3 KiB
2.3 KiB
Secure Claude Webhook CLI
A more secure version of the CLI that uses encrypted configuration instead of environment variables.
Why Secure Version?
- No Environment Variables: Credentials are not exposed in process lists or logs
- Encrypted Storage: Configuration is encrypted with AES-256-GCM
- Password Protection: Access requires a password to decrypt credentials
- Proper Regex Escaping: Handles special characters in secrets correctly
Setup
-
Install dependencies:
npm install -
Initialize secure configuration:
node cli/secure-config.jsYou'll be prompted for:
- API URL (default: https://claude.jonathanflatt.org)
- GitHub Token
- Webhook Secret
- A password to encrypt the configuration
Usage
# Basic usage
./claude-webhook-secure myrepo "Your command"
# With owner
./claude-webhook-secure owner/repo "Your command"
# Pull request
./claude-webhook-secure myrepo "Review PR" -p -b feature-branch
How It Works
- First Run: Prompts for credentials and password
- Encryption: Stores credentials in
~/.claude-webhook/config.enc - Subsequent Runs: Prompts for password to decrypt credentials
- No Environment Variables: All credentials are loaded from encrypted file
Security Features
- AES-256-GCM encryption with authenticated encryption
- PBKDF2 key derivation with 100,000 iterations
- Random salt and IV for each encryption
- File permissions set to 0600 (user read/write only)
- No plaintext storage of credentials
Comparison with Standard CLI
| Feature | Standard CLI | Secure CLI |
|---|---|---|
| Credential Storage | Environment variables | Encrypted file |
| Password Protection | No | Yes |
| Process List Exposure | Yes | No |
| Log Exposure Risk | High | Low |
| Special Character Handling | Basic | Robust |
Migration from Standard CLI
If you have a .env file:
- Run the secure config setup
- Enter your credentials from the
.envfile - Delete the
.envfile - Use
claude-webhook-secureinstead ofclaude-webhook
Troubleshooting
- Forgot Password: Delete
~/.claude-webhook/config.encand run setup again - Wrong Password: You'll get an error - try again with correct password
- Permission Denied: Check file permissions on
~/.claude-webhook/