This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Transparent Proxy: how can I block some users?

If I active transparent proxy, all clients go on internet, but I want block some of them.
How can I create packet rules for this?

Thanks


This thread was automatically locked due to age.
Parents
  • You would need to know the IP Address of each client and a network definition for each one, create a network group containing all the clients definitions and then use a drop rule.

    Or put them on thier own subnet and drop that subnet
  • biapar,

    you can't in Webadmin! If you enable the proxy
    all IP adresses covered by  allowed networks
    can access the web - the rules are in an AUTO table
    which are processed before the USR tables.

    You can use an internal function:

     
    code:
    touch /etc/rc.d/ipfilter.local
    chmod 400 /etc/rc.d/ipfilter.local

    Add your filter rule to /etc/rc.d/ipfilter.local

     
    code:
    /usr/local/bin/iptables -I AUTO_INPUT -s ip_of_client_to_block/32 -d internal_IP_of_firewall/32 -j LOGDROP  

    Rerun middleware to activate your settings

     
    code:
    /etc/rc.d/mdw restart

    Hope that does the job for you   [;)]  

    o|iver
  • Is there a more simple method?
  • Yes there is another Method,
    for the http-proxy you can define "allowed networks" but for that you must make a networkobjekt for every workstation that you would allow to connect to the internet but only for ip-addresses not for users.

    firebear
  • Maybe somebody should consider adding an option for not allowed hosts in the Proxy HTTP Menu ? This should be very useful, I think. Or maybe adding a new rule status, ie. for dropping, covering proxy settings ?
  • I second that. 

    However, to coin what another user said, you could, with a bit of planning have a happy medium.

    Example for bocking the last 16 addresses:

    On a 192.168.0.0/24 network, you could define say a /28 at the end of the range and then assign (either statically or via DHCP reservation) those specific users to that reserved block. 

    Then in your definitions, define the following networks and add them to one Network group (assuming you reserved the /28 at the end)

    192.168.0.0/25 (0-127 - 128)
    192.168.0.128/26 (128-191 - 64)
    192.168.0.192/27 (192-223 - 32)
    192.168.0.224/28 (224-239 - 16)

    Add those to a group and set those up to be the allowed networks for the HTTP proxy.

    Optionally also add a group for
    192.168.0.240/28 (240-255 - 16)

    And block to target any/all if you wish to block all other services (probably towards the end of your list).

    It's not the best solution, but it would work. 

    Considering it here vs. the manual rule.
     
     [size="1"][ 04 December 2002, 18:17: Message edited by: HTMLSpinnr ][/size]
Reply
  • I second that. 

    However, to coin what another user said, you could, with a bit of planning have a happy medium.

    Example for bocking the last 16 addresses:

    On a 192.168.0.0/24 network, you could define say a /28 at the end of the range and then assign (either statically or via DHCP reservation) those specific users to that reserved block. 

    Then in your definitions, define the following networks and add them to one Network group (assuming you reserved the /28 at the end)

    192.168.0.0/25 (0-127 - 128)
    192.168.0.128/26 (128-191 - 64)
    192.168.0.192/27 (192-223 - 32)
    192.168.0.224/28 (224-239 - 16)

    Add those to a group and set those up to be the allowed networks for the HTTP proxy.

    Optionally also add a group for
    192.168.0.240/28 (240-255 - 16)

    And block to target any/all if you wish to block all other services (probably towards the end of your list).

    It's not the best solution, but it would work. 

    Considering it here vs. the manual rule.
     
     [size="1"][ 04 December 2002, 18:17: Message edited by: HTMLSpinnr ][/size]
Children
  • And a variation on this need is to be able to configure Squid for the "always_direct" directive.  My needs are to transparently proxy for internet bound URIs but go direct for my DMZ servers (no benefit caching local servers).
    Or is there another way?