Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asterisk for the firewall #480

Open
vvep opened this issue Jan 10, 2025 · 1 comment
Open

Asterisk for the firewall #480

vvep opened this issue Jan 10, 2025 · 1 comment

Comments

@vvep
Copy link

vvep commented Jan 10, 2025

IMG_20250110_190704

Thanks for developing PCAPdroid, I love it!

I have a suggestion: It would be greater if we could use an asterisk (*) in the firewall rules. The asterisk allows for the creation of more general rules that match multiple IP addresses, ports, or domains, rather than targeting them individually.

Here’s how it could work, example:

  • 202.*.*.*:* matches any IP address starting with 202 and any port.
  • 202.81.*.*:3728 matches any IP address in the 202.81.x.x range, specifically for port 3728.
  • *.net:* matches any domain ending in .net on any port.
  • poopsquish.net:* matches the specific domain poopsquish.net on any port.
  • *.googleusercontent.com:* matches any subdomain under googleusercontent.com on any port.
  • *.cdn.coolwebsite.com:433 matches any subdomain under cdn.coolwebsite.com on port 433.
  • etc

The asterisk simplifies the rule by allowing a broad range of addresses and ports to be specified in a single entry, making the firewall configuration more flexible and efficient.

@emanuele-f
Copy link
Owner

Hello,
Thanks for bringing this point.

While having full expressivity like in these examples would be great, this has to cope with implementation specifics and performance considerations.

For subnet matching, there is an open request in #365

For subdomain matching, currently the logic is already "wildcard" in most cases, here is the specification from the user manual:

Blocking a second-level domain like example.org will cause all of its subdomains to be blocked (e.g. some.example.org and img.example.org). This only applies to second-level domains, so blocking another.example.org will not block yet.another.example.org.

For rules having both domains/ip addresses and ports, I don't see much use cases for that. The firewall feature is mainly meant for privacy and in this context blocking ports seems too low level.

If you have other use-cases in mind let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants