dontrm is a safety wrapper around the rm command designed to prevent catastrophic system deletions. Security is our highest priority.
| Version | Supported |
|---|---|
| Latest | ✅ |
| < 1.0 | ❌ |
dontrm blocks these dangerous patterns:
-
Top-level system paths
/,/bin,/boot,/dev,/etc,/lib,/lib64,/opt,/proc,/root,/run,/sbin,/srv,/sys,/usr,/var- Example:
dontrm -rf /→ BLOCKED
-
Wildcard operations on system directories
/usr/bin/*,/etc/*, etc.- Example:
dontrm -rf /etc/*→ BLOCKED
-
Recursive glob patterns
/**/*and similar patterns that expand to system paths- Example:
dontrm /**/*→ BLOCKED
dontrm is not a comprehensive safety solution. It does NOT protect against:
- User home directories:
/home/usercan be deleted (intentional design) - Data directories:
/data,/mnt,/mediawildcards are allowed - Specific files:
/etc/passwd(individual files in system dirs) - Subdirectories:
/usr/bin/go/*(subdirectories of system dirs) - Non-standard system paths: Custom installation directories
- Network/remote filesystems: NFS, SMB mounts
- Symlink exploitation: Following symlinks to protected paths
dontrm is designed for:
- Preventing accidental
sudo rm -rf /disasters - Catching copy-paste errors from internet commands
- Protecting against typos in wildcard patterns
dontrm is NOT designed for:
- Preventing malicious actions by authorized users
- Filesystem access control (use proper permissions instead)
- Comprehensive system protection (use backups, snapshots, immutable infrastructure)
Always test dangerous commands with DRY_RUN first:
# Test before running
DRY_RUN=1 dontrm -rf /some/path
# If safe, run for real
dontrm -rf /some/pathdontrm requires sudo for operations that need elevated privileges. Be aware:
- Running with sudo bypasses user-level protections
- Always double-check commands before using sudo
- Consider using
DRY_RUN=1even with sudo
- Symlink Following: dontrm checks the provided path, not what symlinks resolve to
- Race Conditions: File system state can change between check and execution
- Glob Expansion: Shell expands globs before dontrm sees them (usually safe, but be aware)
- Custom System Paths: If you've installed system software in non-standard locations, those aren't protected
Please report:
- Bypasses of safety checks
- Ways to delete protected paths
- Race conditions in protection logic
- Misleading error messages that could cause dangerous operations
- Security issues in test infrastructure
These are known and expected:
- User home directories can be deleted (by design)
- Specific files in system directories can be deleted (by design)
- The tool can be bypassed by using
/usr/bin/rmdirectly (by design)
For security vulnerabilities, please email: fabio@fuabioo.com
DO NOT open a public GitHub issue for security vulnerabilities.
Include in your report:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if you have one)
- Initial Response: Within 48 hours
- Status Update: Within 7 days
- Fix Timeline: Depends on severity
- Critical: Within 7 days
- High: Within 14 days
- Medium: Within 30 days
- Low: Next release cycle
Our test infrastructure prioritizes safety:
- Docker Isolation: All tests run in Docker containers (unit + E2E)
- Control File Mechanism: Tests verify they're in safe environment
- No Local Execution: Tests cannot run on host machine
- 85% Coverage: Comprehensive test coverage ensures protection works (accounts for untestable main() wrapper)
See TESTING.md for details.
Every commit is automatically tested for:
- Protection logic correctness (unit tests)
- Real-world binary behavior (E2E tests in bash/zsh/fish)
- Code quality via linting
- Race conditions via race detector
- Coverage maintenance (85% minimum)
- Always use DRY_RUN first for untested patterns
- Read error messages carefully - they explain what was blocked and why
- Use absolute paths when possible for clarity
- Verify wildcards expand correctly before running
- Maintain backups - dontrm is not a backup solution
If integrating dontrm into scripts or tools:
# Good: Check exit status
if dontrm "$file"; then
echo "Deleted successfully"
else
echo "Deletion blocked or failed"
fi
# Good: Use DRY_RUN for validation
if DRY_RUN=1 dontrm "$path" 2>/dev/null; then
# Path is safe to delete
dontrm "$path"
fiIf aliasing rm to dontrm:
# In .bashrc or .zshrc
alias rm='dontrm'
# Keep a way to access real rm if needed
alias dangerrm='/usr/bin/rm' # Use with extreme cautionWe appreciate security researchers who:
- Report vulnerabilities privately first
- Allow reasonable time for fixes before public disclosure
- Provide clear reproduction steps
- Suggest potential fixes
In return, we commit to:
- Acknowledging receipt within 48 hours
- Providing regular status updates
- Crediting researchers in release notes (unless they prefer anonymity)
- Fixing critical issues promptly
Security contributions are recognized in:
- Release notes
- Project README
- Security hall of fame (for significant findings)
Thank you for helping keep dontrm safe!
- TESTING.md - Test safety and infrastructure
- CONTRIBUTING.md - Development guidelines
- README.md - Usage and installation