The exceptions not works

Discussions about the Application Boundaries Enforcer (ABE) module
fanN

The exceptions not works

Post by fanN »

I need enabling exception for gentoo.org but with each exception breaked filter.
Example for script piwik http://sourceforge.net/apps/piwik/supertuxkart/piwik.js (for example blocking) and https://piwik.gentoo.org/piwik.js (I need exception here)
works

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny
these all aren't working

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from ^https?://([a-z0-9\.-]+\.)?gentoo\.org
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from ^https?://([a-z0-9\.-]+\.)?gentoo\.org/.*
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from .gentoo.org
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from .gentoo.org*
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from *.gentoo.org*
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept ALL from *.gentoo.org
Deny
Please, how does it make?
Mozilla/5.0 (Windows NT 6.0; rv:29.0) Gecko/20100101 Firefox/29.0
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: The exceptions not works

Post by barbaz »

Code: Select all

Site https://piwik.gentoo.org/piwik.js
Accept from [DOMAIN_OF_SITE_WHERE_YOU_WANT_THAT_SCRIPT_ALLOWED]

Site ^https?://.+/piwik\.js
Deny
replacing [DOMAIN_OF_SITE_WHERE_YOU_WANT_THAT_SCRIPT_ALLOWED] with the actual domain of the site that includes that script, or ALL if you want it allowed from anywhere
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0 SeaMonkey/2.29a1
fanN

Re: The exceptions not working

Post by fanN »

Code: Select all

Site https://piwik.gentoo.org/piwik.js Accept from .gentoo.org
Site https://webstats.gnome.org/piwik.js Accept from .gentoo.org
Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny
Super, Thank you very much
Mozilla/5.0 (Windows NT 6.0; rv:29.0) Gecko/20100101 Firefox/29.0
fanN

Re: The exceptions not working

Post by fanN »

I am cow ...

Code: Select all

Site https://piwik.gentoo.org/piwik.js Accept from .gentoo.org
Site https://webstats.gnome.org/piwik.js Accept from .gnome.org
Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny
Now it is right
Mozilla/5.0 (Windows NT 6.0; rv:29.0) Gecko/20100101 Firefox/29.0
fanN

Re: The exceptions not works

Post by fanN »

This but not works

Code: Select all

#- analytics whitelist
Site https://piwik.gentoo.org Accept from .gentoo.org 
Site ^https?://piwik\.
Deny
Site http://sourceforge.net/apps/piwik/ Accept from sourceforge.net
Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik/
Deny
Site https://webstats.gnome.org/piwik.js Accept from .gnome.org
Site http://sourceforge.net/apps/piwik/supertuxkart/piwik.js Accept from this-sucks.net
Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny
This had to be blocked but isn't

Code: Select all

Site http://sourceforge.net/apps/piwik/supertuxkart/piwik.js Accept from this-sucks.net
Mozilla/5.0 (Windows NT 6.0; rv:29.0) Gecko/20100101 Firefox/29.0
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: The exceptions not works

Post by barbaz »

I'm not quite sure what you're trying to do?

the Accept part needs to be on its own line

this maybe?

Code: Select all

#- analytics whitelists
Site http://sourceforge.net/apps/piwik/supertuxkart/piwik.js
Accept from this-sucks.net
Deny

Site https://piwik.gentoo.org
Accept from .gentoo.org
Site http://sourceforge.net/apps/piwik/
Accept from sourceforge.net
Site https://webstats.gnome.org/piwik.js
Accept from .gnome.org

Site ^https?://piwik\. ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik/ ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26
fanN

Re: The exceptions are not working

Post by fanN »

NO,
...
Blocking without gentoo.org

Code: Select all

Site  https://piwik.gentoo.org/piwik.js
Accept from .gentoo.org
Site ^https?://piwik\.
Deny
OK

Blocking includes gentoo.org (new rule)

Code: Select all

Site https://piwik.gentoo.org/piwik.js
Accept from .gentoo.org
Site ^https?://piwik\.
Deny
# this rule isn't matched for blocking again all
Site ^https?://[a-zA-Z0-9_\-\.\[\]:/@~;,\?&=%#]+/piwik\.js
Deny
Not OK
I can't use new rules that breaking the previous.
Mozilla/5.0 (Windows NT 6.0; rv:29.0) Gecko/20100101 Firefox/29.0
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: The exceptions not works

