All of lore.kernel.org
 help / color / mirror / Atom feed
* Type attributes
@ 2003-11-26 13:43 Carlos Anísio Monteiro
  2003-11-26 14:30 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos Anísio Monteiro @ 2003-11-26 13:43 UTC (permalink / raw)
  To: selinux

Hi.

The type attributes are used only as identifier to SELinux or to 
administrator of the SELinux. As the type attributes is optional not 
have needed of declare them. Then, can I pass over ? or I am not 
undertanding them right.

Thanks.

-- 
Carlos Anisio Monteiro  <monteiro@ipen.br>
IPEN/CNEN-SP
Sao Paulo - Brasil



--
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] 3+ messages in thread

* Re: Type attributes
  2003-11-26 13:43 Type attributes Carlos Anísio Monteiro
@ 2003-11-26 14:30 ` Stephen Smalley
  2003-11-27  2:07   ` Russell Coker
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2003-11-26 14:30 UTC (permalink / raw)
  To: Carlos Anísio Monteiro; +Cc: selinux

On Wed, 2003-11-26 at 08:43, Carlos Anísio Monteiro wrote:
> The type attributes are used only as identifier to SELinux or to 
> administrator of the SELinux. As the type attributes is optional not 
> have needed of declare them. Then, can I pass over ? or I am not 
> undertanding them right.

I'm not sure I understand your question.  A type attribute in a policy
rule is expanded to the set of types that have that attribute.  Are you
asking:
1) Whether a type attribute name needs to be declared before using it in
a type declaration?
Answer:  Yes.  At one time, type attribute names were implicitly
declared upon their first use in a type declaration, but explicit
declarations were added and required to allow the compiler to catch
mistakes.  Type attribute names are typically declared in attrib.te.
2) Whether a type declaration must have type attributes associated with
it?
Answer:  No.  However, if you define a new type and it does fit into one
of the existing attribute definitions (see the comments in attrib.te),
then you should associate that attribute with it unless you have a
specific reason not to do so.  For example, if you define a new type for
a process, and you fail to associate the 'domain' attribute with it,
then many existing allow rules that use 'domain' will not be applied to
it, which could be a problem for normal system operation (e.g. init
needs to be able to reap it, administrators should be able to kill it,
etc).  Also, you may end up violation an assertion if you fail to use
the attribute, as assertions are often based on attributes.

-- 
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency


--
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] 3+ messages in thread

* Re: Type attributes
  2003-11-26 14:30 ` Stephen Smalley
@ 2003-11-27  2:07   ` Russell Coker
  0 siblings, 0 replies; 3+ messages in thread
From: Russell Coker @ 2003-11-27  2:07 UTC (permalink / raw)
  To: Carlos Anísio Monteiro; +Cc: selinux

On Thu, 27 Nov 2003 01:30, Stephen Smalley <sds@epoch.ncsc.mil> wrote:
> Answer:  Yes.  At one time, type attribute names were implicitly
> declared upon their first use in a type declaration, but explicit
> declarations were added and required to allow the compiler to catch
> mistakes.  Type attribute names are typically declared in attrib.te.

Currently the published policy only has them declared in attrib.te.  I 
strongly recommend that this practise be continued.

As Stephen explains below a defined attribute does not have to be used.  One 
thing he did not mention is that a defined attribute which is not used has no 
affect on the policy binary (try adding some attributes that are not assigned 
to any types and you will notice that the md5sum of the compiled policy does 
not change).

So there is no cost to defining extra attributes.

> etc).  Also, you may end up violation an assertion if you fail to use
> the attribute, as assertions are often based on attributes.

Recently I have been adding new assertions to more strictly check these 
things.  So a policy which creates a process type without the "domain" 
attribute will not compile.  These assertions unfortunately significantly 
increase the time taken to compile the policy, however there are only a small 
number of people who do thousands of compiles of policy, but a large number 
of people who might be expected to make such mistakes so the net result is 
positive.

Also I found a few policy mistakes that I had made when I added these 
rules.  ;)

-- 
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
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] 3+ messages in thread

end of thread, other threads:[~2003-11-27  2:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-26 13:43 Type attributes Carlos Anísio Monteiro
2003-11-26 14:30 ` Stephen Smalley
2003-11-27  2:07   ` Russell Coker

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.