From: Paul Moore <paul@paul-moore.com>
To: vlad halilov <vlad.halilov@gmail.com>
Cc: SELinux@tycho.nsa.gov
Subject: Re: connection between different labels
Date: Fri, 17 May 2013 10:07:14 -0400 [thread overview]
Message-ID: <1542214.p1uj7fpFHc@sifl> (raw)
In-Reply-To: <CAHw9pMX-Ji6hds9_oP97NEMzsG5MM_=jwD-mA=eGVWG-Z5jVEA@mail.gmail.com>
On Friday, May 17, 2013 12:58:27 AM vlad halilov wrote:
> Hi again.
Hello again.
> Is selinux contain something functional like 'multilevel port'
> from solaris trusted extension? Concept of mlp is declaring number of
> programm to be 'label aware'. Program of this type, allowed to handling
> network request for specified service from all labels and handling/generate
> trafic for any labels in clearance. So, OS just delegate information
> control to this programm.
Yes, SELinux is capable of doing similar things. However, I will caution you
that SELinux does not support network port polyinstantiation in the same way
as TSOL or Solaris TX; we have some workarounds that sorta do similar things
but it isn't the same.
> As my mind, something like this is possible for selinux contexts (we can
> allow traffic between different domains by policy, and selinux context
> transfered by 'secret' local processing ;) but may be something like this
> implemented for information labels s0,s1 etc?
>
> For example:
>
> type=AVC msg=audit(1368735963.286:1998): avc: denied { recv } for
> pid=4773 comm="python-thinlinc" saddr=127.0.0.1 src=46092 daddr=127.0.0.1
> dest=9000 netif=lo scontext=system_u:system_r:initrc_t:s0-s15:c0.c1023
> tcontext=system_u:object_r:netlabel_peer_t:s4 tclass=peer
>
> My userspace program need to send status message to master process that
> executed with clearance s0-s15:c0.c1023 but denied with request. Hmmm..
> But clearance of master process is enough to work with this information?
> From some tests, i got result that 'real' leabel for master process is s0.
> And all processes executed with label range handling connection only with
> lowest label from range.
There are basically two parts to communicating over a network with a security
label above your effective security label and below your cleared security
label: initiating a new connection and sending data (e.g. creating a socket
with the appropriate label) and accepting a new connection and receiving data
(e.g. allowing a socket to receive data above it's effective security label
but still below it's cleared label).
The first part, creating a socket with a different security label, can be done
with the setsockcreatecon() function which is part of the libselinux API. If
successful, this function tells the kernel to label all future sockets with
the label provided by the function. This allows you to create sockets with a
"s1" security label when the process is running as "s0-s15", and traffic sent
from these "s1" labeled sockets will be labeled as "s1" and NOT as "s0". See
the manpage for more information.
The second part, accepting data between the effective and cleared security
label, is done via the MLS attributes in the SELinux policy. The
mlsnetreadtoclr, mlsnetwritetoclr, and mlsnetwriteranged are the attributes
you are likely the most relevant; the related SELinux policy interfaces can be
found in the kernel/mls.if interface file and are all named 'mls_socket_*'.
--
paul moore
www.paul-moore.com
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
prev parent reply other threads:[~2013-05-17 14:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-16 20:58 connection between different labels vlad halilov
2013-05-17 14:07 ` Paul Moore [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=1542214.p1uj7fpFHc@sifl \
--to=paul@paul-moore.com \
--cc=SELinux@tycho.nsa.gov \
--cc=vlad.halilov@gmail.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.