All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: "David P. Quigley" <dpquigl@tycho.nsa.gov>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>,
	SELinux <selinux@tycho.nsa.gov>
Subject: Re: [PATCH 1/1] selinux: add support for installing a dummy policy
Date: Tue, 26 Aug 2008 11:04:50 -0400	[thread overview]
Message-ID: <48B41B92.50608@redhat.com> (raw)
In-Reply-To: <1219676185.2627.1.camel@moss-terrapins.epoch.ncsc.mil>

David P. Quigley wrote:
> On Fri, 2008-08-22 at 14:34 -0500, Serge E. Hallyn wrote:
>> In August 2006 I posted a patch to the selinux list generating a minimal
>> SELinux policy.  This week, David P. Quigley posted an updated version
>> of that as a patch against the kernel.  In addition to some fixes, also
>> had nice logic for auto-installing the policy.
>>
>> I've gone ahead and hooked it into the kernel Makefile logic.  The way I
>> have it here, doing 'make scripts' ends up compiling 'mdp', after which
>> you must
>> 	cd scripts/selinux
>> 	sh install_policy.sh
>>
>> That isn't as nice as being able to do
>> 	make selinux_install
>> the way David had it, but it avoids mucking with the top-level
>> Makefile.  Which is preferred?
>>
>> In any case, this seems like a good thing to have in the kernel
>> tree, to facilitate simple selinux boot tests.
>>
>> Following is David's original patch intro (preserved especially
>> bc it has stats on the generated policies):
>>
>> ======================================================================
>> For those interested in the changes there were only two significant
>> changes. The first is that the iteration through the list of classes
>> used NULL as a sentinel value. The problem with this is that the
>> class_to_string array actually has NULL entries in its table as place
>> holders for the user space object classes.
>>
>> The second change was that it would seem at some point the initial sids
>> table was NULL terminated. This is no longer the case so that iteration
>> has to be done on array length instead of looking for NULL.
>>
>> Some statistics on the policy that it generates:
>>
>> The policy consists of 523 lines which contain no blank lines. Of those
>> 523 lines 453 of them are class, permission, and initial sid
>> definitions. These lines are usually little to no concern to the policy
>> developer since they will not be adding object classes or permissions.
>> Of the remaining 70 lines there is one type, one role, and one user
>> statement. The remaining lines are broken into three portions. The first
>> group are TE allow rules which make up 29 of the remaining lines, the
>> second is assignment of labels to the initial sids which consist of 27
>> lines, and file system labeling statements which are the remaining 11.
>>
>> In addition to the policy.conf generated there is a single file_contexts
>> file containing two lines which labels the entire system with base_t.
>>
>> This policy generates a policy.23 binary that is 7920 bytes.
>> ======================================================================
>> (then a few versions later...):
>> ======================================================================
>> The new policy is 587 lines (stripped of blank lines) with 476 of those
>> lines being the boilerplate that I mentioned last time. The remaining
>> 111 lines have the 3 lines for type, user, and role, 70 lines for the
>> allow rules (one for each object class including user space object
>> classes), 27 lines to assign types to the initial sids, and 11 lines for
>> file system labeling. The policy binary is 9194 bytes.
>> ======================================================================
>>
>> Signed-off-by: Serge Hallyn <serue@us.ibm.com>
> 
> [Snip...]
> 
> I'm not sure if I have to sign off on this but just in case.
> 
> Signed-off-by: David Quigley <dpquigl@tycho.nsa.gov>
> 
> Dave
> 
> 
> --
> 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.
How easy would it be to go from this dummy policy to a policy that
confined only one application?  IE If I wanted to pull in the bind
policy, what would be needed.

This is a question that often comes up.  I don't want anything confined
except this one app?

I would figure syslog would be a problem right off, others?

--
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.

WARNING: multiple messages have this Message-ID (diff)
From: Daniel J Walsh <dwalsh@redhat.com>
To: "David P. Quigley" <dpquigl@tycho.nsa.gov>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>,
	SELinux <selinux@tycho.nsa.gov>
Subject: Re: [PATCH 1/1] selinux: add support for installing a dummy policy
Date: Tue, 26 Aug 2008 11:04:50 -0400	[thread overview]
Message-ID: <48B41B92.50608@redhat.com> (raw)
In-Reply-To: <1219676185.2627.1.camel@moss-terrapins.epoch.ncsc.mil>

