All of lore.kernel.org
 help / color / mirror / Atom feed
From: domg472@gmail.com (Dominick Grift)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH] add policy for Icecream
Date: Mon, 02 Mar 2009 17:23:18 +0100	[thread overview]
Message-ID: <1236010998.19155.35.camel@notebook1.grift.internal> (raw)
In-Reply-To: <20090302163716.68641b3a@leela>

On Mon, 2009-03-02 at 16:37 +0100, Michal Schmidt wrote:
> Dne Mon, 02 Mar 2009 14:16:54 +0100
> Dominick Grift <domg472@gmail.com> napsal:
> 
> > Here is my take on the policy. It may or may not work but it may give
> > you some ideas on how to clean it up a bit.
> 
> Thank you for your suggestions! I'll redo the policy accordingly.
> There are some bits, however, where I'd like some clarification.
> It's these pieces of the diff between my and your version of
> the .te file:
> >  
> > -# the compiler node daemon
> >  type iceccd_t;
> >  type iceccd_exec_t;
> >  init_daemon_domain(iceccd_t, iceccd_exec_t)
> > @@ -20,141 +311,182 @@
> >  type iceccd_var_run_t;
> >  files_pid_file(iceccd_var_run_t)
> >  
> > -# the working area
> >  type iceccd_cache_t;
> >  files_type(iceccd_cache_t)
> >  
> > -# icecc-create-env script makes a tarball of the local compiler and
> > its -# dependencies for other nodes to use
> 
> You removed most of my comments which were meant to give the reader some idea
> why the policy says what it says. Does it mean comments like these are really
> not wanted?

Comments are fine. If they are not too obvious. I removed them because
that is my personal taste.

 
> >  type iceccd_createenv_t;
> >  type iceccd_createenv_exec_t;
> > -domain_type(iceccd_createenv_t)
> > -domain_entry_file(iceccd_createenv_t, iceccd_createenv_exec_t)
> > +application_executable_file(iceccd_createenv_exec_t)
> > +application_domain(iceccd_createenv_t, iceccd_createenv_exec_t)
> >  role system_r types iceccd_createenv_t;
> 
> The application_* interfaces mark programs which are expected to be run by
> users from interactive shells? OK, it makes sense for icecc-create-env.

If user have access to the executable type and have a transition set up.

> > -domain_type(iceccd_untrusted_t);
> > -domain_entry_file(iceccd_untrusted_t, iceccd_cache_t)
> > +application_executable_file(iceccd_cache_t);
> > +application_domain(iceccd_untrusted_t, iceccd_cache_t)
> 
> ... however, I do not think it's useful to mark the untrusted foreign compilers
> as such. These should never be run by users.

Alright you could also use domain_entry_type, but users wont be able to
use application executables if they cannot access then or if no
transition is set up.

> > +dontaudit iceccd_t iceccd_untrusted_t:process { siginh rlimitinh
> > +noatsecure };
> 
> In the original version, these three permissions were 'allow'. I don't know
> exactly what they mean, I got them by observing the AVC denials during normal
> operation of Icecream. If you think 'dontaudit' should be enough, I believe
> you. I'll test it.

Try it, These permissions usually get silently denied.

> > +# use interface: iceccd_untrusted_signal()
> > +allow iceccd_t iceccd_untrusted_t:process signal;
> 
> You suggest "use interface: ..." several times. To make it absolutely clear -
> are you asking me to create the named interfaces in icecream.if and use them in
> icecream.te?
> I thought interfaces were only useful for interaction with other policy
> modules. And at the moment I can't imagine any other users of these interfaces.

Interface make it easier for you to maintain policy, be it local to the
module or not. I suggested the use of interfaces but its a personal
taste.

> >  corenet_all_recvfrom_unlabeled(iceccd_t)
> >  corenet_all_recvfrom_netlabel(iceccd_t)
> >  corenet_tcp_sendrecv_generic_if(iceccd_t)
> > -corenet_udp_sendrecv_generic_if(iceccd_t)
> >  corenet_tcp_sendrecv_generic_node(iceccd_t)
> > -corenet_udp_sendrecv_generic_node(iceccd_t)
> >  corenet_tcp_sendrecv_all_ports(iceccd_t)
> > -corenet_udp_sendrecv_all_ports(iceccd_t)
> >  corenet_tcp_bind_generic_node(iceccd_t)
> >  corenet_tcp_bind_iceccd_port(iceccd_t)
> 
> iceccd sends UDP broadcasts to find the scheduler on the LAN. Won't removing
> these rules block it?

If you need them , add them.

> 
> Michal

  parent reply	other threads:[~2009-03-02 16:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02 12:04 [refpolicy] [PATCH] add policy for Icecream Michal Schmidt
2009-03-02 13:16 ` Dominick Grift
2009-03-02 15:37   ` Michal Schmidt
2009-03-02 15:57     ` Christopher J. PeBenito
2009-03-02 16:23     ` Dominick Grift [this message]
2009-03-02 16:35 ` Dominick Grift
2009-03-02 23:40   ` [refpolicy] [PATCH v1.0.2] " Michal Schmidt
2009-03-03  0:08     ` Dominick Grift
2009-03-03 15:22       ` [refpolicy] [PATCH v1.0.3] " Michal Schmidt

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=1236010998.19155.35.camel@notebook1.grift.internal \
    --to=domg472@gmail.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.