selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Ian Pilcher <arequipeno@gmail.com>, selinux@vger.kernel.org
Subject: Re: runcon in enforcing mode
Date: Wed, 30 Jan 2019 16:38:21 -0500	[thread overview]
Message-ID: <9034023e-74af-8d08-edbf-8cd48b433075@tycho.nsa.gov> (raw)
In-Reply-To: <cc6dec3a-74e0-cf79-c46a-9377b83ccceb@gmail.com>

On 1/30/19 4:21 PM, Ian Pilcher wrote:
> Does $SUBJECT ever work?
> 
> I am trying to figure out why a script is failing when run by
> certmonger (system_u:system_r:certmonger_t:s0), but attempting to run
> any executable is giving me a denial.
> 
> $ sudo runcon system_u:system_r:certmonger_t:s0 /bin/true
> runcon: ‘/bin/true’: Permission denied
> 
> type=AVC msg=audit(1548883146.502:300): avc:  denied  { entrypoint } for 
>   pid=12697 comm="runcon" path="/usr/bin/true" dev="dm-3" ino=2190 
> scontext=system_u:system_r:certmonger_t:s0 
> tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=0
> 
> Am I doing something wrong?

A key aspect of type enforcement is ensuring that a given domain can 
only be entered via an approved executable and can only execute 
authorized code.  Hence, the entrypoint check.  This means that if you 
want to experiment with running some other program in a domain, you must 
do one of the following:

1) Label the file in question with the authorized type, e.g.
cp /bin/true .
chcon -t certmonger_exec_t true
runcon system_u:system_r:certmonger_t:s0 ./true

2) Create and insert a local policy module allowing entrypoint to the 
type of the file,

-or-

3) Make the domain permissive or set the global enforcing mode to 
permissive.

You may also encounter other denials related to the transition since 
normally certmonger wouldn't be started this way.


      reply	other threads:[~2019-01-30 21:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 21:21 runcon in enforcing mode Ian Pilcher
2019-01-30 21:38 ` Stephen Smalley [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=9034023e-74af-8d08-edbf-8cd48b433075@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=arequipeno@gmail.com \
    --cc=selinux@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).