File: //lib/python3/dist-packages/sos/report/plugins/__pycache__/firewall_tables.cpython-310.pyc
o
i��d_ � @ s* d dl mZmZmZ G dd� dee�ZdS )� )�Plugin�IndependentPlugin�SoSPredicatec @ sD e Zd ZdZdZd ZdZdZdZdd� Z dd � Z
d
d� Zdd
� ZdS )�firewall_tablesa Collects information about local firewall tables, such as iptables,
and nf_tables (via nft). Note that this plugin does _not_ collect firewalld
information, which is handled by a separate plugin.
Collections from this plugin are largely gated byt the presence of relevant
kernel modules - for example, the plugin will not collect the nf_tables
ruleset if both the `nf_tables` and `nfnetlink` kernel modules are not
currently loaded (unless using the --allow-system-changes option).
zfirewall tables)�network�system)�
/etc/nftables)� ip_tables�
ip6_tables� nf_tables� nfnetlink�ebtablesc C �2 d| }d| d }| j |t| |dgd�d� dS )z� Collecting iptables rules for a table loads either kernel module
of the table name (for kernel <= 3), or nf_tables (for kernel >= 4).
If neither module is present, the rules must be empty.�iptable_ziptables -t � -nvLr ��kmods��predN��add_cmd_outputr ��self� tablename�modname�cmd� r �D/usr/lib/python3/dist-packages/sos/report/plugins/firewall_tables.py�collect_iptable s
�zfirewall_tables.collect_iptablec C r )z& Same as function above, but for ipv6 � ip6table_z
ip6tables -t r r r r Nr r r r r �collect_ip6table* s
�z firewall_tables.collect_ip6tablec C s&