roles/privacy/README.md
This Ansible role implements additional privacy enhancements for Algo VPN to minimize server-side traces of VPN usage and reduce log retention. These measures help protect user privacy while maintaining system security.
All privacy settings are configured in config.cfg under the "Privacy Enhancements" section:
# Enable/disable all privacy enhancements
privacy_enhancements_enabled: true
# Log rotation settings
privacy_log_rotation:
max_age: 7 # Days to keep logs
max_size: 10 # Max size per log file (MB)
rotate_count: 3 # Number of rotated files to keep
compress: true # Compress rotated logs
daily_rotation: true # Force daily rotation
# History clearing
privacy_history_clearing:
clear_bash_history: true
clear_system_history: true
disable_service_history: true
# Log filtering
privacy_log_filtering:
exclude_vpn_logs: true
exclude_auth_logs: false # Use with caution
filter_kernel_vpn_logs: true
# Automatic cleanup
privacy_auto_cleanup:
enabled: true
frequency: "daily" # daily, weekly, monthly
temp_files_max_age: 1
clean_package_cache: true
# Advanced settings
privacy_advanced:
disable_ssh_success_logs: false
reduce_kernel_verbosity: true
clear_logs_on_shutdown: false # Extreme measure
exclude_vpn_logs: true - Safe, only filters VPN-specific messagesclear_bash_history: true - Safe, improves privacy without affecting securityreduce_kernel_verbosity: true - Safe, reduces noise in logsexclude_auth_logs: true - Reduces security logging, makes incident investigation harderdisable_ssh_success_logs: true - Removes audit trail for successful connectionsclear_logs_on_shutdown: true - Extreme measure, makes debugging very difficult/etc/logrotate.d/99-privacy-enhanced - Main log rotation config/etc/logrotate.d/99-auth-privacy - Auth log rotation/etc/logrotate.d/99-kern-privacy - Kernel log rotation/etc/rsyslog.d/49-privacy-vpn-filter.conf - VPN log filtering/etc/rsyslog.d/48-privacy-kernel-filter.conf - Kernel log filtering/etc/rsyslog.d/47-privacy-auth-filter.conf - Auth log filtering (optional)/etc/rsyslog.d/46-privacy-ssh-filter.conf - SSH log filtering (optional)/etc/rsyslog.d/45-privacy-minimal.conf - Minimal logging config/usr/local/bin/privacy-auto-cleanup.sh - Automatic cleanup script/usr/local/bin/privacy-log-cleanup.sh - Initial log cleanup/usr/local/bin/privacy-monitor.sh - Privacy status monitoring/etc/bash.bash_logout - History clearing on logout/etc/systemd/system/privacy-shutdown-cleanup.service - Shutdown cleanup (optional)Privacy enhancements are enabled by default. To disable them:
privacy_enhancements_enabled: false
You can run specific privacy components using tags:
# Run only log rotation setup
ansible-playbook server.yml --tags privacy-logs
# Run only history clearing
ansible-playbook server.yml --tags privacy-history
# Run only log filtering
ansible-playbook server.yml --tags privacy-filtering
# Run only cleanup tasks
ansible-playbook server.yml --tags privacy-cleanup
# Run all privacy enhancements
ansible-playbook server.yml --tags privacy
Check the status of privacy enhancements:
sudo /usr/local/bin/privacy-monitor.sh
Run manual cleanup:
sudo /usr/local/bin/privacy-auto-cleanup.sh
If you need to debug VPN issues, temporarily disable privacy enhancements:
privacy_enhancements_enabled: false in config.cfg./algoAlternatively, disable specific features:
exclude_vpn_logs: false to see VPN connection logsreduce_kernel_verbosity: false for full kernel logging/var/log/privacy-cleanup.log for cleanup operation logsThis role aims to balance privacy with security by:
For maximum privacy, consider running your own log analysis before enabling aggressive filtering options.