All of lore.kernel.org
 help / color / mirror / Atom feed
From: cpebenito@tresys.com (Christopher J. PeBenito)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH v3 1/3] Support read/append/manage functions for various httpd content
Date: Wed, 27 Jun 2012 10:31:37 -0400	[thread overview]
Message-ID: <4FEB1949.9030004@tresys.com> (raw)
In-Reply-To: <20120626203841.GA19892@siphos.be>

On 06/26/12 16:38, Sven Vermeulen wrote:
> On Tue, Jun 26, 2012 at 10:04:13AM -0400, Christopher J. PeBenito wrote:
>>>>> +interface(`apache_append_all_ra_content_files',`
>>>>
>>>> Inconsistent interface naming.  I'm ok w/o the _files.
>>>>
> [...]
>> Look closely at the naming of all the additions.  Thats what I meant by inconsistency.  They should have the same pattern.
> 
> Ok, it was indeed not consistent. 
> 
> May I take this opportunity to get some quick feedback on the interface
> naming? From the naming convention [1] URL, it sais that the predicate (end
> of the interface name) can be ommitted when it is clear what object is being
> referenced.
> 
> [1] http://oss.tresys.com/projects/refpolicy/wiki/InterfaceNaming
> 
> Most actions against file object classes are possible for many of them
> (file, symlink, socket, fifo, block, ...). Would it be a good interpretation
> if "apache_append_all_ra_content" matches append rights for the entire
> class family, whereas "apache_append_all_ra_content_files" is only for the file
> class?

I would say apache_append_all_ra_content() works on all typical classes for the content, i.e. dir, file, lnk_file.  If you change it to apache_append_all_ra_content_files(), then you have ra access on files and search (or maybe list) on the dirs.

> And if it does, is it OK to keep the implementation of said interface as
> strict as possible (for as long as it is strictly needed) and enlarge (and
> update other policies) when necessary?

If you make the interface more strict, like apache_append_all_ra_content_files(), the implementation should be strict, so there can be tight least-privilege.  But if you use a more abstract apache_append_all_ra_content(), then we can be a little looser on the least-privilege. 

> I don't believe it would be a good idea to immediately "fill up" the
> interface, like so:
> 
> +interface(`apache_read_all_ra_content',`
> +	gen_require(`
> +		attribute httpd_ra_content;
> +	')
> +
> +	read_files_pattern($1, httpd_ra_content, httpd_ra_content)
> +	read_lnk_files_pattern($1, httpd_ra_content, httpd_ra_content)
> +	read_fifo_files_pattern($1, httpd_ra_content, httpd_ra_content)
> +	read_sock_files_pattern($1, httpd_ra_content, httpd_ra_content)
> +	read_blk_files_pattern($1, httpd_ra_content, httpd_ra_content)
> +	read_chr_files_pattern($1, httpd_ra_content, httpd_ra_content)
> +	list_dirs_pattern($1, httpd_ra_content, httpd_ra_content)
> +')
> 
> but then policy editors must be aware that an interface might, in the
> future, expand to become more course-grained (within the limits of the
> interface).

This goes back to knowing something about typical web content.  Definitely not for device nodes.  Probably not for fifo_file and sock_file, but we could be more flexible in adding it if it became necessary.

-- 
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com

  parent reply	other threads:[~2012-06-27 14:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-24 11:07 [refpolicy] [PATCH v3 0/3] Support read/append/manage functions for various httpd content Sven Vermeulen
2012-06-24 11:08 ` [refpolicy] [PATCH v3 1/3] " Sven Vermeulen
2012-06-26 13:22   ` Christopher J. PeBenito
2012-06-26 13:57     ` Dominick Grift
2012-06-26 14:04       ` Christopher J. PeBenito
2012-06-26 20:38         ` Sven Vermeulen
2012-06-26 21:10           ` Dominick Grift
2012-06-27 14:17             ` Christopher J. PeBenito
2012-06-27 14:31           ` Christopher J. PeBenito [this message]
2012-06-24 11:08 ` [refpolicy] [PATCH v3 2/3] Introducing phpfpm_t domain Sven Vermeulen
2012-06-26 13:29   ` Christopher J. PeBenito
2012-06-24 11:09 ` [refpolicy] [PATCH v3 3/3] Allow sysadm_t to administer phpfpm environment Sven Vermeulen

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=4FEB1949.9030004@tresys.com \
    --to=cpebenito@tresys.com \
    --cc=refpolicy@oss.tresys.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.