If you discover a security vulnerability in THCloud CLI Tool, please report it by emailing our security team. We will respond to your report within 24 hours.
-
Never commit sensitive information to the repository
-
Use environment variables for sensitive data:
export FULLNODE_API_INFO="your-token:/ip4/127.0.0.1/tcp/1234/http" export THC_API_KEY="your-api-key"
-
Use configuration files only for non-sensitive settings
-
Keep production configuration files separate and never commit them
- Rotate API keys and tokens regularly
- Use different API keys for development and production
- Set appropriate permissions and access levels
- Never share API keys in logs or error messages
-
Always run security checks before committing:
make lint make test
-
Use the pre-commit hook (automatically installed)
-
Keep dependencies up to date
-
Follow secure coding practices:
- Input validation
- Error handling without exposing sensitive info
- Proper logging (no sensitive data)
The repository includes a pre-commit hook that checks for:
- Sensitive information in code
- Large files (>10MB)
- Code quality (golangci-lint)
- Security issues (gitleaks)
- Always verify checksums of downloaded binaries
- Use HTTPS for downloading
- Set appropriate file permissions
- Keep your system and Go installation up to date
- Run with minimum required permissions
- Use secure network connections (HTTPS/TLS)
- Validate all inputs
- Handle errors securely
- gitleaks - Scan for secrets
- golangci-lint - Code quality and security
- gosec - Go security checker
# Install gitleaks
brew install gitleaks
# Install golangci-lint
brew install golangci-lint
# Install gosec
go install github.com/securego/gosec/v2/cmd/gosec@latest
-
Before Starting Development
git pull go mod tidy make deps
-
During Development
- Use environment variables for secrets
- Follow secure coding guidelines
- Run tests frequently
-
Before Committing
make lint make test # Pre-commit hook will run automatically
-
Before Pushing
# Run full security scan gitleaks detect gosec ./...
-
Protected Branches
main
branch is protected- Requires pull request reviews
- Requires passing CI checks
-
Commit Signing
- Enable GPG signing of commits
- Verify commit signatures
-
Branch Protection Rules
- No force pushes
- Required status checks
- Required security reviews
-
Regular Updates
go list -u -m all go get -u ./... go mod tidy
-
Vulnerability Scanning
- Regular dependency audits
- Automated security updates
- Version pinning for stability
-
Binary Verification
- Check SHA256 checksums
- Verify binary signatures
- Use official releases only
-
Configuration
- Use environment-specific configs
- Validate all settings
- Monitor for misconfigurations
-
Monitoring
- Enable error tracking
- Monitor API usage
- Set up alerts for suspicious activity