All of lore.kernel.org
 help / color / mirror / Atom feed
* Add a new class
@ 2004-10-04 22:11 Trent Jaeger
  2004-10-05  0:17 ` Luke Kenneth Casson Leighton
  2004-10-05  0:40 ` Joshua Brindle
  0 siblings, 2 replies; 8+ messages in thread
From: Trent Jaeger @ 2004-10-04 22:11 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

Hi,

I think this is something I could find in the docs or code, but I don't 
see it. 

How do I add a new class?  There are a variety of files in 
security/selinux/include, such as av_permissions.h, that are 
"automatically generated", but they are already in the distribution, so it 
is not clear how they are generated.  If I add a class, operations, etc., 
these files have to be modified and I would rather do it the proper way.

BTW -- this is for adding IPSec security associations for classes, so we 
can label network connections.  Prototype code should be available soon.

Regards,
Trent.
------------------------------------------------------------
Trent Jaeger
IBM T.J. Watson Research Center
19 Skyline Drive, Hawthorne, NY 10532
(914) 784-7225, FAX (914) 784-7225

[-- Attachment #2: Type: text/html, Size: 1129 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Add a new class
@ 2005-01-02  7:17 Park Lee
  2005-01-03 14:01 ` Stephen Smalley
  0 siblings, 1 reply; 8+ messages in thread
From: Park Lee @ 2005-01-02  7:17 UTC (permalink / raw)
  To: sds; +Cc: jbrindle, jaegert, lkcl, SELinux

On 2004-10-05 at 12:32, Stephen Smalley wrote:
> On Mon, 2004-10-04 at 20:40, Joshua Brindle wrote:
> >
> > 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/
> >
> > 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.
>
> 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 majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Add a new class
@ 2005-01-12 19:40 Park Lee
  2005-01-12 21:34 ` Stephen Smalley
  0 siblings, 1 reply; 8+ messages in thread
From: Park Lee @ 2005-01-12 19:40 UTC (permalink / raw)
  To: Stephen Smalley; +Cc: SELinux

On 2004-10-05 at 12:32, Stephen Smalley wrote:
> On Mon, 2004-10-04 at 20:40, Joshua Brindle wrote:
> > 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/
> > 
> > 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.
> 
> I don't think it is necessary to boot the new 
> kernel before building the updated policy, as you 
> can always load a policy with additional classes
> and permissions even if the existing kernel doesn't 
> use them; you only have a problem if you try to 
> change or remove an existing class or permission 
> (and the kernel will refuse to load such a policy 
> anyway). In fact, it is likely not safe to boot the 
> new kernel without first building and installing 
> the new policy, because the new kernel may try
> to use the new classes and permissions before they 
> are defined in the policy (which would result in 
> denials).

Now, I'm using FC2. I try to add a new class ( also
just for learing ).
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. and then rebooted on
the new kernel.
After I rebooted on the new kernel, I went into
/etc/security/selinux/src/policy, and ran 'make load'.
But this time, the security_load_policy failed!
The following is what appeared on my screen:

[root@lenovo policy]# make load
mkdir -p tmp
 [... snipped ...] 
mkdir -p /etc/security/selinux
/usr/bin/checkpolicy -o
/etc/security/selinux/policy.17 policy.conf
/usr/bin/checkpolicy:  loading policy configuration
from policy.conf
security:  5 users, 7 roles, 1244 types, 1 bools
security:  31 classes, 303377 rules
 [... snipped ...]
/usr/bin/checkpolicy:  writing binary representation
(version 15) to /etc/security/selinux/policy.15
warning: discarding booleans and conditional rules
/usr/bin/checkpolicy -c 16 -o
/etc/security/selinux/policy.16 policy.conf
/usr/bin/checkpolicy:  loading policy configuration
from policy.conf
security:  5 users, 7 roles, 1244 types, 1 bools
security:  31 classes, 303377 rules
/usr/bin/checkpolicy:  policy configuration loaded
/usr/bin/checkpolicy:  writing binary representation
(version 16) to /etc/security/selinux/policy.16
/usr/sbin/load_policy
/etc/security/selinux/policy.`cat /selinux/policyvers`
/usr/sbin/load_policy:  security_load_policy failed
make: *** [tmp/load] Error 3


Then, Is there something wrong? Would you please tell
me what's the matter with 'make load'?

Thank you. 




=====
Best Regards,
Park Lee

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-01-12 21:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-04 22:11 Add a new class Trent Jaeger
2004-10-05  0:17 ` Luke Kenneth Casson Leighton
2004-10-05  0:40 ` Joshua Brindle
2004-10-05 12:32   ` Stephen Smalley
  -- strict thread matches above, loose matches on Subject: below --
2005-01-02  7:17 Park Lee
2005-01-03 14:01 ` Stephen Smalley
2005-01-12 19:40 Park Lee
2005-01-12 21:34 ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.