-
Notifications
You must be signed in to change notification settings - Fork 11
Can hostname regex pattern in a rule become more flexible (powerful)? #13
Comments
Trying to be helpful, I checked whether NoScript extension handles partial IP address (subnet) patterns http://noscript.net/features Also, on the same page, regarding handling of patterns containing asterksks: |
To be clear, I'm not suggesting the validation needs to consider whether a pattern "is a valid netrange (subnet)". The request URI has already been split, and here the code is just examining the "hostname" portion of it. I'm just hoping the parsing can be robust enough to accommodate "or", as in, you tell me ~~ I'll gladly type whatever escape chars are necessary |
So we have that ruleset-language for complex stuff like regex (which I didn't document well, my bad). That commit you referenced is merely an input validation fix for what is called 'user' rulesets in code (user_persistent and user_temporary). Those are made simplistic for UI to be able to handle them easier. Here is an example ruleset for you. One could save it in a text file 'file.ruleset' and install on preferences.xul#rulesets-manager, but trying to do this right now, i discovered a bug, so... This should work once fixed. Writing example anyway
Check out /src/defaults/rulesets/ for more examples. |
Fixed installing rulesets in c066480 |
The functionality you've achieved in policeman is wonderful! Thanks for explaining. |
What's wrong with this ruleset? I can't install it. |
@futpib Like this rule as follow |
|
@futpib Yeah, I do write the rule referring to that example before, the ruleset format is correct but it doesn't work, so does above code you provided. I test other content types (e.g. image, script, and stylesheet), they work well except object type. I think it's a bug. and then I test it with the ruleset 'allow_objects_anywhere' (move it to the top position), the result is that it still doesn't work... rules: |
Currently, how would I block (for example) all US hostnames?
/*.us/ is not an acceptable input
/[.]us$/ is not acceptable
Perhaps leading wildcard patterns are impossible to hash, so should not be supported.
But let's please consider another example:
How would I, via a single rule, block all webtrendslive.DOMAIN.TLD ?
/^webtrendslive.*/ is not an acceptable hostname input
As of this patch:
ed3e522
we are able to supply a (one) IP address.
Ability to whitelist (for instance) 192.168.* would be quite useful
as would ability to block an entire malware-prevalent subnet (invented example) 69.228.*
Regardless what wildcards might be supported, I'm wishing for availability of a rule which would block (or raise an infobar notice) when an href or xmlhttp requests a numeric IP address, vs a DNS hostname (often practiced by hit-n-run malware distributors).
The text was updated successfully, but these errors were encountered: