All of lore.kernel.org
 help / color / mirror / Atom feed
* questions about persistent storage of security contexts
@ 2008-07-21 23:10 Andrew Warner
  2008-07-22  0:35 ` Eric Paris
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Warner @ 2008-07-21 23:10 UTC (permalink / raw)
  To: selinux

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

Hello,

I am currently developing an "SELinux aware" DBMS (primarily TE and MLS) 
that is characterized by:

1. The need to store a security context (in some recoverable form) in 
our persistent database (storage size of the context is an important factor)
2. The need to frequently perform a high number of security access 
checks in a performance sensitive way

My question relates to the first characteristic from above. I am having 
trouble deciding on the best way to store the security context in the 
database. From my research I  see (I think!) three different 
representations for a security context: 1) string; 2) raw; 3) SID. 

The string representation, generally, seems clear as this is what is 
shown in all documentation as the context representation that exists in 
user space. My only question regarding the string representation is: is 
there is any hard limit to the length of the security context string? Do 
I need to allow for no theoretical size limit on a context string if I 
choose to store it?

I am inferring the the raw representation exists from seeing *_raw 
functions (e.g., security_compute_create_raw) referenced in selinux 
header files. Other than seeing these functions declared I am having 
trouble finding out much about a raw representation. Is there any 
advantage to storing/manipulating a context in its raw representation? 
That is, are they more suited for a fast security access check, are they 
smaller in size, or do they have a fixed or maximum length?

The SID I have also seen mentioned in various documentations but can 
determine little about them. My guess is that they are an integer value 
that is used for fast internal access, particularly for the AVC. Are 
SIDs indeed integer values? Are they persistent or are they meaningful 
only for a particular OS session?

I have also considered maintaining my own internal, persistent mapping 
between string based contexts and an integer representation, the mapping 
being stored/indexed inside the DBMS. This gives me a small storage 
overhead with a fixed size.

Any answers, pointers to documentation, or other help would be greatly 
appreciated!

Andy Warner


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

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

end of thread, other threads:[~2008-07-22 15:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-21 23:10 questions about persistent storage of security contexts Andrew Warner
2008-07-22  0:35 ` Eric Paris
2008-07-22  1:40   ` KaiGai Kohei
2008-07-22 10:39     ` Andrew Warner
2008-07-22 11:13       ` KaiGai Kohei
2008-07-22 11:34         ` Andy Warner
2008-07-22  2:01   ` Stephen Smalley
2008-07-22 11:58     ` Andy Warner
2008-07-22 12:32       ` Stephen Smalley
2008-07-22 14:30         ` Andy Warner
2008-07-22 15:08           ` 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.