/usr/share/zentyal/stubs/squid/squid.conf.mas is in zentyal-squid 2.3.11+quantal1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | <%doc>
Main configuration file for Squid daemon
Parameters:
snmpEnabled - Boolean indicating if SNMP is enabled or not
</%doc>
<%args>
$port
$transparent
$https
@localnets
@rules
@objectsDelayPools
@notCachedDomains
@nameservers
$append_domain
$cache_host
$cache_port
$cache_user
$cache_passwd
$filter
$memory
$max_object_size
$cacheDirSize
$snmpEnabled => 0
$urlRewriteProgram => undef
$principal
$realm
</%args>
<%perl>
our $maxAclNameLength = 31;
our %longAclNames = ();
sub _timeAclsInPolicy
{
my ($policy, @ids) = @_;
@ids = grep { defined ($_) } @ids;
my $id = join '_', @ids;
my $acls = '';
if ($policy->{timeDays}) {
$acls = _aclName('timeDays_' . $id);
$acls .= ' ';
}
if ($policy->{timeHours}) {
$acls .= _aclName('timeHours_' . $id);
}
return $acls;
}
# needed because space scape doesnt work in acl names
sub _escapeWS
{
my ($string) = @_;
$string =~ s{ }{__}g;
return $string;
}
# needed to avoid log acl problems
sub _aclName
{
my ($name) = @_;
if (length($name) <= $maxAclNameLength) {
return _escapeWS($name);
}
if (not exists $longAclNames{$name}) {
my $nextId = 1 + keys %longAclNames;
$nextId = 'longAcl' . $nextId;
$longAclNames{$name} = $nextId;
}
return _escapeWS($longAclNames{$name});
}
</%perl>
# <EBOX> TAG_HTTPORT #
% my $transKey = '';
% if ($transparent) {
% $transKey = 'transparent';
% }
% my $sslKey = '';
% if ($https) {
% $sslKey = 'ssl-bump';
% }
http_port <% $port %> <% $transKey %> <% $sslKey %>
# END_TAG #
visible_hostname localhost
% if (@nameservers) {
% my $dns_nameservers;
% foreach my $srv (@nameservers) {
% $dns_nameservers .= "$srv ";
% }
dns_nameservers <% $dns_nameservers %>
% }
% if ($append_domain) {
append_domain .<% $append_domain %>
% }
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
# refresh patterns
# windows updates
refresh_pattern http://.*\.windowsupdate\.microsoft\.com/ 0 80% 20160 reload-into-ims
refresh_pattern http://.*\.update\.microsoft\.com/ 0 80% 20160 reload-into-ims
refresh_pattern http://download\.microsoft\.com/ 0 80% 20160 reload-into-ims
refresh_pattern http://windowsupdate\.microsoft\.com/ 0 80% 20160 reload-into-ims
refresh_pattern http://.*\.download\.windowsupdate\.com/ 0 80% 20160 reload-into-ims
refresh_pattern http://office\.microsoft\.com/ 0 80% 20160 reload-into-ims
refresh_pattern http://w?xpsp[0-9]\.microsoft\.com/ 0 80% 20160 reload-into-ims
refresh_pattern http://w2ksp[0-9]\.microsoft\.com/ 0 80% 20160 reload-into-ims
# linux updates
refresh_pattern http://.*\.archive\.ubuntu\.com/ 0 80% 20160 reload-into-ims
refresh_pattern http://(ftp|http)[0-9]*\.[a-z]+\.debian\.org/ 0 80% 20160 reload-into-ims
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
# end refresh patterns
coredump_dir /var/spool/squid3
cache_effective_user proxy
cache_effective_group proxy
cache_mem <% $memory %> MB
maximum_object_size <% $max_object_size %> MB
access_log /var/log/squid3/access.log squid
pid_filename /var/run/squid3.pid
cache_dir ufs /var/spool/squid3 <% $cacheDirSize %> 16 256
% if ($cache_host and $cache_port) {
% my $peerAuth = '';
% if ($cache_user and $cache_passwd) {
# WARN: remember that for squid auth % are HTML escapes
% $peerAuth = 'login=' . $cache_user . ':' . $cache_passwd;
% }
cache_peer <% $cache_host %> parent <% $cache_port %> 0 no-query no-digest <% $peerAuth %>
% }
# <EBOX> TAG_ACL #
% if ($realm) {
auth_param basic realm Zentyal HTTP proxy
auth_param negotiate program /usr/lib/squid3/squid_kerb_auth -s <% $principal %>@<% $realm %>
auth_param negotiate children 10
auth_param negotiate keep_alive on
acl authorized proxy_auth REQUIRED
% }
% if ($urlRewriteProgram) {
url_rewrite_program <% $urlRewriteProgram %>
% }
% unless ($filter) {
<& .rulesACLs, rules => [ @rules ] &>
% }
<& .rulesACLs, rules => [ @objectsDelayPools ] &>
# no cache domains acl
% foreach my $domain (@notCachedDomains) {
acl noCached dstdomain <% $domain %>
% }
# END_TAG #
acl localhost src 127.0.0.0/8
acl localhostdst dst 127.0.0.0/8
acl manager proto cache_object
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 # https, snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
follow_x_forwarded_for allow localhost
log_uses_indirect_client off
http_access allow localhost
http_access deny manager
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_reply_access allow all
% if ($cache_host and $cache_port) {
never_direct allow all
% }
% if ($https) {
# ssl-bump options
always_direct allow SSL_ports
ssl_bump allow SSL_ports
% }
# <EBOX> TAG_DELAYPOOLS #
% if (@localnets) {
acl localnets_zentyal dst <% join ' ', @localnets %>
% }
<& .delayPools, objectsDelayPools => \@objectsDelayPools &>
# END_TAG
# <EBOX> TAG_HTTP_ACCESS #
% if (@notCachedDomains) {
cache deny noCached
% }
% if ($filter) {
# All allowed here as dansguardian takes care of the access rules
http_access allow all
% } else {
<& .rulesAccess, rules => \@rules &>
# default policy section
# All denied by default if no other allow rule matchs
http_access deny all
% }
# END_TAG #
# <EBOX> TAG SNMP #
% if ( $snmpEnabled ) {
<& .snmp &>
% }
# END_TAG #
always_direct allow localhostdst
<%def .rulesACLs>
<%args>
@rules
</%args>
% foreach my $rule (@rules) {
% next if $rule->{any};
% my $object = $rule->{object};
% my $group = $rule->{group};
% my $src = $object ? $object : $group;
% my $aclName = _aclName($src);
% if ($object) {
acl <% $aclName %> src <% join ' ', @{ $rule->{addresses} } %>
% } else {
% # escape user names
% my @users = map { $_ =~ s{ }{\\ }g; $_ } @{$rule->{users}};
acl <% $aclName %> proxy_auth <% join (' ', @users) %>
% }
<& .timeACLs, rule => $rule, id => $src &>
% }
</%def>
<%def .timeACLs>
<%args>
$rule
$id
</%args>
% if ($rule->{timeDays}) {
acl <% _aclName('timeDays_' . $id) %> time <% $rule->{timeDays} %>
% }
% if ($rule->{timeHours}) {
acl <% _aclName('timeHours_' . $id) %> time <% $rule->{timeHours} %>
% }
</%def>
<%def .rulesAccess>
<%args>
@rules
</%args>
% foreach my $rule (@rules) {
% my $object = $rule->{'object'};
% my $group = $rule->{'group'};
% my $groupAcl = $group ? _aclName($group) : '';
% my $objectAcl = $rule->{'any'} ? 'all' : ($object ? _aclName($object) : '');
% my $acl = $groupAcl ? $groupAcl : $objectAcl;
% my $timeAcls = _timeAclsInPolicy($rule, $object, $group);
% my $policy = $rule->{'policy'};
% next unless (($policy eq 'allow') or ($policy eq 'deny'));
% if ($group) {
http_access allow authorized
% }
http_access <% $policy %> <% $timeAcls %> <% $acl %>
% }
</%def>
<%def .delayPools>
<%args>
@objectsDelayPools
</%args>
% if ( @objectsDelayPools ) {
% my $pools = @objectsDelayPools;
delay_pools <% $pools + 1%>
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1
delay_access 1 allow localnets_zentyal
% }
<%perl>
my $id = 1;
foreach my $objPool (@objectsDelayPools) {
$id++;
my $rate = $objPool->{rate};
if ($rate > 0) {
$rate *= 1024;
}
my $size = $objPool->{size};
if ($size > 0) {
$size *= 1024 * 1024;
}
</%perl>
delay_class <% $id %> <% $objPool->{class} %>
% if ( $objPool->{class} eq '1' ) {
delay_parameters <% $id %> <% $rate %>/<% $size %>
% } elsif ( $objPool->{class} eq '2' ) {
<%perl>
my $clt_rate = $objPool->{clt_rate};
if ($clt_rate > 0) {
$clt_rate *= 1024;
}
my $clt_size = $objPool->{clt_size};
if ($clt_size > 0) {
$clt_size *= 1024 * 1024;
}
</%perl>
delay_parameters <% $id %> <% $rate %>/<% $size %> <% $clt_rate %>/<% $clt_size %>
% }
delay_initial_bucket_level 90
delay_access <% $id %> allow <% $objPool->{object} %>
delay_access <% $id %> deny all
% }
</%def>
<%def .snmp>
<%doc>
Define the SNMP configuration as SNMP agent
</%doc>
acl snmppublic snmp_community public
snmp_port 3401
snmp_access allow snmppublic localhost
snmp_access deny all
</%def>
|