[squid-users] ACL and http_access

Antony Stone Antony.Stone at squid.open.source.it
Sun Nov 15 09:06:59 UTC 2015


On Thursday 12 November 2015 at 15:55:10, Magic Link wrote:

> I want people don't have access to Internet, except one hour twice a day
> with only some urls.listed in a file

On 14/11/2015 11:23 p.m., Magic Link wrote:

> I 've made a mistake so what i want is users can access Internet, except
> these two periods where they can access only few sites defined in the
> file. I'll try next monday and come back here.

On Sunday 15 November 2015 at 03:01:44, Amos Jeffries wrote:

> Then your config needs to be:
> 
>  acl hours time MTWHF 09:30-10:30
>  acl hours time MTWHF 17:30-18:30
> 
>  http_access allow localhost
>  http_access deny hours !whitelist
>  http_access allow network
>  http_access deny all

Or, if you find it easier to understand:

acl hours time MTWHF 09:30-10:30
acl hours time MTWHF 17:30-18:30

http_access allow localhost
http_access allow network hours whitelist
http_access allow network !hours
http_access deny all

That means "allow network access to whitelisted sites during the defined hours, 
or allow general access outside those hours".

Personally I find a set of "allow" rules easier followed by a "deny" rules to 
understand the logic of than interleaved "allow" and "deny" rules :)

However, I find the new requirement very strange - would you mind sharing, just 
for interest's sake, why you want to implement this type of Internet access?



Antony.

-- 
I want to build a machine that will be proud of me.

 - Danny Hillis, creator of The Connection Machine

                                                   Please reply to the list;
                                                         please *don't* CC me.


More information about the squid-users mailing list