Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Problema interaccion entre Squid y SquidGuard

    Español
    5
    14
    1.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DoNeL
      last edited by

      @Finger:

      Siempre es squid en el muestra los mensajes.

      asegúrate que en common ACL tengas activada Default access [all] en Allow

      Tengo puesto en el common ACL Allow. Segun veo en videotutoriales y manuales creo que hay como dos mensaje, el que te da Squid con su icono del calamar, y luego hay otro que es el queda squidguard cuando filtra contenido. A mi en ningun momento me ha llegado a salir el de squidguard ya que aun teniendo el common ACL como allow, me deniega todo el squid, es como si antes de hacerle la consulta a squidguard, directamente me capa.

      De ahi deduzco que no esta bien la interaccion con el squidguard, pero por mas que reviso no encuentro el problema.

      Saludos.

      1 Reply Last reply Reply Quote 0
      • perikoP
        periko
        last edited by

        Envianos la configuracion de squid, squid de fabrica no bloque nada, al contrario deja navegar a toda la red para la cual fue configurado.

        Tambien subes la configuracion de tu LAN por donde trabaja squid.

        Tambien el log de squid, quiero ver el log donde bloquea.

        Saludos.

        Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
        www.bajaopensolutions.com
        https://www.facebook.com/BajaOpenSolutions
        Quieres aprender PfSense, visita mi canal de youtube:
        https://www.youtube.com/c/PedroMorenoBOS

        1 Reply Last reply Reply Quote 0
        • D
          DoNeL
          last edited by

          Buenos dias,

          Os pongo el mapa de red de una manera resumida pero funcional:

          Captura

          Acabo de configurar de cero pfsense y solo he instalado squid sin squidguard. Esta es la configuracion del archivo squid.conf

          # This file is automatically generated by pfSense
          # Do not edit manually !
          
          http_port 10.100.0.191:8080
          icp_port 0
          digest_generation off
          dns_v4_first off
          pid_filename /var/run/squid/squid.pid
          cache_effective_user squid
          cache_effective_group proxy
          error_default_language en
          icon_directory /usr/local/etc/squid/icons
          visible_hostname PFS0401
          cache_mgr redes@grupogss.com
          access_log /var/squid/logs/access.log
          cache_log /var/squid/logs/cache.log
          cache_store_log none
          netdb_filename /var/squid/logs/netdb.state
          pinger_enable on
          pinger_program /usr/local/libexec/squid/pinger
          
          logfile_rotate 3
          debug_options rotate=3
          shutdown_lifetime 3 seconds
          # Allow local network(s) on interface(s)
          acl localnet src  10.100.0.0/24
          forwarded_for on
          uri_whitespace strip
          
          acl dynamic urlpath_regex cgi-bin \?
          cache deny dynamic
          
          cache_mem 64 MB
          maximum_object_size_in_memory 256 KB
          memory_replacement_policy heap GDSF
          cache_replacement_policy heap LFUDA
          minimum_object_size 0 KB
          maximum_object_size 4 MB
          cache_dir ufs /var/squid/cache 3000 16 256
          offline_mode off
          cache_swap_low 90
          cache_swap_high 95
          cache allow all
          # Add any of your own refresh_pattern entries above these.
          refresh_pattern ^ftp:    1440  20%  10080
          refresh_pattern ^gopher:  1440  0%  1440
          refresh_pattern -i (/cgi-bin/|\?) 0  0%  0
          refresh_pattern .    0  20%  4320
          
          #Remote proxies
          
          # Setup some default acls
          # ACLs all, manager, localhost, and to_localhost are predefined.
          acl allsrc src all
          acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901  8080 3129 1025-
          65535
          acl sslports port 443 563
          
          acl purge method PURGE
          acl connect method CONNECT
          
          # Define protocols used for redirects
          acl HTTP proto HTTP
          acl HTTPS proto HTTPS
          http_access allow manager localhost
          
          http_access deny manager
          http_access allow purge localhost
          http_access deny purge
          http_access deny !safeports
          http_access deny CONNECT !sslports
          
          # Always allow localhost connections
          http_access allow localhost
          
          request_body_max_size 0 KB
          delay_pools 1
          delay_class 1 2
          delay_parameters 1 -1/-1 -1/-1
          delay_initial_bucket_level 100
          delay_access 1 allow allsrc
          
          # Reverse Proxy settings
          
          # Custom options before auth
          
          # Setup allowed ACLs
          # Allow local network(s) on interface(s)
          http_access allow localnet
          # Default block all to be sure
          http_access deny allsrc
          

          Y este es el resultado cuando hago una peticion a google por ejemplo

          19.09.2017 10:19:43	10.100.31.174	TCP_DENIED/403	http://www.google.es/favicon.ico	-	-
          19.09.2017 10:19:43	10.100.31.174	TCP_DENIED/403	http://pfs0401:8080/squid-internal-static/icons/SN.png	-	-
          19.09.2017 10:19:43	10.100.31.174	TCP_DENIED/403	http://www.google.es/	-	-
          19.09.2017 10:19:42	10.100.31.174	TCP_DENIED/403	www.google.com:443	-	-
          19.09.2017 10:19:42	10.100.31.174	TCP_DENIED/403	www.google.com:443	-	-
          19.09.2017 10:19:42	10.100.31.174	TCP_DENIED/403	www.google.com:443	-	-
          19.09.2017 10:19:42	10.100.31.174	TCP_DENIED/403	www.google.com:443	-	-
          19.09.2017 10:19:41	10.100.31.174	TCP_DENIED/403	www.google.com:443
          

          Un saludo.

          1 Reply Last reply Reply Quote 0
          • E
            elbocha01
            last edited by

            te cuelgo mi config de laboratorio por si te sirve.
            por el momento desactivado, no bloquea nada :P
            uso pf, 2.3-RELEASE (i386).
            tiene los bump para filtrado https, hay lineas q tal ves no le tenes q dar bola, pero funcionar funciona, falta el tilde tambien de proxy transparente. bueno chusmealo

            This file is automatically generated by pfSense

            Do not edit manually !

            http_port 192.168.6.1:8080 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=10MB cert=/usr/local/etc/squid/serverkey.pem $

            icp_port 0
            dns_v4_first on
            pid_filename /var/run/squid/squid.pid
            cache_effective_user squid
            cache_effective_group proxy
            error_default_language en
            icon_directory /usr/local/etc/squid/icons
            visible_hostname localhost
            cache_mgr mail@moltech.com.ar
            access_log /var/squid/logs/access.log
            cache_log /var/squid/logs/cache.log
            cache_store_log none
            netdb_filename /var/squid/logs/netdb.state
            pinger_enable on
            pinger_program /usr/local/libexec/squid/pinger
            sslcrtd_program /usr/local/libexec/squid/ssl_crtd -s /var/squid/lib/ssl_db -M 4MB -b 2048
            sslcrtd_children 5
            sslproxy_capath /usr/local/share/certs/
            sslproxy_options NO_SSLv2,NO_SSLv3,SINGLE_DH_USE
            sslproxy_cipher EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+R$
            sslproxy_cert_error allow all

            logfile_rotate 0
            debug_options rotate=0
            shutdown_lifetime 3 seconds

            Allow local network(s) on interface(s)

            acl localnet src  192.168.6.0/24
            forwarded_for on
            httpd_suppress_version_string on
            uri_whitespace strip

            cache_mem 64 MB
            maximum_object_size_in_memory 256 KB
            memory_replacement_policy heap GDSF
            cache_replacement_policy heap LFUDA
            minimum_object_size 0 KB
            maximum_object_size 30 MB
            cache_dir ufs /var/squid/cache 20000 16 256
            offline_mode off
            cache_swap_low 90
            cache_swap_high 95
            cache allow all

            Add any of your own refresh_pattern entries above these.

            refresh_pattern ^ftp:    1440  20%  10080
            refresh_pattern ^gopher:  1440  0%  1440
            refresh_pattern -i (/cgi-bin/|?) 0  0%  0
            refresh_pattern .    0  20%  4320

            #Remote proxies

            Setup some default acls

            From 3.2 further configuration cleanups have been done to make things easier and safer. The manager, localhost, and to_localhost ACL defi$

            acl localhost src 127.0.0.1/32

            acl allsrc src all
            acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901 443 8080 8081 1025-65535 8080 8081
            acl sslports port 443 563 443 8080 8081

            From 3.2 further configuration cleanups have been done to make things easier and safer. The manager, localhost, and to_localhost ACL defi$

            #acl manager proto cache_object

            acl purge method PURGE
            acl connect method CONNECT

            Define protocols used for redirects

            acl HTTP proto HTTP
            acl HTTPS proto HTTPS
            acl allowed_subnets src 192.168.6.0/24
            http_access allow manager localhost

            http_access deny manager
            http_access allow purge localhost
            http_access deny purge
            http_access deny !safeports
            http_access deny CONNECT !sslports

            Always allow localhost connections

            From 3.2 further configuration cleanups have been done to make things easier and safer.

            The manager, localhost, and to_localhost ACL definitions are now built-in.

            http_access allow localhost

            quick_abort_min 0 KB
            quick_abort_max 0 KB
            request_body_max_size 0 KB
            delay_pools 1
            delay_class 1 2
            delay_parameters 1 -1/-1 -1/-1
            delay_initial_bucket_level 100

            Reverse Proxy settings

            Package Integration

            url_rewrite_program /usr/local/bin/squidGuard -c /usr/local/etc/squidGuard/squidGuard.conf
            url_rewrite_bypass off
            url_rewrite_children 16 startup=8 idle=4 concurrency=0

            Custom options before auth

            always_direct allow all
            ssl_bump server-first all

            always_direct allow all
            ssl_bump server-first all

            Setup allowed ACLs

            Allow local network(s) on interface(s)

            http_access allow allowed_subnets
            http_access allow localnet

            Default block all to be sure

            http_access deny allsrc

            Troncales de Fibra Óptica? O.o en que me estoy metiendo?
            La Felicidad es como el aroma de un buen vino, solo dura en el presente que este esta en la copa!

            1 Reply Last reply Reply Quote 0
            • J
              j.sejo1
              last edited by

              Tu problema de acceso denegado con el squid esta aqui:

              tienes al ACL del squid.

              10.100.0.0/24

              Pero en los log que pegas tienes ip de:  10.100.31.174

              9.09.2017 10:19:43 10.100.31.174 TCP_DENIED/403 http://www.google.es/favicon.ico - -
              19.09.2017 10:19:43 10.100.31.174 TCP_DENIED/403 http://pfs0401:8080/squid-internal-static/icons/SN.png - -
              19.09.2017 10:19:43 10.100.31.174 TCP_DENIED/403 http://www.google.es/ - -
              19.09.2017 10:19:42 10.100.31.174 TCP_DENIED/403 www.google.com:443 - -
              19.09.2017 10:19:42 10.100.31.174 TCP_DENIED/403 www.google.com:443 - -
              19.09.2017 10:19:42 10.100.31.174 TCP_DENIED/403 www.google.com:443 - -
              19.09.2017 10:19:42 10.100.31.174 TCP_DENIED/403 www.google.com:443 - -
              19.09.2017 10:19:41 10.100.31.174 TCP_DENIED/403 www.google.com:443

              Por lo que tu acl (en el squid) deberia ser por lo menos:  10.100.0.0/16    y  NO 24.

              Saludos.

              Pfsense - Bacula - NagiosZabbix - Zimbra - AlienVault
              Hardening Linux
              Telegram: @vtlbackupbacula
              http://www.smartitbc.com/en/contact.html

              1 Reply Last reply Reply Quote 0
              • perikoP
                periko
                last edited by

                Ahi esta el problema marcado por j.sejo1.

                /16 … tantas redes tienes o solo pusistes esta mascara como prueba?

                Nos avisas si al hacer el cambio en squid te deja navegar, saludos.

                Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
                www.bajaopensolutions.com
                https://www.facebook.com/BajaOpenSolutions
                Quieres aprender PfSense, visita mi canal de youtube:
                https://www.youtube.com/c/PedroMorenoBOS

                1 Reply Last reply Reply Quote 0
                • D
                  DoNeL
                  last edited by

                  Efectivamente, de ahi venia el problema. Gracias a todos!

                  Ahora ya tengo filtrado a traves de squidguard, pero tengo el siguiente problema:

                  He definido un common acl que por defecto deniegue todo, luego he creado un group acl para que permita ciertas categorias a usuarios que pertenecen a un grupo de AD.

                  Segun squidguard, la cadena que se tiene que usar es esta:

                  ldapusersearch ldap://192.168.0.100/DC=domain,DC=com?sAMAccountName?sub?(&(sAMAccountName=%s)(memberOf=CN=it%2cCN=Users%2cDC=domain%2cDC=com))
                  

                  Yo la he definido con mis configuraciones:

                  ldapusersearch ldap://XXX.XXX.XXX.XXX/DC=XXX,DC=XX?sAMAccountName?sub?(&(sAMAccountName=%s)(memberOf=CN=GOEradius-AdminRedes%2cOU=Radius%2cOU=Otros%2cOU=Grupos%2cDC=XXX%2cDC=XX))
                  

                  Donde pone XXX son los datos de mi DC.

                  Con esa configuración no me permite el acceso, se queda en la default de common. Es como si no fuera capaz de validar el grupo.

                  He probado también ha poner un "%2D" para sustituir el "-" en CN=GOEradius-AdminRedes y tampoco.

                  Un saludo.

                  1 Reply Last reply Reply Quote 0
                  • perikoP
                    periko
                    last edited by

                    Te recomiendo abrir otro hilo para este tema asi no se pierde uno.
                      Saludos.

                    Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
                    www.bajaopensolutions.com
                    https://www.facebook.com/BajaOpenSolutions
                    Quieres aprender PfSense, visita mi canal de youtube:
                    https://www.youtube.com/c/PedroMorenoBOS

                    1 Reply Last reply Reply Quote 0
                    • J
                      j.sejo1
                      last edited by

                      inicia otro hilo.

                      Y te muestro como lo tengo yo con un AD.

                      Pfsense - Bacula - NagiosZabbix - Zimbra - AlienVault
                      Hardening Linux
                      Telegram: @vtlbackupbacula
                      http://www.smartitbc.com/en/contact.html

                      1 Reply Last reply Reply Quote 0
                      • D
                        DoNeL
                        last edited by

                        @j.sejo1:

                        inicia otro hilo.

                        Y te muestro como lo tengo yo con un AD.

                        Aqui lo tienes:

                        https://forum.pfsense.org/index.php?topic=136898.0

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.