LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-26-2018, 04:45 AM   #1
vishwa0220
LQ Newbie
 
Registered: May 2018
Posts: 2

Rep: Reputation: Disabled
SELinux Source compilation and integration with centos7.4


Hi All,

I am looking for SELinux source code which could be used to port on CentOS 7.4 and can be use for writing our own SELinux module for our application. I have tried various reference policies but nothing helped me for example: gentoo, tresys reference policy etc.

Can anybody please help me. Any help would be really very helpful for me.

BR, Vishwa
 
Old 05-26-2018, 10:03 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

The CentOS source code is in "Vault"
http://vault.centos.org/7.5.1804/

The latest SELinux is in updates:
selinux-policy-3.13.1-192.el7_5.3.src.rpm
http://vault.centos.org/7.5.1804/upd...rce/SPackages/

You can read about the latest additions in the file selinux-policy.spec, from line 658.

-

Last edited by knudfl; 05-26-2018 at 10:10 AM.
 
Old 05-26-2018, 12:34 PM   #3
kfritz
Member
 
Registered: Aug 2006
Distribution: Slackware, OpenBSD, CentOS, Ubuntu
Posts: 99

Rep: Reputation: 31
I don't think reading the source is going to help you. Start by reading the CentOS wiki on the subject.
https://wiki.centos.org/HowTos/SELinux

I rely heavily on the audit2allow tool. You're going to need to understand the basics -- don't expect that modifying some other sample is going to get you very far.
 
Old 06-03-2018, 11:39 AM   #4
vishwa0220
LQ Newbie
 
Registered: May 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi,

Thanks for your reply.

I have compiled and successfully installed the policy. Now I am able to up my system in permissive mode but in enforcing mode my system get blocked on device manager and not booting up.

Though I have started writing policy module in permissive mode with the same version of development package as source. but while inserting module it is giving error when my policy is selected as refpolicy in config file.

when I switched to targeted the policy module insertion is successful.

error using refpolicy is:

[root@localhost myapp]# make
Compiling refpolicy myapp module
/usr/bin/checkmodule: loading policy configuration from tmp/myapp.tmp
/usr/bin/checkmodule: policy configuration loaded
/usr/bin/checkmodule: writing binary representation (version 19) to tmp/myapp.mod
Creating refpolicy myapp.pp policy package
rm tmp/myapp.mod.fc tmp/myapp.mod

[root@localhost myapp]# semodule -i myapp.pp
Failed to resolve typeattributeset statement at /etc/selinux/refpolicy/tmp/modules/400/myapp/cil:23
semodule: Failed!

Please help.

Regards,
Vishwa
 
  


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
Any problem if I install CENTOS7 Workstation over CENTOS7 Server? Rich Strebendt Linux - Software 5 05-03-2018 11:05 PM
Unable to set SELinux context in CentOS7 fanoflq Linux - Newbie 5 12-21-2016 03:41 PM
CentOS7 / Apache / custom DocumentRoot / SELinux issue AdultFoundry Linux - Server 1 01-08-2016 09:05 AM
LXer: Open source data integration with Karma LXer Syndicated Linux News 0 05-25-2015 12:51 PM
Openoffice Langpack integration with source sailajabhandaru Linux - Software 0 11-08-2005 11:19 PM

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

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