LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-08-2009, 04:44 AM   #1
rahul_khatavkar
LQ Newbie
 
Registered: Oct 2009
Posts: 1

Rep: Reputation: 0
Question CentOs Squid settings


I'm using CentOs squid as a firewall. Also set ncsa_auth for net surfing for all the users.

It asks users for username and password but.....if he cancel that log window.....he is able to surf the net.

My squid config is as follows:


#auth_param basic program /usr/libexec/ncsa_auth /usr/etc/passwd
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd


#Recommended minimum configuration:
acl ncsa_users proxy_auth REQUIRED
acl AuthorizedUsers proxy_auth REQUIRED

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
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

#Default:
http_access deny all
#
#Recommended minimum configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
#
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

acl HR src "/etc/squid/HRComputers"
acl HRBlockedsites url_regex -i "/etc/squid/HRSites"
http_access allow HR !HRBlockedsites
acl users src "/etc/squid/usersComputers"
acl usersBlockedsites url_regex -i "/etc/squid/usersSites"
http_access allow users !usersBlockedsites
acl servers src "/etc/squid/serverIP"
acl serversBlockedsites url_regex -i "/etc/squid/serverSites"
http_access allow servers !serversBlockedsites
acl porn url_regex -i "/etc/squid/pornDomains"
http_access deny all porn
acl operation src "/etc/squid/operationComputers"
acl operationBlockedsites url_regex -i "/etc/squid/operationSites"
http_access allow operation !operationBlockedsites

http_access allow ncsa_users !users !servers !porn !HR !operation
http_access allow AuthorizedUsers
#http_reply_access allow all
log_access allow ncsa_users


# Example rule allowing access from your local networks. Adapt
# to list your (internal) IP networks from where browsing should
# be allowed
#acl our_networks src 192.168.1.0/24 192.168.2.0/24
#http_access allow our_networks

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

#Default:
# icp_access deny all
#
#Allow ICP queries from everyone
icp_access allow all



# Squid normally listens to port 3128
http_port 3128 transparent




#Default:
# dead_peer_timeout 10 seconds

# TAG: hierarchy_stoplist
# A list of words which, if found in a URL, cause the object to
# be handled directly by this cache. In other words, use this
# to not query neighbor caches for certain objects. You may
# list this option multiple times. Note: never_direct overrides
# this option.
#We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?


#Default:
# none

# TAG: access_log
# These files log client request activities. Has a line every HTTP or
# ICP request. The format is:
# access_log <filepath> [<logformat name> [acl acl ...]]
# access_log none [acl acl ...]]
#
# Will log to the specified file using the specified format (which
# must be defined in a logformat directive) those entries which match
# ALL the acl's specified (which must be defined in acl clauses).
# If no acl is specified, all requests will be logged to this file.
#
# To disable logging of a request use the filepath "none", in which case
# a logformat name should not be specified.
#
# To log the request via syslog specify a filepath of "syslog":
#
# access_log syslog[:facility.priority] [format [acl1 [acl2 ....]]]
# where facility could be any of:
# authpriv, daemon, local0 .. local7 or user.
#
# And priority could be any of:
# err, warning, notice, info, debug.
#
# Note: 2.6.STABLE14 and earlier only supports a slightly different
# and undocumented format with all uppercase LOG_FACILITY|LOG_PRIORITY
access_log /var/log/squid/access.log squid



# OPTIONS FOR TUNING THE CACHE
# -----------------------------------------------------------------------------

# TAG: cache
# A list of ACL elements which, if matched, cause the request to
# not be satisfied from the cache and the reply to not be cached.
# In other words, use this to force certain objects to never be cached.
#
# You must use the word 'DENY' to indicate the ACL names which should
# NOT be cached.
#
# Default is to allow all to be cached
#We recommend you to use the following two lines.
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY


#Suggested default:
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320



#Default:
# cache_vary on

# TAG: broken_vary_encoding
# Many servers have broken support for on-the-fly Content-Encoding,
# returning the same ETag on both plain and gzip:ed variants.
# Vary replies matching this access list will have the cache split
# on the Accept-Encoding header of the request and not trusting the
# ETag to be unique.
#
# Apache mod_gzip and mod_deflate known to be broken so don't trust
# Apache to signal ETag correctly on such responses
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
 
Old 10-09-2009, 01:04 PM   #2
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 299

Rep: Reputation: 62
Have you created the NCSA password file?
 
Old 10-09-2009, 04:05 PM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by rahul_khatavkar View Post
I'm using CentOs squid as a firewall.
Repeat after me:

Squid is not a firewall.
Squid is not a firewall.
Squid is not a firewall.
Squid is not a firewall.

So, if you have a machine with two eth ports, so that you can separate the networks, and you have a firewall, adding squid to this can give you the ability to force your users to go through the squid auth.

Otherwise, there will always be a way around it although maybe you think that your users aren't smart enough to find it. Do you want to bet on that, though.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Folder Permission Settings - CentOS 64bit vps nishan Linux - Server 1 09-09-2009 04:16 PM
CentOS 5.2 display settings problem JosipMiller Linux - Software 0 08-22-2009 01:40 PM
WHich squid for CentOS? qwertyjjj Linux - Server 12 08-04-2009 10:52 AM
squid error on centos 5 ssilayaraja Linux - Networking 1 03-26-2008 04:13 AM
Help with Squid Settings mephitic Linux - Software 4 07-29-2004 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration