LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-27-2010, 10:30 AM   #1
DorsetBlue
LQ Newbie
 
Registered: Jan 2010
Posts: 15

Rep: Reputation: 1
SELinux / RH4 - making an amendment to a pre-compiled policy


We have a RH4 based system that has been delivered with a SELinux policy installed. On inspection of the install media, the SELinux policy has been installed from an RPM file and contains some Contexts files (in plain text format) and the policy in a pre-compiled binary format.
We have added sshd to this system but have found that the policy prevents access to the ssh port when SELinux is in Enforcing mode.
I have run audit2allow against the audit.log and have an exception which would seem to get round this but I cannot find any way to update the policy with the exception. We do not have the original source text that was used to create the compiled binary.
Most of the methods I have found seem to be based on RH5. Does anyone have any ideas?
 
Old 01-27-2010, 10:33 AM   #2
nileshgr
Member
 
Registered: Aug 2007
Location: Pune, Maharashtra, India
Distribution: Gentoo
Posts: 84

Rep: Reputation: 16
SELinux always creates problems. It is very complicated to understand. I prefer to keep it disabled and advice you the same.
 
0 members found this post helpful.
Old 01-27-2010, 10:43 AM   #3
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
nilesh,

you have managed to remove the OP's question from the zero-reply list, without giving a shred of help. He isn't asking for anyone's opinion or preferences about SELinux, and I bet he's aware that it's complicated, but by the sounds of things, he's got somewhat of a handle on the situation, and needs some help.

Do you have any constructive advice to offer, regarding the particular question he asked?

Sasha
 
1 members found this post helpful.
Old 01-27-2010, 10:49 AM   #4
DorsetBlue
LQ Newbie
 
Registered: Jan 2010
Posts: 15

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by nilesh.3892 View Post
SELinux always creates problems. It is very complicated to understand. I prefer to keep it disabled and advice you the same.
We do not have that option unfortunately.
 
Old 01-29-2010, 05:22 AM   #5
DorsetBlue
LQ Newbie
 
Registered: Jan 2010
Posts: 15

Original Poster
Rep: Reputation: 1
Just in case anyone is interested, it would seem the answer to my question is...you can't.

We have since been provided with the source used to produce the binary, so we are now using that to produce a customised policy for our implementation.
 
Old 05-31-2010, 06:26 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I think you may find the policies available in Source form
at
ftp.redhat.com
 
Old 05-31-2010, 10:53 PM   #7
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
By default red hat runs a monolithic policy. if you want to use audit2allow you must first compile a modular policy. Once you have a modular policy audit2allow can then create a module that can just be loaded on the fly (there are some security conserns with doing so) but that is what is required in order to do so.
 
Old 06-01-2010, 12:32 AM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
in rhel 4 ?
i am used to cent5 ( 5.3 to 5.5 )

audit2allow to right a policy "sholud " be the same in 4 as 5

can you install "SELinuxTroubleshooter" in rhel 4 ?
 
Old 06-01-2010, 10:48 AM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by John VV View Post
can you install "SELinuxTroubleshooter" in rhel 4 ?
You really don't need that as the "policycoreutils" package contains 'audit2allow' which you do need as slimm609 already said.


Quote:
Originally Posted by DorsetBlue View Post
I have run audit2allow against the audit.log and have an exception which would seem to get round this but I cannot find any way to update the policy with the exception.
The really, really bad way (wrt security concerns) would be to run 'audit2allow -M localpolicy < /var/log/audit/audit.log && semodule -i localpolicy'. Better isolate the messages you need to react to (ausearch using session or start and end time or other filters) and pipe those select messages through audit2allow.

* If you have the AVC lines post them here, preferably in BB code tags.
 
  


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
SELinux create policy with audit2allow tinymark Linux - Security 4 03-21-2009 04:17 PM
Advice on SElinux Policy Editors? mrbinky3000 Linux - Security 1 06-03-2007 02:46 PM
ncpfs selinux policy rhoekstra Linux - Security 2 10-17-2006 03:58 AM
selinux policy or attribute ?? dansawyer Linux - Security 3 09-12-2006 02:08 AM
selinux:policy.conf silvercloud Linux - Enterprise 0 08-23-2005 04:38 AM

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

All times are GMT -5. The time now is 07:46 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