All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <pmoore@redhat.com>
To: Andy Ruch <adruch2002@yahoo.com>
Cc: "selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>
Subject: Re: selinux control for network interface using SOCK_RAW
Date: Wed, 18 Dec 2013 16:14:47 -0500	[thread overview]
Message-ID: <1762865.mJVkh9reke@sifl> (raw)
In-Reply-To: <1387399050.90718.YahooMailNeo@web163405.mail.gq1.yahoo.com>

On Wednesday, December 18, 2013 12:37:30 PM Andy Ruch wrote:
> > On Wednesday, December 18, 2013 1:21 PM, Paul Moore <pmoore@redhat.com> 
wrote:
> > > On Wednesday, December 18, 2013 07:49:19 AM Andy Ruch wrote:
> >>  Hello,
> >>  
> >>  I'm trying to restrict an application to only have access to some
> >>  network interfaces. I'm running a custom policy on a RHEL 6.3 system.
> >>  The application is opening the socket as AF_PACKET and SOCK_RAW.
> >>  However, selinux doesn't seem to be controlling any raw access to the
> >>  interfaces.
> > 
> > SELinux does not provide any per-packet access controls for AF_PACKET
> > sockets.  The basic problem is that AF_PACKET traffic is an opaque blob
> > as far as the kernel is concerned.  The application may carefully craft
> > well formed IP packets, but the kernel doesn't do any inspection/parsing
> > of the data sent down via a AF_PACKET socket, it is just a blob to passed
> > off to the network device.
> > 
> > I suppose we could do something with the netif:egress access control for
> > packet sockets, but that would require a new LSM hook and some SELinux
> > glue as AF_PACKET traffic isn't subject to the netfilter hooks SELinux
> > currently uses (if I recall correctly).
> 
> I'm not looking for any per-packet control. I was just hoping to restrict my
> application's use of the packet socket to a single interface, i.e. prevent
> access an out-of-band management network. The netif ingress/egress
> permissions are what I would have expected but I say that without knowing
> anything about how those are implemented.

Unfortunately, it is per-packet access control and currently we only provide 
per-packet access control for IP based sockets.

-- 
paul moore
security and virtualization @ redhat

  reply	other threads:[~2013-12-18 21:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 15:49 selinux control for network interface using SOCK_RAW Andy Ruch
2013-12-18 17:31 ` Colin Powers
2013-12-18 17:47   ` Andy Ruch
2013-12-18 20:21 ` Paul Moore
2013-12-18 20:37   ` Andy Ruch
2013-12-18 21:14     ` Paul Moore [this message]
2013-12-19 20:48       ` Andy Ruch
2013-12-19 21:45         ` Paul Moore

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=1762865.mJVkh9reke@sifl \
    --to=pmoore@redhat.com \
    --cc=adruch2002@yahoo.com \
    --cc=selinux@tycho.nsa.gov \
    /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.