OPNsense Forum

English Forums => 24.7, 24.10 Legacy Series => Topic started by: DavidSte1 on October 24, 2024, 09:48:25 PM

Title: Log specific domain traffic, allow and continue processing rules
Post by: DavidSte1 on October 24, 2024, 09:48:25 PM
Hi,

I have a use case where I need to watch access to a specific domain.  I'd like to create a rule to allow traffic and log it but then to continue to process other rules (which may then subsequently block this traffic either now or in the future).

I can't work a way to do this - is this even possible?

Thanks, David
Title: Re: Log specific domain traffic, allow and continue processing rules
Post by: dseven on October 25, 2024, 10:07:17 AM
Assuming you mean DNS domains.... firewall rules don't deal with those, only IP addreses, but there this this: https://docs.opnsense.org/manual/reporting_unbound_dns.html
Title: Re: Log specific domain traffic, allow and continue processing rules
Post by: DavidSte1 on October 28, 2024, 08:40:54 PM
Yes i do mean DNS domains.  You can use domain names in FW rules, but I'll send logfiles to Spunk to handle the name lookups for the IPs in the logs
Title: Re: Log specific domain traffic, allow and continue processing rules
Post by: dseven on October 28, 2024, 08:52:48 PM
That would depend on reverse DNS providing something useful, which you probably can't rely on (depending on your use-case, I suppose).
Title: Re: Log specific domain traffic, allow and continue processing rules
Post by: DavidSte1 on November 03, 2024, 05:45:47 PM
I know full well the limitations of reverse dns, but it doesn't really answer my original question
Title: Re: Log specific domain traffic, allow and continue processing rules
Post by: dseven on November 04, 2024, 02:50:10 PM
So your original post actually contained two questions (at least in my perception):

1) Is it possible to create a rule that matches traffic destined for a particular domain name (as opposed to IP address)?

2) Is it possible to create a rule that logs when it's matched, but doesn't take action (Pass/Block/Reject), allowing a later rule to do that?

I believe the answer to (2) ("no") can be found here: https://forum.opnsense.org/index.php?topic=12380.0