Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id rBIHJGZY030984 for ; Wed, 18 Dec 2013 12:19:18 -0500 References: Message-ID: <1387381759.80678.YahooMailNeo@web163404.mail.gq1.yahoo.com> Date: Wed, 18 Dec 2013 07:49:19 -0800 (PST) From: Andy Ruch Subject: selinux control for network interface using SOCK_RAW To: SELinux ML MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-2090553061-133738636-1387381759=:80678" Reply-To: Andy Ruch List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: ---2090553061-133738636-1387381759=:80678 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello,=0A=0AI'm trying to restrict an application to only have access to so= me network interfaces. I'm running a custom policy on a RHEL 6.3 system. Th= e application is opening the socket as AF_PACKET and SOCK_RAW. However, sel= inux doesn't seem to be controlling any raw access to the interfaces.=0A=0A= I've confirmed using apol that there are no rules for the interface type th= at would allow access. I've also confirmed that the only attribute on the i= nterface is netif_type and that the only access to netif_type is from kerne= l_t. =0A=0A=0AI've granted the application:=0A=A0=A0=A0 allow my_app_t self= :packet_socket { connected_socket_perms };=0A=A0=A0=A0 allow my_app_t self= :capability { net_raw };=0A=0AI was expecting to have to do something like:= =0A=A0=A0=A0 allow my_app_t my_iface_t:netif { some_permission };=0A=0A=0AI= s there any way for me to enforce network interface separation? Or does pac= ket_socket always allow access to all interfaces?=0A=0A=0AThanks,=0AAndy Ru= ch=0A ---2090553061-133738636-1387381759=:80678 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

I'm trying to restrict an=0A application to only ha= ve 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_RA= W. However, selinux doesn't seem to be controlling any raw access to the in= terfaces.

I'= ve confirmed using apol that there are no rules for the interface type that would allow access. I've also=0A confirmed that the on= ly attribute on the interface is netif_type and that the only access to net= if_type is from kernel_t.

I've granted the application:
  = ;  allow my_app_t self:packet_socket { connected_socket_perms };
=
&nb= sp;   allow my_app_t self:capability { net_raw };

I was e= xpecting to have to do something like:
    allow my_app_t= my_iface_t:netif { some_permission };

Is there any way for me to enforce networ= k interface separation? Or does packet_socket always allow access to all in= terfaces?

=
Thanks,=
Andy Ruch
---2090553061-133738636-1387381759=:80678--