clpeter a écrit 2 commentaires

  • # Update

    Posté par  . En réponse au message Mixer les ACLs de Squid. Évalué à 0. Dernière modification le 18 juin 2012 à 11:44.

    Voilà, j'ai plus d'informations à vous donner ;-)

    Il s'agit donc d'un proxy filtrant firewall Linux qui se trouve entre la box Internet et le réseau interne. Les postes clients du réseau interne s'identifie sur un domaine Windows AD 2008 et ce dernier est connecté avec le proxy Linux. Ils sont connectés ensemble car le proxy filtre les accès Internet en fonction du groupe dans lequel est l'utilisateur du LDAP AD.

    Concernant le FTP, ce n'est pas " notre " FTP… je parle d'un accès FTP sur ftp.ubuntu.com via FileZilla par exemple ! Pas de proxy FTP configuré ni de proxy transparent, pour finir le proxy n'est pas le routeur !

    Voici donc en premier le squid.conf qui fonctionne avec le FTP (en gras les lignes qui me semblent importantes) :

    auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp --require-membership-of=XXX\"Utilisateurs Autorisés Internet"
    auth_param ntlm children 5
    auth_param ntlm keep_alive on
    auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
    auth_param basic children 20
    auth_param basic realm XXX
    auth_param basic credentialsttl 2 hours
    auth_param basic casesensitive off
    acl snmppublic snmp_community public
    acl password proxy_auth REQUIRED
    acl manager proto cache_object
    acl PURGE method purge
    acl localhost src 127.0.0.1/32
    acl localdest dst 127.0.0.1/32
    acl SSL_ports port 443 563 631 8501 4000-5000 8070 8090 8443 8753 7070
    acl Safe_ports port 80 21 443 563 70 210 631 1025-65535

    acl Safe_ports port 280
    acl Safe_ports port 488
    acl Safe_ports port 591
    acl Safe_ports port 777
    acl Reserved port 8501 4200
    acl CONNECT method CONNECT
    acl noauth dstdomain "/etc/squid/domaines_noauth"
    acl noauth dstdomain "/etc/squid/domaines_noauth_user"
    acl noauth dstdomain "/etc/squid/domaines_noauth_acad"
    acl nocache dstdomain "/etc/squid/domaines_nocache"
    acl nocache dstdomain "/etc/squid/domaines_nocache_user"
    acl nocache dstdomain "/etc/squid/domaines_nocache_acad"
    acl srcnoauth src "/etc/squid/src_noauth"
    acl srcnoauth src "/etc/squid/src_noauth_user"
    acl srcnoauth src "/etc/squid/src_noauth_acad"
    acl srcnocache src "/etc/squid/src_nocache"
    acl srcnocache src "/etc/squid/src_nocache_user"
    acl srcnocache src "/etc/squid/src_nocache_acad"
    acl nopeerproxy dstdomain "/etc/squid/domaines_nopeerproxy"
    acl amon_lan src 10.100.0.0/16
    acl amon_lan src 101.0.0.0/255.0.0.0
    acl localhosteth1 dst 10.100.1.250/32
    acl reseaueth1 dst 10.100.0.0/16
    acl reseaueth1 dst 101.0.0.0/255.0.0.0
    acl eth1admin0 src 10.100.0.0/16
    acl localdom dstdomain XXX
    acl lxcroot src 127.0.0.1/32
    follow_x_forwarded_for allow localhost
    acl_uses_indirect_client on
    delay_pool_uses_indirect_client on
    log_uses_indirect_client on
    http_access allow manager localhost
    http_access deny manager
    http_access allow purge localhost
    http_access deny purge
    http_access deny !Safe_ports
    http_access deny CONNECT !SSL_ports !Safe_ports
    http_access allow localhost
    http_access deny reseaueth1 !amon_lan
    http_access allow noauth
    http_access allow srcnoauth
    http_access deny Reserved localhosteth1 !eth1admin0
    http_access allow password
    http_access deny all
    http_reply_access allow all
    icp_access deny all
    htcp_access deny all
    ident_lookup_access allow amon_lan
    http_port 127.0.0.1:8080 intercept
    dead_peer_timeout 10 seconds
    hierarchy_stoplist cgi-bin ?
    cache_mem 16 MB
    maximum_object_size_in_memory 16 KB
    memory_replacement_policy lru
    cache_replacement_policy lru
    cache_dir ufs /var/spool/squid 1000 16 256
    minimum_object_size 0 KB
    maximum_object_size 32768 KB
    cache_swap_low 90
    cache_swap_high 95
    access_log syslog:LOG_LOCAL7|LOG_INFO squid
    cache_store_log none
    emulate_httpd_log off
    log_ip_on_direct on
    log_mime_hdrs off
    pid_filename /var/run/squid.pid
    log_fqdn off
    client_netmask 255.255.255.255
    cache_log /var/log/squid/cache.log
    coredump_dir /var/spool/squid3
    ftp_user XXX
    ftp_passive on
    ftp_sanitycheck on
    ftp_telnet_protocol on
    cache deny reseaueth1
    cache deny nocache
    cache deny srcnocache
    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
    quick_abort_min 16 KB
    quick_abort_max 16 KB
    quick_abort_pct 95
    read_ahead_gap 16 KB
    negative_ttl 5 minutes
    positive_dns_ttl 6 hours
    negative_dns_ttl 1 minutes
    range_offset_limit 0 KB
    request_header_max_size 20 KB
    request_body_max_size 10 MB
    ignore_expect_100 off
    forward_timeout 4 minutes
    connect_timeout 1 minutes
    peer_connect_timeout 30 seconds
    read_timeout 15 minutes
    request_timeout 5 minutes
    persistent_request_timeout 1 minutes
    client_lifetime 120 minutes
    half_closed_clients on
    pconn_timeout 120 minutes
    ident_timeout 10 seconds
    shutdown_lifetime 30 seconds
    cache_effective_user proxy
    cache_effective_group proxy
    snmp_port 3401
    snmp_access allow snmppublic lxcroot
    snmp_access allow snmppublic localhost
    snmp_access deny all
    snmp_incoming_address 127.0.0.1
    icp_port 3130
    htcp_port 4827
    icp_query_timeout 0
    maximum_icp_query_timeout 2000
    mcast_icp_query_timeout 2000
    always_direct allow localdom
    check_hostnames on
    allow_underscore on
    dns_defnames off
    hosts_file /etc/hosts
    ipcache_size 1024
    ipcache_low 90
    ipcache_high 95
    fqdncache_size 1024
    cache_mgr XXX

    On remarquera ici que la requête CONNECT est autorisée sur presque tous les ports (80 21 443… 1025-65535).. est-ce que cela est sécurisé ??

    Voici maintenant le squid.conf qui pose problème pour le FTP (la plus grosse différence avec la première version c'est qu'il n'y a pas tous les ports autorisés pour la requête CONNECT) :

    auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp --require-membership-of=XXX\"Utilisateurs Autorisés Internet"
    auth_param ntlm children 5
    auth_param ntlm keep_alive on
    auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
    auth_param basic children 20
    auth_param basic realm XXX
    auth_param basic credentialsttl 2 hours
    auth_param basic casesensitive off
    acl snmppublic snmp_community public
    acl password proxy_auth REQUIRED
    acl manager proto cache_object
    acl PURGE method purge
    acl localhost src 127.0.0.1/32
    acl localdest dst 127.0.0.1/32
    acl SSL_ports port 21 443 563 631 8501 4000-5000 8070 8090 8443 8753 7070
    acl Safe_ports port 80 21 443 563 70 210 631 1025-65535

    acl Safe_ports port 280
    acl Safe_ports port 488
    acl Safe_ports port 591
    acl Safe_ports port 777
    acl Reserved port 8501 4200
    acl CONNECT method CONNECT
    acl noauth dstdomain "/etc/squid/domaines_noauth"
    acl noauth dstdomain "/etc/squid/domaines_noauth_user"
    acl noauth dstdomain "/etc/squid/domaines_noauth_acad"
    acl nocache dstdomain "/etc/squid/domaines_nocache"
    acl nocache dstdomain "/etc/squid/domaines_nocache_user"
    acl nocache dstdomain "/etc/squid/domaines_nocache_acad"
    acl srcnoauth src "/etc/squid/src_noauth"
    acl srcnoauth src "/etc/squid/src_noauth_user"
    acl srcnoauth src "/etc/squid/src_noauth_acad"
    acl srcnocache src "/etc/squid/src_nocache"
    acl srcnocache src "/etc/squid/src_nocache_user"
    acl srcnocache src "/etc/squid/src_nocache_acad"
    acl nopeerproxy dstdomain "/etc/squid/domaines_nopeerproxy"
    acl amon_lan src 10.100.0.0/16
    acl amon_lan src 101.0.0.0/255.0.0.0
    acl localhosteth1 dst 10.100.1.250/32
    acl reseaueth1 dst 10.100.0.0/16
    acl reseaueth1 dst 101.0.0.0/255.0.0.0
    acl eth1admin0 src 10.100.0.0/16
    acl localdom dstdomain XXX
    acl lxcroot src 127.0.0.1/32
    acl ftp proto ftp
    follow_x_forwarded_for allow localhost
    acl_uses_indirect_client on
    delay_pool_uses_indirect_client on
    log_uses_indirect_client on
    http_access allow manager localhost
    http_access deny manager
    http_access allow purge localhost
    http_access deny purge
    http_access deny !Safe_ports
    http_access deny CONNECT !SSL_ports
    http_access allow localhost
    http_access deny reseaueth1 !amon_lan
    http_access allow noauth
    http_access allow srcnoauth
    http_access deny Reserved localhosteth1 !eth1admin0
    http_access allow password
    http_access allow ftp
    http_access deny all
    http_reply_access allow all
    icp_access deny all
    htcp_access deny all
    ident_lookup_access allow amon_lan
    http_port 127.0.0.1:8080 intercept
    dead_peer_timeout 10 seconds
    hierarchy_stoplist cgi-bin ?
    cache_mem 16 MB
    maximum_object_size_in_memory 16 KB
    memory_replacement_policy lru
    cache_replacement_policy lru
    cache_dir ufs /var/spool/squid 1000 16 256
    minimum_object_size 0 KB
    maximum_object_size 32768 KB
    cache_swap_low 90
    cache_swap_high 95
    access_log syslog:LOG_LOCAL7|LOG_INFO squid
    cache_store_log none
    emulate_httpd_log off
    log_ip_on_direct on
    log_mime_hdrs off
    pid_filename /var/run/squid.pid
    log_fqdn off
    client_netmask 255.255.255.255
    cache_log /var/log/squid/cache.log
    coredump_dir /var/spool/squid3
    ftp_user XXX
    ftp_passive on
    ftp_sanitycheck on
    ftp_telnet_protocol on
    cache deny reseaueth1
    cache deny nocache
    cache deny srcnocache
    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
    quick_abort_min 16 KB
    quick_abort_max 16 KB
    quick_abort_pct 95
    read_ahead_gap 16 KB
    negative_ttl 5 minutes
    positive_dns_ttl 6 hours
    negative_dns_ttl 1 minutes
    range_offset_limit 0 KB
    request_header_max_size 20 KB
    request_body_max_size 10 MB
    ignore_expect_100 off
    forward_timeout 4 minutes
    connect_timeout 1 minutes
    peer_connect_timeout 30 seconds
    read_timeout 15 minutes
    request_timeout 5 minutes
    persistent_request_timeout 1 minutes
    client_lifetime 120 minutes
    half_closed_clients on
    pconn_timeout 120 minutes
    ident_timeout 10 seconds
    shutdown_lifetime 30 seconds
    cache_effective_user proxy
    cache_effective_group proxy
    snmp_port 3401
    snmp_access allow snmppublic lxcroot
    snmp_access allow snmppublic localhost
    snmp_access deny all
    snmp_incoming_address 127.0.0.1
    icp_port 3130
    htcp_port 4827
    icp_query_timeout 0
    maximum_icp_query_timeout 2000
    mcast_icp_query_timeout 2000
    always_direct allow localdom
    check_hostnames on
    allow_underscore on
    dns_defnames off
    hosts_file /etc/hosts
    ipcache_size 1024
    ipcache_low 90
    ipcache_high 95
    fqdncache_size 1024
    cache_mgr XXX

    Voici le message d'erreur de FileZilla et un extrait de l'access.log de Squid :

    http://www.hostingpics.net/viewer.php?id=771533filezilla.jpg

    http://www.hostingpics.net/viewer.php?id=717597access.jpg

    Voilà voilà, j'espère avoir été compréhensible et complet !

    Si la première version de Squid ne pose pas de problèmes de sécurité (malgré tous les ports autorisés -1025 à 65535- pour la requête CONNECT), je ne vais pas me prendre le choux, hein ? Mais je n'ai pas la certitude qu'elle soit safe !

    Je vous remercie d'avance pour l'aide que vous pourrez m'apporter :-)

    clpeter

  • # Merci

    Posté par  . En réponse au message Mixer les ACLs de Squid. Évalué à 0. Dernière modification le 17 juin 2012 à 11:22.

    Merci pour vos réponses !

    Effectivement, je n'ai pas indiqué le squid.conf par exemple…

    Mais je ne l'ai pas sous la main, par contre, dès lundi matin je vais faire les essais et le cas échéant, vous envoyer mon squid.conf avec plus de détails sur la situation.

    Bon dimanche :)