This file is indexed.

/usr/share/zentyal/stubs/squid/squid.conf.mas is in zentyal-squid 2.3.3.

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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
<%doc>
    Main configuration file for Squid daemon

  Parameters:

    snmpEnabled - Boolean indicating if SNMP is enabled or not
</%doc>
<%args>
    $port
    $transparent
    $authNeeded
    $allowAll
    @localnets
    @objectsPolicies
    @objectsDelayPools
    @groupsPolicies
    @notCachedDomains
    @nameservers
    $append_domain
    $cache_host
    $cache_port

    $memory
    $max_object_size

    $cacheDirSize
    $dn
    $ldapport
    $snmpEnabled => 0

    $urlRewriteProgram => undef
</%args>
<%perl>
our $maxAclNameLength = 31;
our %longAclNames = ();


sub _timeAclsInPolicy
{
   my ($policy, @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 eq 'yes') {
%   $transKey = 'transparent';
% }
http_port <% $port %> <% $transKey %>
# 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) {
cache_peer <% $cache_host %> parent <% $cache_port %> 0 no-query no-digest
% }


# <EBOX> TAG_ACL #
auth_param basic realm Zentyal HTTP proxy
auth_param basic program /usr/lib/squid3/squid_ldap_auth -v 3 -b  ou=Users,<% $dn %>  -u uid  -h ldap://127.0.0.1:<% $ldapport %>
acl authorized  proxy_auth required


% if ($urlRewriteProgram) {
url_rewrite_program <% $urlRewriteProgram %>
% }

<& .groupsACLs,
    groupsPolicies => \@groupsPolicies,
    objectsPolicies => \@objectsPolicies,
 &>

<& .objectsACLs, objectsPolicies => \@objectsPolicies &>

<& .objectsACLs, objectsPolicies => \@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
% }


# <EBOX> TAG_DELAYPOOLS #

% if (@localnets) {
<& .localnetsACLs,
                  localnets => \@localnets,
&>
% }
<& .delayPools,
                  objectsDelayPools => \@objectsDelayPools,
&>

# END_TAG

# <EBOX> TAG_HTTP_ACCESS #


% if (@notCachedDomains) {
cache deny noCached
% }


<& .objectsAccess,
                  objectsPolicies => \@objectsPolicies,
&>

<& .globalGroupsAccess,
                groupsPolicies => \@groupsPolicies,
&>



# default policy section


% if ( $authNeeded ) {
%#     if (not @groupsPolicies ) {
%#      we force auth here to not force to authorize objects
%#      which dont need auth
http_access allow authorized all
%#     }
% }
% if ($allowAll) {
http_access allow all
% } else {
http_access deny all
% }


# END_TAG #

# <EBOX> TAG SNMP #
% if ( $snmpEnabled ) {
<& .snmp &>
% }

# END_TAG #

always_direct allow localhostdst

<%def .globalGroupsAccess>
<%args>
@groupsPolicies
</%args>
% return if (@groupsPolicies == 0);
%# if we use global group policies we must force always the authorization first
http_access allow authorized all
% foreach my $groupPol (@groupsPolicies) {
%   my $group = $groupPol->{'group'};
%   my $groupAcl = _aclName($group);
%   my $timeAcls = _timeAclsInPolicy($groupPol, $group);
%   my $allowPolicy = $groupPol->{'allow'};
%   if ($allowPolicy) {
http_access allow  <% $timeAcls %> <% $groupAcl %>
%    }

%   if ((not $allowPolicy) or $timeAcls ) {
#   in case of allow + time acl we have to deny otherwise
#   outsde of the time period we will slip to defualt policy
http_access deny <% $groupAcl %> all
%   }
% }
</%def>

<%def .objectGroupsAccess>
<%args>
@groupsPolicies
$object
</%args>
% foreach my $groupPol (@groupsPolicies) {
%   my $group = $groupPol->{'group'};
%   my $groupAcl = _aclName($group);
%   my $objectAcl = _aclName($object);
%   my $timeAcls = _timeAclsInPolicy($groupPol, $object, $group);
%   my $allow = $groupPol->{'allow'};
%   if ($allow) {
http_access allow <% $timeAcls %> <% $groupAcl %> <% $objectAcl %>
%    }
%  if ((not $allow) or $timeAcls ) {
#   in case of allow + time acl we have to deny otherwise
#   outsde of the time period we will slip to defualt policy
http_access deny  <% $groupAcl %> <% $objectAcl %>
%   }
% }
</%def>


<%def .objectsAccess>
<%args>
@objectsPolicies
</%args>
% foreach my $objPol (@objectsPolicies) {

%   my $object = $objPol->{'object'};
%   my $objectAcl = _aclName($object);
  <& .objectGroupsAccess,
           groupsPolicies =>  $objPol->{groupsPolicies},
           object => $object,
   &>
%   if ($objPol->{'auth'}) {
  http_access allow  <% $objectAcl %>  authorized
%   }

% if ($objPol->{'allowAll'}) {
%   my $timeAcls = _timeAclsInPolicy($objPol, $object);
http_access allow <% $objectAcl %> <% $timeAcls %>
%     if ($timeAcls) {
%     # to assure we dont slip to default configuration when we have a time acl
http_access deny <% $objectAcl %>
%     }
% } else {
http_access deny <% $objectAcl %>
%   }
% }
</%def>


<%def .groupsACLs>
<%args>
@groupsPolicies
@objectsPolicies
</%args>
<%init>
# group ACLs from group polices
my %groups = map {
        ($_ ->{group} => , $_->{users})
} @groupsPolicies;
# add group acls from object policies
foreach my $obPol (@objectsPolicies) {
  foreach my $grPol (@{ $obPol->{groupsPolicies} } ) {
      $groups{ $grPol->{group} } =  $grPol->{users};
 }
}
# escape user names
foreach my $users_r (values %groups) {
       my @users = map {
           my $user = $_;
           $user =~ s{ }{\\ }g;
           $user
       } @{ $users_r  };
    $users_r =  \@users;
}
</%init>
% while (my ($group, $users) = each %groups)  {
%   my $groupAcl = _aclName($group);
acl <% $groupAcl %> proxy_auth <% join ' ', @{ $users } %>
% }
% foreach my $groupPol (@groupsPolicies) {
     <& .timeACLs, policy => $groupPol, ids => [$groupPol->{group}] &>
% }
</%def>


<%def .localnetsACLs>
<%args>
@localnets
</%args>
acl eboxlocalnets dst <% join ' ', @localnets %>
</%def>


<%def .objectsACLs>
<%args>
@objectsPolicies
</%args>
% foreach my $objPol (@objectsPolicies) {
%   my $object = $objPol->{object};
%   my $objectAcl = _aclName($object);
acl <% $objectAcl %> src <% join ' ', @{ $objPol->{addresses} } %>
<& .timeACLs, policy => $objPol, ids => [ $object ] &>
%   foreach my $groupPol (@{ $objPol->{groupsPolicies} }) {
     <& .timeACLs, policy => $groupPol, ids => [$object, $groupPol->{group}] &>
%  }
% }
</%def>


<%def .timeACLs>
<%args>
$policy
@ids
</%args>
<%init>
my $id = join '_', @ids;
</%init>
% if ($policy->{timeDays}) {
acl <% _aclName('timeDays_' . $id) %> time <% $policy->{timeDays} %>
% }
% if ($policy->{timeHours}) {
acl <% _aclName('timeHours_' . $id) %> time <% $policy->{timeHours} %>
% }
</%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 eboxlocalnets
% }
<%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;
     }
</%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;
     }
</%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>