~sircmpwn/abused-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH abused] Fix rule name in log message

Details
Message ID
<20240205133029.78834-1-naglis@mailbox.org>
DKIM signature
pass
Download raw message
Patch: +1 -1
---
I suspect this is a C/P leftover.

Also I was wondering why in this case the logger on the rule (`rule.log`) is
not used?

 rules/commercial-isp.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules/commercial-isp.go b/rules/commercial-isp.go
index 5768cef..140a23d 100644
--- a/rules/commercial-isp.go
+++ b/rules/commercial-isp.go
@@ -75,7 +75,7 @@ func (rule *CommercialISPRule) Test(ctx context.Context, sample *model.Sample) i

	clientIP := net.ParseIP(*sample.IPAddress)
	if clientIP == nil {
		log.Printf("Warning: block-tor-exit saw invalid IP '%s'",
		log.Printf("Warning: block-commercial-isp saw invalid IP '%s'",
			*sample.IPAddress)
		return SKIP
	}
-- 
2.43.0
Details
Message ID
<CYX6ND0PV06D.3KHQLAXJ1DM9X@taiga>
In-Reply-To
<20240205133029.78834-1-naglis@mailbox.org> (view parent)
DKIM signature
pass
Download raw message
This should use rule.log, can you send a v2?
Details
Message ID
<4il7osspyeg7xz5ilaenaug6wi63bsm64voqbljy3haycpcdzm@r4yapndm2bvy>
In-Reply-To
<CYX6ND0PV06D.3KHQLAXJ1DM9X@taiga> (view parent)
DKIM signature
pass
Download raw message
This (log used instead of rule.log) happens in more places[1][2][3][4].
Should I update those as well?

Also, IIUC, the rule name can be removed from the log message since it
will be in the rule logger's prefix?

[1]: https://git.sr.ht/~sircmpwn/abused/tree/92a5de3738eb770dcb218dd73d6ba14ed283bf9a/item/rules/networks.go#L74
[2]: https://git.sr.ht/~sircmpwn/abused/tree/92a5de3738eb770dcb218dd73d6ba14ed283bf9a/item/rules/networks.go#L93
[3]: https://git.sr.ht/~sircmpwn/abused/tree/92a5de3738eb770dcb218dd73d6ba14ed283bf9a/item/rules/networks.go#L96
[4]: https://git.sr.ht/~sircmpwn/abused/tree/92a5de3738eb770dcb218dd73d6ba14ed283bf9a/item/rules/tor-exit.go#L50
Details
Message ID
<CYX7OU49DFDA.1I0UV5DPX5YWI@taiga>
In-Reply-To
<4il7osspyeg7xz5ilaenaug6wi63bsm64voqbljy3haycpcdzm@r4yapndm2bvy> (view parent)
DKIM signature
pass
Download raw message
Yeah, it would be great to use rule.log everywhere, and remove the
redundant prefixes.
Reply to thread Export thread (mbox)