Squid 프록시의 여러 ACL

Squid 프록시의 여러 ACL

이것은 내 오징어 구성 파일입니다.

특정 사용자에게 특정 웹 콘텐츠에 대한 액세스 권한을 부여하고 싶지만 이 프로필을 사용하면 특정 사용자에게 튜토리얼에 대한 액세스 권한을 부여하면 소셜 네트워크는 차단되지만 영화에는 액세스할 수 있습니다. 허용과 거부를 별도로 그룹화하여 확인하더라도 동일한 문제가 여전히 존재합니다. 튜토리얼에 대한 액세스 권한을 부여할 수는 없지만 영화에 대한 액세스는 여전히 차단됩니다.

acl localnet src 10.1.1.0/24
acl special src "/etc/squid/special.txt" # All Access IPs
acl unlimited src "/etc/squid/unlimited.txt"        # Full Download access
acl allow_proxy src "/etc/squid/allow_proxy.txt"    # Allow Proxy sites
acl allow_social src "/etc/squid/allow_social.txt"  # Allow Social networking

acl allow_tutorial src "/etc/squid/allow_tutorial.txt"  # Allow Tutorial
acl allow_movie src "/etc/squid/allow_movie.txt"    # Allow Jobs
acl allow_jobs src "/etc/squid/allow_jobs.txt"      # Allow Movie

#Allow / Block
acl goodkey url_regex "/etc/squid/goodkey.txt"
acl proxy url_regex "/etc/squid/proxy.txt"
acl social url_regex "/etc/squid/social.txt"
acl tutorial url_regex "/etc/squid/tutorial.txt"
acl movie url_regex "/etc/squid/movie.txt"
acl jobs url_regex "/etc/squid/jobs.txt"

#Download Limit
reply_body_max_size 3000 KB localnet !unlimited
request_body_max_size 3000 KB localnet !unlimited

#Allow
http_access allow special
http_access allow goodkey

#Proxy
http_access allow allow_proxy
http_access deny proxy

#Social
http_access allow allow_social
http_access deny social

#Tutorial
http_access allow allow_tutorial
http_access deny tutorial

#Movie
http_access allow allow_movie
http_access deny movie

#Jobs 
http_access allow allow_jobs
http_access deny jobs

#ACL Allow
http_access allow localnet

#And finally deny all other access to this proxy
http_access allow localhost
http_access deny all

답변1

http_access다음과 같이 ACL을 한 줄로 그룹화해야 합니다 .

http_access allow allow_tutorial tutorial
http_access deny allow_tutorial

이런 방식으로 ACL을 설정하면 오징어에게 다음과 같이 지시합니다.

  1. ACL의 IP가 allow_tutorialACL의 URL에 액세스하려고 시도하는 경우tutorial 허락하다
  2. ACL의 IP 중 하나 allow_tutorial라도 URL에 액세스하려고 시도하는 경우그것을 부정하다

관련 정보