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

Making specific entries/lists only apply to certain units or unit types #1081

Closed
3 tasks done
DandelionSprout opened this issue Oct 18, 2019 · 6 comments
Closed
3 tasks done
Assignees
Milestone

Comments

@DandelionSprout
Copy link
Member

DandelionSprout commented Oct 18, 2019

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version (0.98.1)
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Problem Description

AdGuard Home is a pretty fine program that can deal with a whole lot of different electronical products. However, there may be some small differences in which ways they should be dealt with.

Example of such: The EPSON Eco-Tank printers (which I warmly recommend due to them not being in on the ink patron industry scam) make a connection to talk.google.com on each boot, which I doubt it has any conceivably good reasons for⁽¹⁾. However, if I write an entry to block talk.google.com, that could cause a number of problems for other units, especially PCs and Android phones.

⁽¹⁾ = While the Eco-Tank does have a legitimate function to connect to Google's cloud printer settings, I am of the current assumption that its dozen connections to www.google.com would take care of that on their own.

Proposed Solution

Some kind of $ value would've been great, not unlike what $app does for AdGuard for Android. However, I am not entirely sure whether it should be for IP addresses (and/or AGH's familiar name system) (e.g. 192.168.1.69), or for the units' network callnames (e.g. EPSON-57295). The former would fall short for non-manually-assigned IP addresses and almost all external ones, while the latter would fall short for units with seemingly unchangeable callnames (such as a significant amount of Android phones who all go by either android or XEROX CORPORATION).

I'd have loved to use something like ||talk.google.com$unit=DandeesEcoTank.

Alternatives Considered

№2 from #435 (comment) (Thanks to ArchiveBase for pointing it out to me).

Additional Information

The best option of all would be to have it be for the units' MAC addresses (e.g. 12:34:56:78:9A), but I get the personal impression that AdGuard Home can't detect them.

@ghost
Copy link

ghost commented Oct 18, 2019

@DandelionSprout How about this? #435

@DandelionSprout
Copy link
Member Author

While his/her suggestion is different than mine (which was to create unit-specific entries in global lists), it actually sounds like a better idea (if done well) than the one I had in mind.

@ameshkov
Copy link
Member

Actually, I love this idea!

Using the IP or Mac addresses should be an option, but it is useful for your own custom rules, not for a filter list.

What's unclear here is how to identify a client/unit properly.

  1. We can try using a MAC address and lookup the device vendor: https://en.wikipedia.org/wiki/Organizationally_unique_identifier
  2. We can try some device fingerprinting techniques (the question is what techniques?)

@szolin
Copy link
Contributor

szolin commented Jan 16, 2020

What I propose:

  • We introduce a new extension to filter rules - clienttag or ctag (I like the shorter version more)
  • Filter maintainer uses this extension when he wants to block a host only for specific types of clients
  • AGH administrator tags his Clients accordingly to make use of those special filter rules
  • We maintain a fixed list of tags that can be used for this purpose, so all filter maintainers and AGH admins are always in-sync
Client Tags Supported by AGH:
    By Device Type:
        pc
        phone
        printer
Configured Clients (example):
    Admin
        Tags: pc, phone
    Epson Printer
        Tags: printer
Active Filters (example):
    AdGuard Simplified Domain Names filter
        ||host1^
        ||host2^
        ...
    Per Client Special Filter
        ||host1^$ctag=pc [1]
        ||host3^$ctag=phone$ctag=printer [2]

Notes:
[1] Rule ||host1^$ctag=pc has no effect because there is a rule ||host1^ in another filter list which blocks all clients.
[2] Rule ||host3^$ctag=phone$ctag=printer blocks host3 only for Clients that have tags 'phone' or 'printer'.

@ameshkov
Copy link
Member

A couple of comments:

  1. Replace ||host3^$ctag=phone$ctag=printer with ||host3^$ctag=phone|printer (just like $domain and $app modifier in the traditional rules syntax).
  2. We need to come up with more pre-defined tags. Btw, user agent hints draft may be used for inspiration: https://wicg.github.io/ua-client-hints/

@ameshkov
Copy link
Member

ameshkov commented Jan 19, 2020

There's one more thing that I missed.

Both $app and $domain modifiers allow specifying "restricted" domains and apps.
It makes sense to do the very same with the ctag using the very same approach:

  • ||example^$ctag=~android|~pc -- allowed for every client save for android and pc

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

No branches or pull requests

4 participants