AdguardTeam / FiltersCompiler

A tool that compiles & validates filters
GNU Lesser General Public License v3.0
52 stars 12 forks source link

Add an option to configure allowed "trust" level for a filter list #61

Closed ameshkov closed 4 years ago

ameshkov commented 4 years ago

Currently, we keep a huge list of exclusions that are applied to all third-party filter lists, but not to ours (see "General exclusions" there): https://github.com/AdguardTeam/FiltersRegistry/blob/master/filters/exclusions.txt

Instead of this list, we should introduce a concept of a "trust" level that can be configurable in the filter list's metadata.json.

Here are the possible values for it:

Types of rules allowed or disallowed by the trust level:

Here's what we should keep in the general exclusions:

!##################################################
!############### General exclusions ###############
!##################################################
! Excluding unsupported modifiers and rules
:xpath(
(:scope
##script:inject
! These rules should be converted automatically
##^
##+js
##script:inject

Please note, that ##^, ##+js, and ##script:inject should be converted automatically so they won't be actually excluded, see https://github.com/AdguardTeam/FiltersCompiler/issues/52 and https://github.com/AdguardTeam/FiltersCompiler/issues/60

krystian3w commented 4 years ago

html filtering: What level of trust for html filtering? #60 / https://github.com/AdguardTeam/FiltersRegistry/issues/280

ameshkov commented 4 years ago

@krystian3w should be allowed in low level

Yuki2718 commented 3 years ago

Does AdGuard's css filter #$# work without Trusted checked? Tried to test but failed because generic injection of #$#, which I added in my personal list, is apparently not allowed.

Alex-302 commented 3 years ago

Is the rule in user rules, or added in custom filter?

Alex-302 commented 3 years ago

@Yuki2718

Yuki2718 commented 3 years ago

@Alex-302 Custom list

Alex-302 commented 3 years ago

CSS rules need to be allowed when you import filter. image

Yuki2718 commented 3 years ago

@Alex-302 You mean user must check the Trusted box?

Alex-302 commented 3 years ago

Yes. For the case if foreign filter is used(protection from dangerous JS).

Yuki2718 commented 3 years ago

Okay, thanks!

ameshkov commented 3 years ago

@Alex-302 foreign -> third-party :)