All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominick Grift <dominick.grift@defensec.nl>
To: Ian Pilcher <arequipeno@gmail.com>
Cc: SElinux list <selinux@vger.kernel.org>
Subject: Re: Allow rule not having any effect?!
Date: Mon, 11 Nov 2024 19:27:36 +0100	[thread overview]
Message-ID: <87pln18w2v.fsf@defensec.nl> (raw)
In-Reply-To: <3df128ad-cd76-4fea-a905-60d7f02ca4ee@gmail.com> (Ian Pilcher's message of "Mon, 11 Nov 2024 11:30:08 -0600")

Ian Pilcher <arequipeno@gmail.com> writes:

> I'm either missing something incredibly obvious, or something really,
> really weird is going on.
>
> I have a policy module that includes this rule.
>
>   allow runcp_t etc_t:file { create write setattr };
>
> And I can see that the rule is loaded.
>
>   $ sesearch --allow -s runcp_t -t etc_t -c file -ds -dt
>   allow runcp_t etc_t:file { create setattr write };
>
> Nonetheless, I am still getting this denial.
>
>   type=AVC msg=audit(1731345803.780:3765): avc:  denied  { create } for
>   pid=289668 comm="cp" name="config"
>   scontext=system_u:system_r:runcp_t:s0
>   tcontext=unconfined_u:object_r:etc_t:s0 tclass=file permissive=0

I suspect cp is called with -a when copying that "config" file.
It tries to create the file with an identity other than its own
(unconfined_u versus system_u) and object identity changes are
constrained by identity-based access control.

echo '(typeattributeset can_change_object_identity runcp_t)' >
mytest.cil && sudo semodule -i mytest.cil

The above should lift the object identity change constrain.

>
> AFAICT, this makes no sense at all.
>
> Any ideas?

-- 
gpg --locate-keys dominick.grift@defensec.nl (wkd)
Key fingerprint = FCD2 3660 5D6B 9D27 7FC6  E0FF DA7E 521F 10F6 4098
Dominick Grift
Mastodon: @kcinimod@defensec.nl

  reply	other threads:[~2024-11-11 18:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11 17:30 Allow rule not having any effect?! Ian Pilcher
2024-11-11 18:27 ` Dominick Grift [this message]
2024-11-11 18:27 ` SOLVED: " Ian Pilcher

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=87pln18w2v.fsf@defensec.nl \
    --to=dominick.grift@defensec.nl \
    --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 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.