This document outlines the security measures and best practices for the ShelfBridge project.
We use several automated security scanning tools to detect potential security issues:
-
GitHub Actions Security Workflow (
.github/workflows/security-scan.yml)- Runs on every push and pull request
- Scheduled weekly scans
- Uses Gitleaks to detect secrets in code
- Runs npm audit for dependency vulnerabilities
- Checks for hardcoded secrets and sensitive files
-
Pre-commit Hooks (
.husky/pre-commit)- Runs before each commit
- Scans staged files for secrets
- Prevents accidental commit of sensitive data
-
Gitleaks Configuration (
.gitleaks.toml)- Customized rules for ShelfBridge
- Allowlist for false positives
- Project-specific secret patterns
- API keys and tokens
- Passwords and secrets
- AWS access keys
- Private keys and certificates
- Configuration files with sensitive data
- Dependency vulnerabilities
-
Never commit sensitive data
- Use
config.yaml.examplefor templates - Keep actual
config.yamlin.gitignore - Use environment variables for secrets
- Use
-
Environment Variables
# Instead of hardcoding in config.yaml export ABS_TOKEN="your_token_here" export HARDCOVER_TOKEN="your_token_here"
-
Configuration Template
# config.yaml.example users: - id: 'user1' abs_url: 'https://your-abs-instance.com' abs_token: '${ABS_TOKEN}' # Use environment variable hardcover_token: '${HARDCOVER_TOKEN}'
-
Input Validation
- Validate all user inputs
- Sanitize configuration data
- Use parameterized queries
-
Error Handling
- Don't expose sensitive information in error messages
- Log errors without revealing secrets
- Use appropriate error codes
-
Dependencies
- Regularly update dependencies
- Run
npm auditregularly - Review security advisories
If you discover a security vulnerability:
- DO NOT create a public issue
- DO email security@shelfbridge.com (if available)
- DO create a private security advisory on GitHub
- DO provide detailed reproduction steps
Before committing code:
- No hardcoded secrets
- No API keys in code
- Configuration files properly ignored
- Dependencies up to date
- No sensitive data in logs
- Input validation in place
- Error handling secure
- Security scans run automatically
- Results available in GitHub Actions
- SARIF reports uploaded for analysis
- Weekly scheduled scans
- Pre-commit hooks prevent issues
- Gitleaks: Secret detection
- npm audit: Dependency vulnerability scanning
- GitHub Actions: Automated scanning
- Husky: Pre-commit hooks
- SARIF: Standardized security reports