Re: Filtrar comodins/regex de le s línies

Alex Muntada <[email protected]>
Newsgroups gmane.linux.debian.user.catalan
Message-ID <ZbOPU12V4iMoWTye@ix>
Hola Lluís,

amb la teva ajuda, ja tinc funcionant llistes negres amb ipset :)

> # El *5 *en negreta parametritza quantes vegades ha d'aparèixer
> una ip al log per afegir-la a l'ipset.
> 
> for i in $(cat /var/log/messages | grep BLOCK | awk -F= '{print
> $5}' | cut -d " " -f 1 | sort | uniq -c | awk '{ if ($1 >=*5*)
> print $2}'); do ipset add UFWBlockList $i; done

Per fer això jo utilitzo fail2ban, però és cert que està molt
lligat a les iptables i, si la teva llista negra personal creix,
aleshores pot anar més lent que fent-ho amb ipset.

> A banda, també vaig instal·lar el fwlogwatch que t'envia un
> informe diari.

Té bona pinta, tot i que m'he adonat que el paquet està orfe.

Salut i gràcies de nou!
Alex

--
  ⢀⣴⠾⠻⢶⣦⠀
  ⣾⠁⢠⠒⠀⣿⡁   Alex Muntada <[email protected]>
  ⢿⡄⠘⠷⠚⠋   Debian Developer 🍥 log.alexm.org
  ⠈⠳⣄⠀⠀⠀⠀
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEaUBwKsbetWW2SKTt466XjoNOXn4FAmWzj0oACgkQ466XjoNO
Xn4HPg//SP4o3WgnIZSZnQKiVXyWLZYGUXhXe5YvNnPuo8BH9rplaA4JDV5J+PSL
ZWqfPfoa4u0/3/KLFnUrb5pPi8w2BevkCwXCzm2wosWgSrkw5Nda7q8yhHBV0RIA
dxYCrgbPwDv/pZ0+yCFCsE4USuZcrrFkaRpBYiGgRkoDqM8J4uPLpIOSD26ViFpn
8lisdBTQCm+c0bK5lvF9bEMRUvMtfTYngOpugnsL5xeAH1vuKb0Cufb2I1DrQNds
763i6vcCGWxAHr23K8+GZzyU8bAOLJCbFn6hPVEdeSm2dbybsufxQapVg/bQzBRY
XmfJfGXAqxkoWbcpjDg2D+YEPB8Ld3qjV3C8mzHPyacW2Oo5h/rdVEu2/Iv6Wpp9
59+DOROtuR7d293B4Kk1rxqjA3AwVTvZzN4vb17gOAjIHvrvsOp8cjpANG0dPRBS
5B4bo9tmSBwuPIHT0c3ysRGzWKFe5Xgul4cbxOjORupdUYkw8F3jbCCyzRsRD7aV
SPMiwBIFcIc5igqoPdInyNTMuJoz+hEXGl4ZH3TfOMiVdaFHk1+UXEI1FBU361SH
LkBWhu+Wr/b2QwoPcVQMaKHdHMuhs43u+284UOUk7YRGj8DS5UFElaUK0022apEs
DgcxAtIgcm3hT6chWaWg2O5l7VgIRkNpsnRIWsv7xKujWvZkqEg=
=xW+q
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.