Bug 447734 - Openvpn logging prevented by selinux
Summary: Openvpn logging prevented by selinux
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: openvpn
Version: 8
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Steven Pritchard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-21 13:52 UTC by bob mckay
Modified: 2009-08-07 04:58 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-01-09 06:31:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
openvpn server configuration file (names changed to protect the guilty) (10.02 KB, text/plain)
2008-05-21 23:19 UTC, bob mckay
no flags Details

Description bob mckay 2008-05-21 13:52:40 UTC
Description of problem:
openvpn installed by the default installation writes logs to /etc/openvpn, which
has context openvpn_etc_t. However if run as a service, openvpn runs in source
context openvpn_t. Thus it can't write to the logs (it seems to be able to write
to them OK if run directly from root). Presumably, the selinux policy needs a
minor mod to allow this? Or else, the default log location needs to be changed
(/var/logs seems a reasonable alternative?)


Version-Release number of selected component (if applicable):2.1 rc4
i386-redhat-linux-gnu


How reproducible: always


Steps to Reproduce:
1. Install openvpn
2. Set up config files etc in /etc/openvpn (as specified in openvpn installation
doco)
3. Start openvpn as a service
  
Actual results:
Selinux error messages and a failure to write logs

Expected results:
Logs written correctly

Additional info:

Comment 1 Steven Pritchard 2008-05-21 18:43:22 UTC
There is no default configuration for openvpn when it is installed from the
Fedora packages.  It shouldn't try to write anywhere except where you tell it to.

I have a bug open (bug #196564) to remind myself to review the example config
files to make sure they'll play nice.  Did you just use one of the sample config
files verbatim?

Comment 2 Steven Pritchard 2008-05-21 18:47:38 UTC
BTW, *my* instructions for setting up openvpn are at
http://fedoraproject.org/wiki/openvpn (which I should probably include in a
README.Fedora in the package).  They reference roadwarrior-*.conf in the sample
config files, which I personally included in the package (based on the OpenVPN
2.0 docs).  Those two files should be totally safe to use as references.

Comment 3 bob mckay 2008-05-21 23:19:27 UTC
Created attachment 306327 [details]
openvpn server configuration file (names changed to protect the guilty)

server.conf file giving rise to logging/selinux conflict

Comment 4 bob mckay 2008-05-21 23:25:41 UTC
(In reply to comment #1)
Firstly, thanks for setting up the package, it greatly simplifies setting up
openvpn!

> There is no default configuration for openvpn when it is installed from the
> Fedora packages.  It shouldn't try to write anywhere except where you tell it to.

Well, all the docs for openvpn (including yours) say to put the config files in
/etc/openserver. If you don't change anything from the sample server config
file, that's where it will write the logs. I assumed that was also where I
should direct the ipp file; I'll change that back now (but it would be good if
the doco made it clear that this should not be changed, as many of the examples
floating around the web point the ipp file to /etc/openvpn/ipp.txt). 
> 
> I have a bug open (bug #196564) to remind myself to review the example config
> files to make sure they'll play nice.  Did you just use one of the sample config
> files verbatim?

I used the sample server file, but adapted it to my requirements (previously
attached). However I didn't make any changes to the logging. 




Comment 5 bob mckay 2008-05-21 23:29:54 UTC
(In reply to comment #2)
> BTW, *my* instructions for setting up openvpn are at
> http://fedoraproject.org/wiki/openvpn (which I should probably include in a
> README.Fedora in the package).  They reference roadwarrior-*.conf in the sample
> config files, which I personally included in the package (based on the OpenVPN
> 2.0 docs).  Those two files should be totally safe to use as references.

Yep, including those details in the README would be _very_ useful. It's  not
obvious that the roadwarrior sample conf files are the preferred ones for
fedora, nor where the documentation for fedora is.



Comment 6 bob mckay 2008-05-21 23:31:28 UTC
(In reply to comment #4)
> 
> I used the sample server file, but adapted it to my requirements (previously
> attached). However I didn't make any changes to the logging. 
> 
Ooops, I lied: I changed the loglevel from 3 to 4, because I was anticipating
there might be some problems in initial operation.



Comment 7 Bug Zapper 2008-11-26 10:44:36 UTC
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  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 '8'.

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 8'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 8 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: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Bug Zapper 2009-01-09 06:31:56 UTC
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 9 dajoker 2009-08-07 04:58:11 UTC
Yes, this bug still exists.  I have duplicated it with Fedora 9 with the config pretty much out of the box.  From /var/log/messages:



Aug  6 22:46:08 mybox0 setroubleshoot: SELinux is preventing openvpn (openvpn_t) "write" to ./openvpn-status.log (openvpn_etc_t). For complete SELinux messages. run sealert -l f78a66d6-6e00-4fd6-9d5c-fb0c44443c6d
Aug  6 22:46:08 mybox0 setroubleshoot: SELinux is preventing openvpn (openvpn_t) "write" to ./ipp.txt (openvpn_etc_t). For complete SELinux messages. run sealert -l 29e407d2-13c3-4ba5-be53-45da7ee00d99



Once that is done I get another SELinux error trying to bind 21194 for listening (this is not a default port) as shown below:



Aug  6 22:47:30 mybox0 setroubleshoot: SELinux is preventing openvpn (openvpn_t) "write" to ./ipp.txt (openvpn_etc_t). For complete SELinux messages. run sealert -l 29e407d2-13c3-4ba5-be53-45da7ee00d99
Aug  6 22:47:30 mybox0 openvpn[29552]: Diffie-Hellman initialized with 4096 bit key
Aug  6 22:47:30 mybox0 openvpn[29552]: TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Aug  6 22:47:30 mybox0 setroubleshoot: SELinux is preventing the openvpn (openvpn_t) from binding to port 21194. For complete SELinux messages. run sealert -l e51fbc1b-35c5-496c-889d-af16e80709e7



It really would be nice if this were tried before being closed again as the error persists.  I have not tried subsequent versions of Fedora though I may one of these days.


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