Nowe posty

xx Dystrybucja pod HP Omen (6)
Wczoraj o 23:30:08
xx [Poradnik] Wyszukiwanie Sterowników (2)
Wczoraj o 21:08:23
lamp Problem z Linux Lite po instalacji (0)
Wczoraj o 19:50:30
xx Ile pingwinów? (1)
Wczoraj o 08:59:24
xx konfiguracja pale moon (0)
2024-03-24, 21:53:42
xx Plasma 6 w Neonie ssie trochę mniej ... (10)
2024-03-23, 02:38:11
xx problem z instalacja sterowników do karty sieciowej (3)
2024-03-18, 18:10:16
xx Plik abc.001 (1)
2024-03-17, 17:48:27
xx Zlecę dopracowanie programu w MatLab (0)
2024-03-13, 15:28:40
xx Linux Mint 21.3 XFCE brak dźwieku po paru minutach (karta muzyczna zintegrowana) (5)
2024-03-12, 23:07:01

Autor Wątek: Squid - nie blokuje stron  (Przeczytany 1394 razy)

Offline mariuszad

  • Users
  • Stały bywalec
  • ***
  • Wiadomości: 122
    • Zobacz profil
Squid - nie blokuje stron
« dnia: 2018-03-01, 14:48:11 »
Witam
Postawiłem squida i chciałbym ograniczyć za jego pomocą użytkownikom dostęp do www w godzinach pracy. Autoryzacja działa  ale coś źle ustawiłem  bo blokada nie działa tak samo jak timework. Moglibyście zerknąć i podpowiedzieć co jest nie tak z tymi ustawieniami?

# squid -z
2018/03/01 14:46:24| Squid is already running!  Process ID 2433

# cat /etc/squid.conf

acl lan src 192.168.1.0/24

##########
acl TimeWorkUser1 time M T W H F A 10:00-15:00
acl User1 src 192.168.1.100
acl GoodSitesUser1 dstdomain "/etc/squid/users/GoodSites.cfg"
#########

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 443         # https

acl CONNECT method CONNECT

auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic credentialsttl 8 hours
auth_param basic realm Proxy: Wymagana autoryzacja
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager

http_access allow localhost

#########
http_access deny User1 !GoodSitesUser1
http_access allow lan  TimeWorkUser1
#########

http_access deny all

http_port 3128

coredump_dir /var/spool/squid

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

cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log

request_header_access Referer deny all
request_header_access X-Forwarded-For deny all
request_header_access Via deny all
request_header_access Cache-Control deny all
forwarded_for off

 #cat GoodSitesUser1.cfg

www.domena1.pl
domena2.pl

iptables:
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
-A POSTROUTING -o enp4s0 -j SNAT --to-source 192.168.0.215

Sqiud działa
1519904778.243    246 192.168.1.100 TCP_TUNNEL/200 3661 CONNECT dmp.dtxngr.com:443 user1 HIER_DIRECT/93.179.237.142 -
1519904778.384    389 192.168.1.100 TCP_TUNNEL/200 3661 CONNECT dmp.dtxngr.com:443 user1 HIER_DIRECT/93.179.237.142 -
1519904778.385   3205 192.168.1.100 TCP_TUNNEL/200 3548 CONNECT pixel.rubiconproject.com:443 user1 HIER_DIRECT/62.67.193.75 -
1519904778.407    155 192.168.1.100 TCP_TUNNEL/200 877 CONNECT pl-gmtdmp.mookie1.com:443 user1 HIER_DIRECT/52.28.4.97 -