From: Dominick Grift <dominick.grift@defensec.nl>
To: Ian Pilcher <arequipeno@gmail.com>
Cc: SElinux list <selinux@vger.kernel.org>
Subject: Re: How to write a policy for a "service wrapper"?
Date: Mon, 11 Nov 2024 19:33:05 +0100 [thread overview]
Message-ID: <87ldxp8vtq.fsf@defensec.nl> (raw)
In-Reply-To: <435b1b8a-a6b6-4180-a038-520d226b88ef@gmail.com> (Ian Pilcher's message of "Mon, 11 Nov 2024 10:14:02 -0600")
Ian Pilcher <arequipeno@gmail.com> writes:
> I have a service (stunnel) that runs in a confined domain (stunnel_t).
>
> Due to changes in Fedora's systemwide cryptographic policy, I need to
> run this service under the "legacy" cryptographic policy, using the
> 'runcp' wrapper[1].
>
> So my idea is to create new domain for the wrapper (runcp_t or similar),
> give that domain the permissions required to perform its functions, and
> then use a type transition rule to run the actual service in its normal
> domain.
>
> It's simple enough to write a type transition rule for a specific
> service, e.g.:
>
> type_transition runcp_t stunnel_exec_t:process stunnel_t;
>
> However, it would obviously be nice to allow the wrapper to be used
> without the need for service-specific rules.
>
> Any service that normally runs in a confined domain presumably already
> provides a type transition rule for the init system, e.g.:
>
> type_transition init_t stunnel_exec_t:process stunnel_t;
>
> Is there some way that I can make the wrapper take advantage of these
> rules, possibly by transitioning back to init_t?
You can label the runcp command with a private executable file type and
then allow systemd to execute it without a transition effectively
running runcp in init_t just like systemd. Then when runcp executes
stunnel it should transparently transition from init_t to stunnel_t as
if runcp was not there.
>
> [1]
> https://gitlab.com/redhat-crypto/crypto-policies-extras/-/blob/main/runcp.c
--
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
next prev parent reply other threads:[~2024-11-11 18:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-11 16:14 How to write a policy for a "service wrapper"? Ian Pilcher
2024-11-11 18:33 ` Dominick Grift [this message]
2024-11-11 18:37 ` 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=87ldxp8vtq.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.