LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-13-2010, 08:57 PM   #1
Palula
Member
 
Registered: May 2005
Location: Brazil
Distribution: Fedore Core 3
Posts: 138

Rep: Reputation: 15
Squid: rep_mime_type or req_mime_type


I would like to block some files accessed by the staff in my company and verified that this can be accomplished using mimetypes. So I read on the web that this could do the trick:

1 - Basically create the acl:
Code:
acl mimeblock rep_mime_type -i "\absolute_path\filename"
2 - Create a file in "\absolute_path\filename" that corresponds with all the mimetypes IŽd like to block. In example:

Code:
^application/x-pn-mpg$
^application/vnd.ms-powerpoint$
^application/asx$
^application/x-mplayer2$
^application/vnd.ms-asf$
^application/x-msn-messenger$
^application/ymsgr$

^image/mpg$

^video/x-ms-wmv$
^video/mpeg$
^video/mpg$
^video/x-mpg$
^video/mpeg2$
^video/x-mpeg$
^video/x-mpeg2a$
^video/x-ms-asf$
^video/x-ms-asf-plugin$
^video/x-ms-wm$
^video/x-ms-wmx$
^video/x-pn-realvideo$
^video/quicktime$
^video/x-msvideo$
^video/mp4v-es$

^audio/basic$
^audio/x-wav$
^audio/x-mpegurl$
^audio/mpeg$
^audio/x-mpeg$
^audio/mp3$
^audio/x-mp3$
^audio/mpeg3$
^audio/x-mpeg3$
^audio/mpg$
^audio/x-mpg$
^audio/x-mpegaudio$
^audio/x-ms-wma$
^audio/asf$
^audio/vnd.rn-realaudio$
^audio/x-pn-realaudio$
^audio/x-realaudio$
^audio/x-pm-realaudio-plugin$
^audio/x-pn-realvideo$
^audio/x-aiff$
^audio/mp4$
3 - Define the order to put the subsequent line within squid.conf to "execute" the acl:

Code:
http_reply_access deny mimeblock
--------------------------------

3 questions:

1 - Can anybody tell the difference between these squid directives: rep_mime_type & req_mime_type?

2 - Why do all mimetypes start with "^"; and end with "$"?

3 - Is the configuration above making sense to you?

Thank you very much!!!
 
Old 05-14-2010, 06:57 PM   #2
thecarpy
Member
 
Registered: Apr 2005
Location: France
Distribution: Devuan, Suse, Slackware
Posts: 130

Rep: Reputation: 21
1. From what I can see, it should be req_mime_type as well. Makes sense, req being, request and rep_mime_type is for post, methinks. So they cannot download nor upload the specified mime-types. You only block uploads here ... is that what you want?

2. Look up regular expressions ... in regular expressions, ^ means "stating with" and $ means "ending with". A bit like GLOB *blabla and blabla*. You know GLOB, maybe not from the name, when you open a command prompt on Windows, that is what you use ... you know, the ? and * business ... ;-) Oh, and do not look-up regular expressions on Microsoft sites, they tried to implement it in powershell and failed miserably ... LOL.

3. I would not know if this configuration makes sense ... sorry. But I would not like to work at your company ;-).
But it should be

http_reply_access deny mimeblockp
And if you want to stop them from downloading:
acl mimeblock req_mime_type -i "/absolute_path/filename"
http_access deny mimeblockq

About squid, check this out:
http://www.visolve.com/squid/squid24...s_controls.php

And in Linux, you use / and not \ as a path separator ... ;-)

PS: Sorry for the many updates, it's late, I'm tired.... need a beer!

Last edited by thecarpy; 05-14-2010 at 07:23 PM.
 
  


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
Squid Redirect specific domain to an Secondary (External) Squid Proxy Zxarr Linux - Server 2 04-20-2010 12:50 PM
My squid server is running slow i have 40 fedora 11 in my squid proxy ashraflinux1@gmail.com Linux - Server 4 09-15-2009 12:17 AM
squid conf: squid failed when I type insert redirect_program /usr/bin/squidguard laxmantsharma Linux - Software 1 02-24-2009 06:02 AM
Squid 2.6 Reverse Proxy from Squid(3128) to OrginServer(80) Not working rraj Linux - Server 0 06-06-2008 02:29 PM
squid conf: squid failed when I type insert redirect_program /usr/bin/squidguard Niceman2005 Linux - Software 1 11-24-2004 02:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:30 PM.

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