Skip to contentSkip to conversation

Add a new class

DISCUSSION Park Lee 2 participants 2 messages Jan 2, 2005 – Jan 3, 2005 SELinux security module

lore
Share & tools
lore

Park Lee

author
#0 lore raw
Quoted 15 lines · Stephen Smalley
Quoted 9 lines · Joshua Brindle

Check the files in policy/flask

specifically you must add the class to security_classes and the permissions to access_vectors and then rebuild the headers with the Makefile in the flask directory and put them in linux/security/selinux/include/

Quoted 4 lines

then reboot on the new kernel and build a policy with the new classes and access vectors, it should be fairly straightforward and no problems should occur.

Quoted 8 lines

Note that if you are acting on a policy directory in a selinux-usr tree and have a linux-2.6 tree at the same level as your selinux-usr tree, then you can also do 'make all tokern tolib' in policy/flask to build and push the regenerated headers to the linux-2.6 tree and libselinux tree. You can also override LIBSEL and LINUXDIR definitions if they have different locations.

Now, I'm using FC2.
I've added a new class to security_classes and the permissions to access_vectors (In /etc/security/selinux/src/policy/flask), after that, rebuilt the headers with the Makefile in the flask directory and put them in /usr/src/linux-2.6.5-1.358/security/selinux/include as Joshua Brindle have mentioned.

What confused me here is that: MUST we also copy the headers to libselinux/include/selinux directory, and regenerate a new libselinux.so for the new class and its permissions? can we ignore this step?

And, Is there still any other matter that we should pay attention to, when we add a new class?

Thank you very much.

=====
Best Regards,
Park Lee

__________________________________
Do you Yahoo!?
Send a seasonal email greeting and help others. Do good.
http://celebrity.mail.yahoo.com

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 1 line · Park Lee

Now, I'm using FC2.

FC3 is strongly recommended over FC2 for SELinux users.

Quoted 7 lines

I've added a new class to security_classes and the permissions to access_vectors (In /etc/security/selinux/src/policy/flask), after that, rebuilt the headers with the Makefile in the flask directory and put them in /usr/src/linux-2.6.5-1.358/security/selinux/include as Joshua Brindle have mentioned.

When adding new classes, you should typically work off of our sourceforge CVS tree, as that will have the latest definitions. Or at the very least, you should work off of the latest kernel, i.e. 2.6.10 + 2.6.10-mm1 from kernel.org. Note that until you submit a patch reserving your classes to us and until we accept such a patch into our tree, the class value may be re-used at any time for some other purpose, forcing you to re-base, much like adding a new syscall to the kernel. We have already reserved a new class and permissions for Trent Jaeger's IPSEC work, as you can see in our sourceforge CVS tree.

Quoted 4 lines

What confused me here is that: MUST we also copy the headers to libselinux/include/selinux directory, and regenerate a new libselinux.so for the new class and its permissions? can we ignore this step?

It isn't required unless some application needs to reference the new class, but we do update them when we merge new classes into our tree to keep them in sync. In the long term, it is expected that there will be a separate mechanism for userspace object managers to dynamically register security classes and permissions for their own use, e.g. see the SELinux Policy Server project by Tresys.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.