+
    Û1jC  ã                   ó2   € ^ RI HtHtHt  ! R R]]4      tR# )é    )ÚPluginÚIndependentPluginÚSoSPredicatec                   óP   a € ] tR t^t o RtRtRtR
tRtRt	R t
R tR tR tRtV tR	# )ÚFirewallTablesaä  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).
zfirewall tablesÚfirewall_tablesc                óv   € RV,           pRV,           R,           pV P                  V\        WR.R7      R7       R# )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_ziptables -t ú -nvLÚ	nf_tables©Úkmods©ÚpredN©Úadd_cmd_outputr   ©ÚselfÚ	tablenameÚmodnameÚcmds   &&  ÚD/usr/lib/python3/dist-packages/sos/report/plugins/firewall_tables.pyÚcollect_iptableÚFirewallTables.collect_iptable   sA   € ð
 ˜yÕ(ˆØ˜yÕ(¨7Õ2ˆØ×ÑØÜ˜d°KÐ*@ÔAð 	ö 	Có    c                óv   € RV,           pRV,           R,           pV P                  V\        WR.R7      R7       R# )z%Same as function above, but for ipv6 Ú	ip6table_zip6tables -t r   r   r   r   Nr   r   s   &&  r   Úcollect_ip6tableÚFirewallTables.collect_ip6table*   sA   € ð  	Õ)ˆØ 	Õ)¨GÕ3ˆØ×ÑØÜ˜d°KÐ*@ÔAð 	ö 	Cr   c                óN   € \        V RR.RR/R7      pV P                  RVRR7      # )	zJCollects nftables rulesets with 'nft' commands if the modules
are present r   Ú	nfnetlinkr   Úall)r   Úrequiredznft -a list rulesetT)r   Úchanges)r   Úcollect_cmd_output)r   Únft_preds   & r   Úcollect_nftablesÚFirewallTables.collect_nftables3   sB   € ô
   Ø'2°KÐ&@Ø*1°5Ð)9ô;ˆð ×&Ñ&Ð'<À8Ø/3ð 'ó 5ð 	5r   c                ó  € V P                  4       pR . R. /pVR,          ^ 8X  d
   VR,          MRpVP                  4        Fq  pVP                  4       R,          p\        V4      ^8X  g   K,  V^ ,          R8X  g   K<  V^,          V9   g   KL  W%^,          ,          P	                  V^,          4       Ks  	  Rp Rp\        VR	R
R7      ;_uu_ 4       pVP                  4       p	RRR4       X	P                  4        F3  p
TR,          ^ 8X  g   K  Y¢R ,          9   g   K"  T P                  T
4       K5  	   Rp\        TR	R
R7      ;_uu_ 4       pTP                  4       p	RRR4       T	P                  4        F3  p
TR,          ^ 8X  g   K  Y¢R,          9   g   K"  T P                  T
4       K5  	  TR,          ^ 8w  g   RTR ,          9   d!   T P                  R\        T RR.R7      R7       TR,          ^ 8w  g   RTR,          9   d!   T P                  R\        T RR.R7      R7       T P                  . RO4       R#   + '       g   i     EL^; i  \         d    Tp	 ELqi ; i  + '       g   i     EL; i  \         d    Tp	 EL i ; i)ÚipÚip6ÚstatusÚoutputÚ :r   é   NÚtablezmangle
filter
nat
z/proc/net/ip_tables_namesÚrzUTF-8)ÚencodingNz/proc/net/ip6_tables_namesÚfilterziptables -vnxLÚiptable_filterr   r   r   zip6tables -vnxLÚip6table_filter)ú/etc/nftablesz/etc/sysconfig/nftables.confz/etc/nftables.conf)r'   Ú
splitlinesÚsplitÚlenÚappendÚopenÚreadÚIOErrorr   r   r   r   Úadd_copy_spec)r   Únft_listÚnft_ip_tablesÚ	nft_linesÚlineÚwordsÚdefault_ip_tablesÚproc_net_ip_tablesÚifileÚip_tables_namesr0   Úproc_net_ip6_tablesÚipfiles   &            r   ÚsetupÚFirewallTables.setup>   sF  € ð
 ×(Ñ(Ó*ˆØ˜r 5¨"Ð-ˆØ*2°8Õ*<ÀÔ*A�H˜XÖ&Àrˆ	Ø×(Ñ(Ö*ˆDØ—J‘J“L Õ%ˆEÜ�5‹z˜QŽ 5¨¥8¨wÖ#6Ø˜!•H Ö-Ø A�hÕ'×.Ñ.¨u°Q­xÖ8ñ	 +ð 4Ðð	0Ø!<ÐÜÐ(¨#¸×@Õ@ÀEØ"'§*¡*£,�÷ Að %×/Ñ/Ö1ˆEØ˜Õ! QÖ&¨5À$Õ4GÖ+GØ×$Ñ$ UÖ+ñ 2ð	0Ø">ÐÜÐ)¨3¸×AÕAÀVØ"(§+¡+£-�÷ Bð %×/Ñ/Ö1ˆEØ˜Õ! QÖ&¨5À%Õ4HÖ+HØ×%Ñ% eÖ,ñ 2ð �HÕ Ô" h°-ÀÕ2EÔ&EØ×ÑØ Ü! $Ð/?ÀÐ.MÔNð  ô ð �HÕ Ô" h°-ÀÕ2FÔ&FØ×ÑØ!Ü! $Ð/@À+Ð.NÔOð  ô ð
 	×Ñò 
ö 	÷E A×@Ð@ûäô 	0Ø/‹Oð	0ú÷ B×AÐAûäô 	0Ø/‹Oð	0ús`   Â8I
 ÃH6Ã!I
 Ä1I2 Å	IÅI2 È6I	ÉI
 ÉI
 É
IÉIÉI/	É)I2 É/I2 É2JÊJ© N)ÚnetworkÚsystem)r6   )Ú	ip_tablesÚ
ip6_tablesr   r!   Úebtables)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú
short_descÚplugin_nameÚprofilesÚfilesÚkernel_modsr   r   r'   rJ   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r      sB   ø‡ € ñð #€Jà#€KØ$€HØ€Eð€Kò	CòCò	5÷9ð 9r   r   N)Úsos.report.pluginsr   r   r   r   rL   r   r   Ú<module>r`      s   ð÷ IÑ Hôk�VÐ.ö kr   