From: sven.vermeulen@siphos.be (Sven Vermeulen)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH v3 1/3] Support read/append/manage functions for various httpd content
Date: Tue, 26 Jun 2012 22:38:41 +0200 [thread overview]
Message-ID: <20120626203841.GA19892@siphos.be> (raw)
In-Reply-To: <4FE9C15D.6050405@tresys.com>
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?
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?
For instance (since I know the above paragraph isn't clear): take a look at
"apache_read_all_ra_content", which was suggested with the following:
+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)
+')
Although it can be split easily in "apache_read_all_ra_content_files" and
"apache_read_all_ra_content_symlinks", the notion of having a
"apache_read_all_ra_content" which does it just for files and symlinks might
in the future be 'enlarged' to support say fifo files.
In that case, the policy change might 'update' "apache_read_all_ra_content"
to add in read_fifo_files_pattern to it. Any policy that uses this interface
thus gets more privileges, but *knows* this as it used the more
course-grained interface, rather than coding the _files and _symlinks
interfaces in it.
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).
And while I'm on it, what is the difference between a spec_domtrans and a
regular one? Is that only that the transition doesn't occur automatically
(i.e. the application has to be SELinux-aware to use it)?
Wkr,
Sven Vermeulen
next prev parent reply other threads:[~2012-06-26 20:38 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 [this message]
2012-06-26 21:10 ` Dominick Grift
2012-06-27 14:17 ` Christopher J. PeBenito
2012-06-27 14:31 ` Christopher J. PeBenito
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=20120626203841.GA19892@siphos.be \
--to=sven.vermeulen@siphos.be \
--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.