This document outlines the security measures implemented in LLMCal and best practices for secure usage.
- No Hardcoded Credentials: All API keys and sensitive data have been removed from source code
- Environment Variable Support: Secure loading from
.envfiles and system environment variables - PopClip Integration: Secure credential handling through PopClip's encrypted options system
- Credential Validation: Format validation and strength checking for API keys
- Log Sanitization: Automatic removal of sensitive data from all log entries
- API Request/Response Logging: Safe logging with credential redaction
- Structured Logging: Multiple log levels (DEBUG, INFO, WARN, ERROR, CRITICAL)
- Log Rotation: Automatic log file rotation with size limits
- Restricted Permissions: Log files created with 600 permissions (owner read/write only)
- Temporary Files: Secure creation and cleanup of temporary files
- File Permissions: Automatic setting of restrictive permissions on sensitive files
- Secure Cleanup: Overwrite temporary files with random data before deletion
- Format Validation: Validation of API key formats and credential strength
- Dependency Checking: Verification of required credentials based on features used
- Connectivity Testing: Optional API connectivity validation
// Config.json - INSECURE
{
"zoom_account_id": {
"default": "COoBTtIEQ-ynFT_zpUL6jw" // β Hardcoded credential
}
}# test_cases.sh - INSECURE
export POPCLIP_OPTION_ANTHROPIC_API_KEY="sk-ant-api03-37F5..." # β Hardcoded API key# calendar.sh - INSECURE
log "API εεΊ: $RESPONSE" # β Logs sensitive API responses// Config.json - SECURE
{
"zoom_account_id": {
"description": "Enter your Zoom Account ID",
"secure": true // β
No default values, marked as secure
}
}# test_cases.sh - SECURE
if [ -z "$ANTHROPIC_API_KEY" ]; then
log "Error: Missing ANTHROPIC_API_KEY environment variable" # β
Environment variable required
exit 1
fi# calendar.sh - SECURE
log_api_response "$http_code" "" "$(sanitize_json_response "$response")" # β
Sanitized logging# Run the security setup wizard
./setup_security.sh-
Create Environment File
cp .env.example .env chmod 600 .env
-
Configure API Keys
# Edit .env file nano .env # Add your credentials: ANTHROPIC_API_KEY=your_actual_api_key_here ZOOM_ACCOUNT_ID=your_zoom_account_id ZOOM_CLIENT_ID=your_zoom_client_id ZOOM_CLIENT_SECRET=your_zoom_client_secret
-
Validate Configuration
source LLMCal.popclipext/lib/config_validator.sh run_validation true
ANTHROPIC_API_KEY: Your Anthropic Claude API key
ZOOM_ACCOUNT_ID: Your Zoom account IDZOOM_CLIENT_ID: Your Zoom app client IDZOOM_CLIENT_SECRET: Your Zoom app client secretZOOM_EMAIL: Email associated with Zoom accountZOOM_NAME: Display name for Zoom meetings
LOG_LEVEL: Logging level (DEBUG, INFO, WARN, ERROR, CRITICAL) - default: INFOMAX_LOG_SIZE: Maximum log file size in bytes - default: 10MBMAX_LOG_FILES: Number of rotated log files to keep - default: 5
- Use environment variables or PopClip secure options for credentials
- Set restrictive file permissions (600) on sensitive files
- Regularly rotate API keys
- Monitor log files for security events
- Keep the extension updated
- Use the provided security validation tools
- Hardcode credentials in source files
- Commit
.envfiles to version control - Share log files containing sensitive data
- Use weak or predictable API keys
- Run the extension with elevated privileges unnecessarily
The security logging system automatically:
- Redacts API keys, tokens, and credentials from all log entries
- Sanitizes email addresses (partial redaction)
- Removes long alphanumeric strings that might be credentials
- Logs security events with appropriate severity levels
- DEBUG: Detailed information for troubleshooting
- INFO: General information about operations
- WARN: Warning conditions that should be noted
- ERROR: Error conditions that need attention
- CRITICAL: Critical issues that require immediate action
The system automatically validates:
- API key format correctness
- Credential strength and complexity
- Required vs optional credential dependencies
- File permission security
- Configuration completeness
# Run comprehensive security check
source LLMCal.popclipext/lib/config_validator.sh
run_validation trueIf you suspect a security issue:
-
Immediate Actions
- Rotate all affected API keys immediately
- Check log files for suspicious activity
- Review recent extension usage
-
Investigation
- Check git history for accidentally committed credentials
- Scan all files for hardcoded secrets
- Review access logs from API providers
-
Prevention
- Update to latest version with security fixes
- Re-run security validation
- Review and update security practices
- v2.0: Comprehensive security overhaul
- Removed all hardcoded credentials
- Implemented secure logging with sanitization
- Added configuration validation
- Added secure file handling
- Created security utilities library
- Monitor for security updates
- Review CHANGELOG.md for security-related changes
- Re-run security validation after updates
For security-related questions or to report security issues:
- Check this documentation first
- Run the built-in security validation tools
- Review log files for error messages
- Open an issue in the project repository (for non-sensitive issues)
Before using LLMCal in production:
- Removed all hardcoded credentials from source code
- Created
.envfile with proper permissions (600) - Configured all required API keys
- Ran security validation successfully
- Verified logging sanitization is working
- Added
.envto.gitignore - Set up log rotation and monitoring
- Reviewed file permissions on all extension files
- Tested API connectivity with validation tools
- Documented credential rotation procedures
Note: Security is an ongoing process. Regularly review and update your security practices, credentials, and keep the extension updated with the latest security improvements.