RAG Box is designed with security and privacy as core principles. This document outlines our security practices, how to report vulnerabilities, and our supported versions.
- 100% Offline Operation - No data leaves your infrastructure
- Local Processing - All document processing, embedding, and LLM inference happens locally
- No External APIs - Zero dependency on cloud services for core functionality
- Configurable Logging - Control what information gets logged
- Clean Architecture - Clear separation of concerns with security boundaries
- Input Validation - All user inputs are validated and sanitized
- Error Handling - Secure error messages that don't leak sensitive information
- Resource Management - Proper cleanup of temporary files and memory
We actively maintain security updates for the following versions:
| Version | Supported |
|---|---|
| 0.1.x | β Supported |
| < 0.1.0 | β Not Supported |
We take security vulnerabilities seriously. If you discover a security issue, please follow responsible disclosure:
For critical security issues that could lead to:
- Remote code execution
- Data exfiltration
- Privilege escalation
- Service disruption
Contact us immediately:
- Email: security@galezra.com (will respond within 24 hours)
- Subject:
[SECURITY] RAG Box Critical Vulnerability
For lower-severity issues like:
- Information disclosure
- Minor input validation issues
- Configuration security improvements
Use GitHub Security Advisories:
- Go to the Security tab
- Click "Report a vulnerability"
- Fill out the form with details
When reporting a vulnerability, please provide:
- Description - Clear explanation of the vulnerability
- Impact - What could an attacker achieve?
- Reproduction Steps - How to reproduce the issue
- Environment - OS, Python version, RAG Box version
- Proof of Concept - Code or screenshots (if safe to share)
- Suggested Fix - If you have ideas for mitigation
Our security response process:
- Acknowledgment - Within 24-48 hours
- Investigation - We'll investigate and assess the impact
- Updates - Regular updates on progress (at least weekly)
- Fix Development - We'll develop and test a fix
- Disclosure - Coordinated disclosure after fix is available
- Recognition - Credit in security advisory (if desired)
# Verify Poetry installation
poetry --version
# Use virtual environments
poetry install --no-dev # For production# config/production.yaml
log_level: "WARNING" # Reduce verbose logging in production
debug_mode: false # Disable debug mode
data_dir: "/secure/path/data" # Use secure directory- Restrict data directory permissions to application user only
- Use dedicated user account for running RAG Box
- Monitor file access logs for unusual activity
- Regular backups of vector store and configuration
- Firewall rules to restrict access to Streamlit port (8501)
- VPN access for remote users
- HTTPS termination if exposing web interface
- Rate limiting on API endpoints
# Input validation
from pathlib import Path
def safe_file_path(user_path: str) -> Path:
"""Safely resolve user-provided file paths."""
path = Path(user_path).resolve()
# Prevent directory traversal
if not str(path).startswith(str(DATA_DIR.resolve())):
raise ValueError("Path outside allowed directory")
return path# Check for known vulnerabilities
poetry audit
# Update dependencies regularly
poetry update
# Review new dependencies carefully
poetry show --tree# Test input validation
def test_path_traversal_protection():
"""Test that path traversal attacks are prevented."""
with pytest.raises(ValueError):
safe_file_path("../../../etc/passwd")We use automated security scanning:
- Bandit - Python security linter
- Safety - Known vulnerability scanning
- Semgrep - Additional security patterns
- Poetry audit - Check for known CVEs
- GitHub Dependabot - Automated dependency updates
- License compliance - Ensure compatible licenses
# Use minimal base images
FROM python:3.12-slim
# Run as non-root user
RUN useradd --create-home --shell /bin/bash ragbox
USER ragbox
# Security headers in web interface
ENV STREAMLIT_SERVER_ENABLE_CORS=false
ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=true- Model Provenance - Verify LLM model sources (Ollama, HuggingFace)
- Model Poisoning - Use trusted model repositories
- Resource Exhaustion - Monitor CPU/memory usage
- Malicious Documents - Sandboxed document processing
- File Size Limits - Prevent DoS via large files
- Format Validation - Strict file format checking
- Index Integrity - Regular integrity checks
- Access Control - Restrict vector store file permissions
- Backup Security - Encrypted backups of sensitive indexes
# Security-relevant events are logged
logger.warning("Failed authentication attempt", extra={
"user_id": user_id,
"ip_address": request.remote_addr,
"timestamp": datetime.utcnow()
})- Failed authentication attempts
- Unusual file access patterns
- Resource usage spikes
- Error rate monitoring
- Critical vulnerabilities: Patched within 24-48 hours
- High severity: Patched within 1 week
- Medium/Low severity: Included in next regular release
- GitHub Security Advisories - For all vulnerabilities
- Release Notes - Security fixes highlighted
- Email notifications - For subscribed users (coming soon)
For security-related questions that are not vulnerabilities:
- GitHub Discussions - Public security questions
- Email: security@galezra.com - Private security inquiries
Security is everyone's responsibility. Thank you for helping keep RAG Box secure! π