Bug 496179 - Privoxy connecting to arbitrary ports
Privoxy connecting to arbitrary ports
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-04-16 22:43 EDT by Sven
Modified: 2009-11-18 08:00 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-11-18 08:00:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Sven 2009-04-16 22:43:32 EDT
Would it be possible to add a boolean for privoxy to allow it to connect to any port, rather than having to manually allow individual ports whenever the occasion arises with semanage? Squid has the boolean squid_connect_any, I'm wondering if a privoxy_connect_any or the like would be feasible.
Comment 1 Daniel Walsh 2009-04-17 08:45:26 EDT
Its feasable but the question is it really necessary?  How often do administrators setup privoxy to connect to random ports?  Squid had the boolean added back in RHEL4, when there was no easy way to add ports to a domain.
Comment 2 Sven 2009-04-26 16:49:58 EDT
Well, not all websites are on port 80. It's about the remote end of outgoing connections, not listening on random ports.
Comment 3 Daniel Walsh 2009-04-27 08:56:31 EDT
So your users can connect on random ports like 90 and privoxy will notice this and cache the data?  Or does the administrator got to go on to the privoxy server and configure it to connect to port 90?

If you just need this configured, you could add port 90 to the http_cache_port_t

# semanage port -a -t http_cache_port_t -p tcp 90
Comment 4 Sven 2009-04-28 07:03:00 EDT
The server listens on port 8118, and that's configured in the browser (or in this case Squid, as privoxy doesn't cache) but for example if someone asks the proxy for http://example.com:82/ they'll still be sending the request to port 8118, but privoxy will be trying to connect to port 82 at the remote end.

If it were just one specific extra port for a specific web application it'd be fine to configure a port with semanage, but I saw about half a dozen ports blocked within a day of setting up the new selinux-enabled server. Adding them manually each time a new one pops up would be tedious.
Comment 5 Daniel Walsh 2009-04-28 11:46:52 EDT
Miroslav add the following to F10 privoxy.te, I will add them to F11 and RHEL5

## <desc>
## <p>
## Allow privoxy to connect to all ports, not just
## HTTP, FTP, and Gopher ports.
## </p>
## </desc>
gen_tunable(privoxy_connect_any, false)

Comment 6 Miroslav Grepl 2009-05-07 08:53:01 EDT
Fixed in selinux-policy-3.5.13-59.fc10
Comment 7 Need Real Name 2009-06-03 20:26:48 EDT
I verified that this works on my up to date F10 install with selinux-policy-3.5.13-61.fc10.noarch

However, I would suggest that the default for this boolean should be true. It is very counter-intuitive that a browser running on the host can reach remote URLs that will be blocked if the same browser uses the localhost privoxy install instead of directly connecting to the remote URL (in order to filter advertisements, web bugs, etc.)
Comment 8 Sven 2009-08-17 05:45:41 EDT
Works for me, thanks.

Although setroubleshoot/sealert doesn't currently suggest it as a solution, like it does for other booleans I've seen.
Comment 9 Daniel Walsh 2009-08-18 08:25:39 EDT
Sven could you attach the AVC that you got or the setroubleshoot.  I would like to look at why it did not suggest the correct boolean.
Comment 10 Sven 2009-08-18 08:38:26 EDT
It currently suggests "If you want to allow privoxy to connect to this port semanage port -a -t PORT_TYPE -p PROTOCOL 81 Where PORT_TYPE is a type that privoxy_t can connect."

type=AVC msg=audit(1250501868.898:58133): avc:  denied  { name_connect } for  pid=12839 comm="privoxy" dest=81 scontext=unconfined_u:system_r:privoxy_t:s0 tcontext=system_u:object_r:reserved_port_t:s0 tclass=tcp_socket

type=SYSCALL msg=audit(1250501868.898:58133): arch=c000003e syscall=42 success=no exit=-115 a0=6 a1=7f5c33f2bc10 a2=10 a3=7f5c33f2bc0c items=0 ppid=1 pid=12839 auid=501 uid=73 gid=73 euid=73 suid=73 fsuid=73 egid=73 sgid=73 fsgid=73 tty=(none) ses=6336 comm="privoxy" exe="/usr/sbin/privoxy" subj=unconfined_u:system_r:privoxy_t:s0 key=(null)
Comment 11 Daniel Walsh 2009-08-18 09:25:52 EDT
Well I guess that is a better match from a security point of view.  But could be a pain in the butt for an admin that wants to allow all.
Comment 12 Bug Zapper 2009-11-18 07:49:54 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 13 Daniel Walsh 2009-11-18 08:00:48 EST
Closing as current release

Note You need to log in before you can comment on or make changes to this bug.