LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-13-2008, 03:52 PM   #1
klnasveschuk
Member
 
Registered: Jun 2003
Location: Plymouth, Massachusetts
Distribution: CentOS, Slackware, Redhat, Ubuntu
Posts: 52

Rep: Reputation: 15
How do I confine a compiled pure-ftpd daemon with SELinux


I compiled the latest version of pure-ftpd with LDAP and SSL support. Works fine. I'd like to confine the process using SELinux but having a hard time. OS: Centos 5 updated to 5.2 I guess is the latest.

Pure-ftpd runs as root. I've found some rpms out there that have a pureftpd.pp policy file and installed the policy (semodule -i pureftpd.pp), but something is not running correctly. I don't get any error messages in audit.log and when I do a ps -ZC pure-ftpd it shows:
[root@ftp2 ~]# ps -ZC pure-ftpd
LABEL PID TTY TIME CMD
root:system_r:unconfined_t:SystemLow-SystemHigh 4122 ? 00:00:00 pure-ftpd

I don't think the policy file or the context that the process is running as is correct. I have used audit2allow to modify some local policies but this seems to not have the right context so I don't get error messages.

Any help would be appreciated.
 
Old 08-13-2008, 05:28 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Vary quickly - have you tested the setup with SELinux disabled?
 
Old 08-14-2008, 07:41 AM   #3
klnasveschuk
Member
 
Registered: Jun 2003
Location: Plymouth, Massachusetts
Distribution: CentOS, Slackware, Redhat, Ubuntu
Posts: 52

Original Poster
Rep: Reputation: 15
How do I confine a compiled pure-ftpd daemon with SELinux

Yes it work fine with SELinux disabled. It also works fine with SELinux enabled. I think the problems is the policy matches an rpm version (that's where I got the pureftpd.pp) and the version of pureftpd that I'm using is a compiled version -> 1.0.21.
Here's my configure options:

./configure '--prefix=/opt/pure-ftpd' '--with-pam' '--with-tls' '--with-certfile=/etc/pki/tls/private/pure-ftpd.pem' '--with-puredb' '--with-ldap' '--with-quotas' '--with-throttling' '--with-ratios'

Kent
 
Old 08-14-2008, 05:14 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
The pureftpd.pp (which RPM exactly?) is a "binary module" for SE Linux. It may or may not work. You could try building a policy yourself: install "selinux-policy-devel" and from that follow instructions running 'policygentool appname /path/to/binary'.
 
Old 08-15-2008, 12:45 PM   #5
klnasveschuk
Member
 
Registered: Jun 2003
Location: Plymouth, Massachusetts
Distribution: CentOS, Slackware, Redhat, Ubuntu
Posts: 52

Original Poster
Rep: Reputation: 15
I didn't realize there was an rpm out there, same version as the compiled version I'm using:
pure-ftpd-1.0.21-15.el5.i386.rpm
pure-ftpd-selinux-1.0.21-15.el5.i386.rpm

I dumped my compiled version, which is the same version as above.

Works with LDAP, SSL.

I still had to tweek the policies using audit2allow and setsebool (ftp_home_dir --> on) to get auto create home directory to work, but everything is working fine now.

[root@ftp2 ~]# ps -ZC pure-ftpd
LABEL PID TTY TIME CMD
root:system_r:ftpd_t 8632 ? 00:00:00 pure-ftpd
root:system_r:ftpd_t 8723 ? 00:00:00 pure-ftpd
root:system_r:ftpd_t 8724 ? 00:00:00 pure-ftpd


I did get the selinux-policy-devel package. I have some other servers with daemons that are not confined by SELinux. I will try to make policy packages with the development tools.

Thanks for your help.
 
  


Reply



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
pure-ftpd-mysql activates pure-ftpd zvikamer Linux - Software 2 03-01-2008 12:11 PM
pure-ftpd kristof_v Linux - Software 0 10-08-2006 06:41 AM
pure-ftpd help hongman Linux - Software 16 04-06-2005 11:18 AM
Pure FTPD help oACEo Linux - Newbie 2 12-07-2003 11:34 AM
Pure-ftpd help ksgill Linux - Newbie 15 04-18-2003 12:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:26 AM.

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