David P. Quigley wrote:
> On Fri, 2008-08-22 at 14:34 -0500, Serge E. Hallyn wrote:
>> In August 2006 I posted a patch to the selinux list generating a minimal
>> SELinux policy.  This week, David P. Quigley posted an updated version
>> of that as a patch against the kernel.  In addition to some fixes, also
>> had nice logic for auto-installing the policy.
>>
>> I've gone ahead and hooked it into the kernel Makefile logic.  The way I
>> have it here, doing 'make scripts' ends up compiling 'mdp', after which
>> you must
>> 	cd scripts/selinux
>> 	sh install_policy.sh
>>
>> That isn't as nice as being able to do
>> 	make selinux_install
>> the way David had it, but it avoids mucking with the top-level
>> Makefile.  Which is preferred?
>>
>> In any case, this seems like a good thing to have in the kernel
>> tree, to facilitate simple selinux boot tests.
>>
>> Following is David's original patch intro (preserved especially
>> bc it has stats on the generated policies):
>>
>> ======================================================================
>> For those interested in the changes there were only two significant
>> changes. The first is that the iteration through the list of classes
>> used NULL as a sentinel value. The problem with this is that the
>> class_to_string array actually has NULL entries in its table as place
>> holders for the user space object classes.
>>
>> The second change was that it would seem at some point the initial sids
>> table was NULL terminated. This is no longer the case so that iteration
>> has to be done on array length instead of looking for NULL.
>>
>> Some statistics on the policy that it generates:
>>
>> The policy consists of 523 lines which contain no blank lines. Of those
>> 523 lines 453 of them are class, permission, and initial sid
>> definitions. These lines are usually little to no concern to the policy
>> developer since they will not be adding object classes or permissions.
>> Of the remaining 70 lines there is one type, one role, and one user
>> statement. The remaining lines are broken into three portions. The first
>> group are TE allow rules which make up 29 of the remaining lines, the
>> second is assignment of labels to the initial sids which consist of 27
>> lines, and file system labeling statements which are the remaining 11.
>>
>> In addition to the policy.conf generated there is a single file_contexts
>> file containing two lines which labels the entire system with base_t.
>>
>> This policy generates a policy.23 binary that is 7920 bytes.
>> ======================================================================
>> (then a few versions later...):
>> ======================================================================
>> The new policy is 587 lines (stripped of blank lines) with 476 of those
>> lines being the boilerplate that I mentioned last time. The remaining
>> 111 lines have the 3 lines for type, user, and role, 70 lines for the
>> allow rules (one for each object class including user space object
>> classes), 27 lines to assign types to the initial sids, and 11 lines for
>> file system labeling. The policy binary is 9194 bytes.
>> ======================================================================
>>
>> Signed-off-by: Serge Hallyn <serue@us.ibm.com>
> 
> [Snip...]
> 
> I'm not sure if I have to sign off on this but just in case.
> 
> Signed-off-by: David Quigley <dpquigl@tycho.nsa.gov>
> 
> Dave
> 
> 
> --
> 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.
How easy would it be to go from this dummy policy to a policy that
confined only one application?  IE If I wanted to pull in the bind
policy, what would be needed.

This is a question that often comes up.  I don't want anything confined
except this one app?

I would figure syslog would be a problem right off, others?

  reply	other threads:[~2008-08-26 15:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22 19:34 [PATCH 1/1] selinux: add support for installing a dummy policy Serge E. Hallyn
2008-08-22 19:34 ` Serge E. Hallyn
2008-08-22 22:56 ` James Morris
2008-08-22 22:56   ` James Morris
2008-08-23  2:38   ` Serge E. Hallyn
2008-08-23  2:38     ` Serge E. Hallyn
2008-08-25  9:12     ` James Morris
2008-08-25  9:12       ` James Morris
2008-08-25 12:16       ` Stephen Smalley
2008-08-25 12:16         ` Stephen Smalley
2008-08-25 12:10     ` Stephen Smalley
2008-08-25 12:10       ` Stephen Smalley
2008-08-26 19:16       ` Serge E. Hallyn
2008-08-26 19:16         ` Serge E. Hallyn
2008-08-25 14:56 ` David P. Quigley
2008-08-25 14:56   ` David P. Quigley
2008-08-26 15:04   ` Daniel J Walsh [this message]
2008-08-26 15:04     ` Daniel J Walsh
2008-08-26 15:54     ` David P. Quigley
2008-08-26 15:54       ` David P. Quigley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B41B92.50608@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=dpquigl@tycho.nsa.gov \
    --cc=linux-kernel@vger.kernel.org \
    --cc=selinux@tycho.nsa.gov \
    --cc=serue@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.