All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christopher J. PeBenito" <cpebenito@tresys.com>
To: Hasan Rezaul-CHR010 <CHR010@motorola.com>
Cc: Stephen Smalley <sds@epoch.ncsc.mil>, SELinux <selinux@tycho.nsa.gov>
Subject: Re: Format of  file_contexts file
Date: Mon, 01 Nov 2010 12:02:19 -0400	[thread overview]
Message-ID: <4CCEE48B.2080306@tresys.com> (raw)
In-Reply-To: <D06FE0A2807BC145B0D38744789D4F5D09C2E5F8@de01exm68.ds.mot.com>

On 11/01/10 01:27, Hasan Rezaul-CHR010 wrote:
> Hi All,
> 
> My Linux system has a few product-specific directories like  /data,
> /inactive,  /repl
> 
> The default selinux policy would obviously not know how to label these
> directories the way I want, because these are not standard linux
> directories. If I want to label these directories a certain way... For
> example, suppose I want to label all the above directories as var_t,
> can I simply add a few lines to the below two files, and then perform
> relabel ? 
> 
> /etc/selinux/strict/contexts/files/file_contexts
> /etc/selinux/strict/modules/active/file_contexts
> 
> - Is it okay to directly edit those files, or are the above two files
> auto-generated ?
> - If editing the files is okay, then is it okay to stick lines in
> anywhere, or must I follow some kind of convention ?
> - or is there a more recommended way to control how those
> product-specific directories get labeled ?
> 
> - I have actually stuck some lines manually in the middle of the above
> two files, and for the most part it seems to work. But every once in a
> while, I see other directories not getting labeled correctly. Is it
> because the contents of these files have to be in a certain order ? 

These files are generated from the file contexts in the modules and the
local file contexts.  You should add your file contexts to a custom
policy module or use 'semanage fcontext' to add file contexts to the
local configuration.  Then when these files are regenerated, your file
contexts will be included.

-- 
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.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.

      reply	other threads:[~2010-11-01 16:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-12 20:55 [PATCH] Define CAP_SYSLOG Serge E. Hallyn
2010-03-12 20:55 ` Serge E. Hallyn
2010-03-12 20:58 ` [refpolicy] [PATCH refpolicy] add capability2:syslog perm Serge E. Hallyn
2010-03-14  5:18 ` [PATCH] Define CAP_SYSLOG Michael Kerrisk
2010-03-14  5:35   ` Serge E. Hallyn
2010-03-14  5:35     ` Serge E. Hallyn
2010-03-15  1:16     ` Matthew Helsley
2010-03-15  4:24       ` Serge E. Hallyn
2010-03-15  4:24         ` Serge E. Hallyn
2010-10-31 22:36     ` Console Login and SSH Login Security Contexts Hasan Rezaul-CHR010
2010-11-01 15:59       ` Christopher J. PeBenito
2010-11-01 21:11         ` Hasan Rezaul-CHR010
2010-11-02  7:48           ` HarryCiao
2010-11-02 13:36           ` Christopher J. PeBenito
2010-11-02 18:12             ` Hasan Rezaul-CHR010
2010-11-01  5:27     ` Format of file_contexts file Hasan Rezaul-CHR010
2010-11-01 16:02       ` Christopher J. PeBenito [this message]

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=4CCEE48B.2080306@tresys.com \
    --to=cpebenito@tresys.com \
    --cc=CHR010@motorola.com \
    --cc=sds@epoch.ncsc.mil \
    --cc=selinux@tycho.nsa.gov \
    /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.