# Privacy-enhanced rsyslog configuration
# Filters VPN-related log entries for enhanced privacy
# Generated by Algo VPN privacy role

# Stop processing VPN-related messages to prevent them from being logged
# This helps maintain user privacy by not storing VPN connection details

{% if privacy_log_filtering.exclude_vpn_logs %}
# Filter WireGuard messages
:msg, contains, "wireguard" stop

# Filter StrongSwan/IPsec messages
:msg, contains, "strongswan" stop
:msg, contains, "ipsec" stop
:msg, contains, "charon" stop
:msg, contains, "xl2tpd" stop

# Filter VPN interface messages
:msg, contains, "wg0" stop
:msg, contains, "ipsec0" stop

# Filter VPN-related kernel messages
:msg, regex, "IN=wg[0-9]+" stop
:msg, regex, "OUT=wg[0-9]+" stop
{% endif %}

{% if privacy_log_filtering.filter_kernel_vpn_logs %}
# Filter kernel messages related to VPN traffic
:msg, contains, "netfilter" stop
:msg, regex, "FORWARD.*DPT:(51820|500|4500)" stop
{% endif %}

# Continue processing other messages
& stop