Post by Thrawn »

It's still very hard to understand what you're actually trying to do.

Would something like this help?

Code: Select all

Site ^.*piwik.*
Accept from .gentoo.org
Deny
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:29.0) Gecko/20100101 Firefox/29.0
fanNS

Re: The exceptions not working

Post by fanNS »

No,

Code: Select all

#- block all in 1. level domain without piwik.alpha.org/script/piwik.js
Site http://piwik.alpha.org/script/piwik.js
Accept from .alpha.org
Site http://piwik.
Deny

#- block all beyond directory script or js like piwik.gentoo.org/script/virus.js  and  piwik.beta.org/js/virus.js but not gift.org/js/gifts.js
Site http://gift.org/js/gifts.js
Accept from gift.org
Site ^http://.*/(js|script)/
Deny

#- block all gifts.js but not from piwik.alpha.org/gifts/gifts.js
Site http://piwik.org/gifts/gifts.js
Accept from .alpha.org
Site http://*/gifts.js
Deny
The problem is in the first rule that block the exception in the third rule. Simply in NoScript isn't possible advance exceptions.
Mozilla/5.0 (Windows NT 6.0; rv:29.0) Gecko/20100101 Firefox/29.0
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: The exceptions not working

Post by barbaz »

fanNS wrote:The problem is in the first rule that block the exception in the third rule.
Try moving all your exceptions to the top of the ruleset, like this:

Code: Select all

#alpha.org whitelists
Site http://piwik.alpha.org/script/piwik.js http://piwik.org/gifts/gifts.js
Accept from .alpha.org

#gift.org whitelist
Site http://gift.org/js/gifts.js
Accept from gift.org

#- block all in 1. level domain
Site http://piwik.
Deny

#- block all beyond directory script or js like piwik.gentoo.org/script/virus.js  and  piwik.beta.org/js/virus.js
Site ^http://.*/(js|script)/
Deny

#- block all gifts.js but not from piwik.alpha.org/gifts/gifts.js
Site http://*/gifts.js
Deny
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26
fanNS

Re: The exceptions not working

Post by fanNS »

Thank for answers and I'm sorry for my bad English. I'm using NoScript v. 2.6.8.24
You try this real example,

Code: Select all

#- analytics whitelists
Site https://piwik.gentoo.org/piwik.js #- begin
Accept from .gentoo.org
Site http://sourceforge.net/apps/piwik/supertuxkart/piwik.js #- middle
Accept from this-sucks.net #- the domain isn't right wrote therefore has to be blocked but isn't 
Site https://webstats.gnome.org/piwik.js #- end
Accept from .gnome.org

Site ^https?://piwik\. #-begin
Deny
Site ^https?://[a-zA-Z0-9_\-\.\[\]:/@~;,\?&=%#]+/piwik/ #-middle
Deny
Site ^https?://[a-zA-Z0-9_\-\.\[\]:/@~;,\?&=%#]+/piwik\.js  #- end
Deny
Mozilla/5.0 (Windows NT 6.0; rv:29.0) Gecko/20100101 Firefox/29.0
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: The exceptions not works

Post by barbaz »

On what URL(s)? What are the desired results (what resources should be blocked, and what resources should *not* be blocked)?
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26
fanNS

Re: The exceptions not works

Post by fanNS »

OK, I understand so,
for the begin https://piwik.pro/enterprise - is blocked - it's right
for the middle https://github.com/piwik/piwik/tree/master/js - is blocked - it's right
for the end

Code: Select all

code.google.com/p/best-trade-plus/source/browse/trunk/TradePlus/web/pm/js/piwik.js?r=27
- is blocked - it's right

Why doesn't url of sourceforge.net blocked if there is bad domain in the exception?
Mozilla/5.0 (Windows NT 6.0; rv:29.0) Gecko/20100101 Firefox/29.0
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: The exceptions not works

Post by barbaz »

Where are you seeing the sourceforge.net script included?

If you're trying to go there directly in the browser, and it's loading, I see that too, and it looks like that's expected behavior resulting from the presence of the exception.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: The exceptions not works

Post by Thrawn »

I think the trouble is that you should not use backslashes inside character classes (the square brackets).

How about this?

Code: Select all

Site ^https?://(piwik\.|.*/piwik/|.*/piwik\.js)
Deny
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
Post Reply