LINUX.ORG.RU
ФорумAdmin

Squid - access denied

 


0

1

Всем привет! Squid запрещает всем доступ

squid.conf

#
# Recommended minimum configuration:
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl hslan src 10.0.0.0/28       # RFC1918 possible internal network
acl openvpn src 10.0.2.0/29     # RFC1918 possible internal network

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localhost hslan openvpn
http_access deny all

# Squid normally listens to port 3128
http_port 10.0.0.2:3128 intercept options=NO_SSLv3:NO_SSLv2
https_port 10.0.0.2:3129 intercept ssl-bump options=ALL:NO_SSLv3:NO_SSLv2 connection-auth=off cert=/usr/local/etc/squid/squidCA.pem
http_port 10.0.0.2:3130 options=NO_SSLv3:NO_SSLv2

always_direct allow all
sslproxy_cert_error allow all
sslproxy_flags DONT_VERIFY_PEER

sslcrtd_program /usr/local/libexec/squid/ssl_crtd -s /var/lib/ssl_db -M 4MB

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/squid/cache 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/squid/cache

reply_header_max_size 200 KB
#
# 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

Следуя из конфига я разрешил доступ для подсетей 10.0.0.0/28 и 10.0.2.0/29, но я пробую подключиться с 10.0.0.5 и получаю Access Denied!

http_access allow localhost hslan openvpn
Вот это читается как «разрешить доступ если адрес попадает в localhost и hslan и openvpn», что вряд ли бывает.

Стоит попробовать

http_access allow localhost 
http_access allow hslan
http_access allow openvpn
или (с версии 3.4)
acl clients any-of localhost hslan openvpn
http_access allow clients

Kuzz ★★★
()
Последнее исправление: Kuzz (всего исправлений: 1)
Ответ на: комментарий от Kuzz
1518975767.167     33 10.0.0.2 TCP_MISS/403 4438 GET http://ya.ru/ - HIER_NONE/- text/html
1518975767.168     40 10.0.0.5 TCP_MISS/403 4540 GET http://ya.ru/ - ORIGINAL_DST/10.0.0.2 text/html
mfhunruh
() автор топика
Ответ на: комментарий от Kuzz

Вот ipfw

00100   0     0 check-state :default
00200  48  1344 allow ip from any to any via lo0
00300   0     0 deny ip from any to 127.0.0.0/8
00400   0     0 deny ip from 127.0.0.0/8 to any
00500   0     0 deny ip from any to 172.16.0.0/12 in via re0
00600   0     0 deny ip from any to 192.168.0.0/16 in via re0
00700   0     0 deny ip from any to 0.0.0.0/8 in via re0
00800   0     0 deny ip from any to 169.254.0.0/16 in via re0
00900  12  2560 deny ip from any to 240.0.0.0/4 in via re0
01000   0     0 deny icmp from any to any frag
01100   0     0 deny log icmp from any to 255.255.255.255 in via re0
01200   0     0 deny log icmp from any to 255.255.255.255 out via re0
01300   0     0 deny ip from 172.16.0.0/12 to any out via re0
01400   0     0 deny ip from 192.168.0.0/16 to any out via re0
01500   0     0 deny ip from 0.0.0.0/8 to any out via re0
01600   0     0 deny ip from 169.254.0.0/16 to any out via re0
01700   0     0 deny ip from 224.0.0.0/4 to any out via re0
01800   0     0 deny ip from 240.0.0.0/4 to any out via re0
01900 663 95068 allow tcp from any to any established
02000  21  1984 allow ip from 10.0.0.2 to any out xmit re0
02100   0     0 allow tcp from me to any out via re0 uid squid keep-state :default
02200   0     0 fwd 10.0.0.2,3128 tcp from 10.0.2.0/29 to any dst-port 80-83,8080-8088 out via re0 keep-state :default
02300   0     0 fwd 10.0.0.2,3128 tcp from 10.0.0.0/28 to any dst-port 80-83,8080-8088 out via re0 keep-state :default
02400  10  2984 allow udp from any 53 to any via re0
02500   0     0 allow tcp from any 3128 to any via re0
02600   0     0 allow tcp from any 3129 to any via re0
02700   0     0 allow tcp from any 3130 to any via re0
02800   0     0 allow udp from 10.0.0.0/28 to any dst-port 53 via re0
02900   0     0 allow udp from 10.0.2.0/29 to any dst-port 53 via re0
03000   0     0 allow icmp from any to any icmptypes 0,8,11
03100   0     0 allow tcp from 10.0.0.0/28 to 10.0.0.2 dst-port 2001 via re0
03200   0     0 allow tcp from 10.0.2.0/29 to 10.0.0.2 dst-port 2001 via re0
03300   0     0 allow tcp from 10.0.0.0/28 to 10.0.0.2 dst-port 3128 via re0
03400   0     0 allow tcp from 10.0.2.0/29 to 10.0.0.2 dst-port 3128 via re0
03500   0     0 allow tcp from 10.0.0.0/28 to 10.0.0.2 dst-port 3129 via re0
03600   0     0 allow tcp from 10.0.2.0/29 to 10.0.0.2 dst-port 3129 via re0
03700   0     0 allow tcp from 10.0.0.0/28 to 10.0.0.2 dst-port 3130 via re0
03800   0     0 allow tcp from 10.0.2.0/29 to 10.0.0.2 dst-port 3130 via re0
03900   0     0 allow udp from 10.0.0.0/28 to 10.0.0.2 dst-port 161 via re0
04000   0     0 allow tcp from 10.0.0.0/28 to 10.0.0.2 dst-port 161 via re0
04100  26  2420 deny ip from any to any

mfhunruh
() автор топика
Ответ на: комментарий от mfhunruh

Может разрешающие ACL выше поставить типа:

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

Bootmen ☆☆☆
()
Ответ на: комментарий от Bootmen

Делал и сам сервис перезагружал

ifconfig сервера

re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
	ether a0:b3:cc:7d:ff:9c
	hwaddr a0:b3:cc:7d:ff:9c
	inet 10.0.0.2 netmask 0xfffffff0 broadcast 10.0.0.15 
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
	groups: lo 

С него, кстати, тоже access denied если в links прописать 10.0.0.2:3128

mfhunruh
() автор топика
Ответ на: комментарий от mfhunruh

У меня вообще простая рабочая.

# Админы и особо приближенные к ним.
acl best_ip src "/etc/squid3/list/best-ip"
http_access allow best_ip
icp_access allow best_ip
miss_access allow best_ip
Файл «/etc/squid3/list/best-ip»:
10.12.11.2
10.12.11.3
10.12.11.4
И все. Правда есть свои еще злобные ACL для ограничения всяких прытких узеров. Могу поделится.

Bootmen ☆☆☆
()
Ответ на: комментарий от Bootmen

Тут проблема скорее всего в прозрачном прокси, так как без прозрачных работает

mfhunruh
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.