All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: SELinux Networking Enhancements
@ 2006-10-20 15:10 Venkat Yekkirala
  2006-10-20 23:24 ` James Morris
  0 siblings, 1 reply; 63+ messages in thread
From: Venkat Yekkirala @ 2006-10-20 15:10 UTC (permalink / raw)
  To: 'James Morris ', Venkat Yekkirala
  Cc: 'jbrindle@tresys.com ', 'selinux@tycho.nsa.gov ',
	'sds@tycho.nsa.gov '

 

-----Original Message-----
From: James Morris
To: Venkat Yekkirala
Cc: jbrindle@tresys.com; selinux@tycho.nsa.gov; sds@tycho.nsa.gov
Sent: 10/19/2006 5:27 PM
Subject: RE: SELinux Networking Enhancements

On Thu, 19 Oct 2006, Venkat Yekkirala wrote:

> You would have just as many "secpoints" as you currently
> would "secmarks". No difference there. Same level of flexibility
> and scalability. Nothing more, nothing less.
> 
> Example:
> 
> 1. An outbound connection to port 80 on machine 10.0.0.1
> 
> SECMARK:
> -A OUTPUT -m state --state NEW -p tcp -d 10.0.0.1 --dport 80 -j
> SECMARK --selctx system_u:object_r:http_client_packet_t:s2
> 
> SECPOINT:
> -A OUTPUT -m state --state NEW -p tcp -d 10.0.0.1 --dport 80 -j
> SECMARK --selctx system_u:object_r:httpd_t:s0
> 
> Reason for the change in Type from http_client_packet_t to httpd_t:
> 
> All incoming packets on this connection would be from a web-server so
should
> be carrying httpd_t as opposed to http_client_packet_t. Also, all
outbound
> traffic on this connection carries the originating socket context
> (firefox_t)
> which would be flow-controlled against httpd_t.
> 
> So, just a change in semantics. Whereas you formerly had
> allow firefox_t http_client_packet_t:packet { send recv }
> 
> you would now have:
> 
> allow firefox_t httpd_t:packet { recv }
> allow firefox_t httpd_t:packet { flow_out }
> 
> For the forwarding case:
> 
> -A PREROUTING -p tcp -s 10.0.0.5  -j SECMARK --selctx
> system_u:object_r:webonly_t:s0
> 
> -A FORWARD -m state --state NEW -p tcp -d 10.0.0.1 --dport 80 -j
> SECMARK --selctx system_u:object_r:httpd_t:s0
> -A PREROUTING -p tcp -s 10.0.0.1 --sport 80 -j SECMARK --selctx
> system_u:object_r:httpd_t:s0
> (can also use CONNSECMARK to save from FORWARD and restore it at
PREROUTING
> to label all traffic back from
> the webserver)
> 
> allow webonly_t httpd_t:packet { flow_out }
> allow httpd_t webonly_t:packet { flow_out }
> 
> I have only given the main rules and there are ofcourse other
supporting
> rules required
> to get things going.

This is too complicated, most people will not understand it.  I think
it's 
also a security risk, because of the complexity of composing these 
labeling mechanisms and the chance that mistakes will be made in 
deployment, as well as scaring people away from using the technology 
altogether.

Venkat's response:
Hi James, can you please tell me exactly what rules (and only those)
that one should be able to specify in the forwarding case in the
following example:

I have a machine 192.168.16.10 that needs to be able to do web-browsing
only, via the router.

Thanks.

Thanks.

--
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.

^ permalink raw reply	[flat|nested] 63+ messages in thread
[parent not found: <36282A1733C57546BE392885C06185920166D6EC@chaos.tcs.tcs-sec.com>]
* RE: SELinux Networking Enhancements
@ 2006-10-16 14:55 Venkat Yekkirala
  0 siblings, 0 replies; 63+ messages in thread
From: Venkat Yekkirala @ 2006-10-16 14:55 UTC (permalink / raw)
  To: 'Joshua Brindle'; +Cc: selinux, jmorris, sds

> > While you still disagree, I think most of us believe that secmarks
> 
> Only there are no secmarks in the new design to begin with. The word
> is a holdover from the current secmark design.
> 
> > should be _local only_ enforcement, not peer labeling, an 
> > ipsec rule is
> > in no way a "peer",
> 
> Agreed. But I fail to see where having a "default" peer on a 
> netfilter rule/secpoint
> would hurt. FYI- this is how MLS implementations work. You 
> have an interface
> that you would label everything coming thru by default with "Secret".
> 
> Also, don't we deem all data on a filesystem that doesn't 
> support individual
> file labeling to be at the label it's mounted at?
> 
> > a remote socket is a peer and a peer should
> > represent that.
> 
> Sure. That's also allowed in secpoint.

If it would serve your needs any better, we can have getpeercon return only
a "true" (meaning external) peer like you like to call it. We can find
someother way to retrieve the default as well (for MLS). Is that better?

--
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.

^ permalink raw reply	[flat|nested] 63+ messages in thread
* SELinux Networking Enhancements
@ 2006-10-16  3:14 Venkat Yekkirala
  2006-10-16 12:40 ` Joshua Brindle
  0 siblings, 1 reply; 63+ messages in thread
From: Venkat Yekkirala @ 2006-10-16  3:14 UTC (permalink / raw)
  To: 'selinux@tycho.nsa.gov'
  Cc: 'jmorris@namei.org', 'sds@tycho.nsa.gov'

There has been a lot of confusion for some time on the new
proposed controls vis a vis the controls past and present.

So I wanted to lay out briefly the past, present and the
proposed future of SELinux networking controls on 2.6 kernels
to put things in perpective.

PAST:

One could control network access based on node, netif
and port contexts. Specifically, sockets were subject
to access checks against the 3 contexts mentioned.

No controls on forwarded traffic available. Also,
no way to retrieve the peer context on TCP sockets and
the security context on IP datagrams.


PRESENT:

secmark enables contexts to be specified on packets
based on attributes on a packet (src, dst addresses,
ports, etc.) that are selectable via iptables rules.
Access checks are socket Vs. packet.

Also, labeled networking via IPSec xfrms and NetLabel/CIPSO
has become available. Also implemented is a way to retrieve
the peer context on TCP sockets and the security context on
datagrams.

But still no controls on forwarded traffic are available.
Also, still no easy way to retrieve the peer context on
TCP sockets and the security context on datagrams, in a
transparent fashion in localhost (loopback) communications.
While one could use NetLabel/CIPSO (MLS only) and in theory
IPSec xfrms to do this for localhost communications, it's
awkward, entails undue overhead and something that needs to
be configured via policy to work.


NEW CONTROLS (SECPOINT):

The implementation of secmark paves the way, from an implementation
standpoint, for the implementation of a different set of controls
that seemlessly and comprehensively provide a way to impose controls
on forwarded traffic as well as traffic destined for and generated on
the local machine. It also paves the way for carrying the peer/datagram
contexts for localhost traffic.

Specifically the following objects are defined/used:

1. Fine-grained security filter points defined using iptables rules.
   These points carry the following contexts:
        a. A set of domains that can flow-in and/or flow_out the secpoint.
        b. A default context to be associated with all traffic that enters
           the secpoint without carrying an explicit label such as NetLabel,
           labeled-ipsec-SA, etc, iff such "unlabeled" domain can actually
           flow thru that secpoint.

        NOTE: The way these 2 contexts are specified in this implementation
        is by specifying the default context with the iptables rule and then
        using SELinux policy to specify the set of domains that can
        flow_in/flow_out of a secpoint with such a default context.

2. Packets: These carry the socket label in the outbound case, or the label
        they came in with, in the inbound case. The label in the inbound
case
        can either be an externally specified label (label over the wire) or
        in it's absence the default label from the secpoint it came in thru.

3. Sockets.

Access Control:

1. Packets are filtered at the security points they pass thru.

   Forwarded traffic: This is filtered on the way in like any other
   traffic and filtered on the way out like any other traffic as well.

   Peer/datagram context: These are transparently available for localhost
   traffic without needing any special configuration or use of specific
   labeling protocols.

2. Access control checks come into play (like they currently do)
   when a socket receives a packet.

--
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.

^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2006-11-03 18:44 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-20 15:10 SELinux Networking Enhancements Venkat Yekkirala
2006-10-20 23:24 ` James Morris
2006-10-23 16:32   ` Venkat Yekkirala
2006-10-23 21:17     ` James Morris
2006-10-24 14:33       ` Venkat Yekkirala
2006-10-30 18:27         ` James Morris
2006-10-30 18:34           ` Joshua Brindle
2006-10-30 18:40             ` James Morris
2006-10-30 18:43               ` Joshua Brindle
2006-10-30 18:49                 ` James Morris
2006-10-31 20:54           ` Venkat Yekkirala
2006-11-01  3:46             ` James Morris
2006-11-01 15:04               ` Paul Moore
2006-11-01 16:00                 ` James Morris
2006-11-01 16:09                   ` Paul Moore
2006-11-01 17:26                     ` James Morris
2006-11-01 17:39                       ` Paul Moore
2006-11-01 20:59                   ` Venkat Yekkirala
2006-11-01 21:29                     ` Paul Moore
2006-11-02 15:15                       ` Venkat Yekkirala
2006-11-02 15:26                         ` Paul Moore
2006-11-02 15:47                           ` Venkat Yekkirala
2006-11-02 16:43                         ` James Morris
2006-11-02 16:45                           ` James Morris
2006-11-02 17:10                             ` Venkat Yekkirala
2006-11-02 17:22                               ` James Morris
2006-11-02 17:31                                 ` Venkat Yekkirala
2006-11-02 16:49                         ` Joshua Brindle
2006-11-02 17:01                           ` Venkat Yekkirala
2006-11-02 17:19                             ` Joshua Brindle
2006-11-02 17:38                               ` Venkat Yekkirala
2006-11-02 17:51                                 ` Paul Moore
2006-11-02 17:53                                 ` Joshua Brindle
2006-11-03 15:12                                   ` Venkat Yekkirala
2006-11-03 18:44                                     ` Joshua Brindle
2006-11-01 14:02           ` Christopher J. PeBenito
2006-11-01 15:58             ` Venkat Yekkirala
2006-11-01 17:54               ` Joshua Brindle
2006-11-01 17:59                 ` Paul Moore
2006-11-01 19:25                   ` Venkat Yekkirala
2006-11-01 19:46                     ` Joshua Brindle
2006-11-01 17:55               ` Christopher J. PeBenito
2006-11-01 18:30                 ` Paul Moore
2006-11-01 19:57                 ` James Morris
2006-11-01 19:59                   ` Joshua Brindle
2006-11-02 16:20                 ` Venkat Yekkirala
2006-11-02 18:33                   ` Christopher J. PeBenito
2006-11-03 14:49                     ` Venkat Yekkirala
     [not found] <36282A1733C57546BE392885C06185920166D6EC@chaos.tcs.tcs-sec.com>
2006-11-02 16:22 ` Venkat Yekkirala
2006-11-02 16:31   ` Joshua Brindle
2006-11-02 16:54     ` Venkat Yekkirala
  -- strict thread matches above, loose matches on Subject: below --
2006-10-16 14:55 Venkat Yekkirala
2006-10-16  3:14 Venkat Yekkirala
2006-10-16 12:40 ` Joshua Brindle
2006-10-16 14:31   ` Venkat Yekkirala
2006-10-18 13:23     ` Joshua Brindle
2006-10-18 14:08       ` Joe Nall
2006-10-18 15:10       ` Venkat Yekkirala
2006-10-18 16:09         ` Joshua Brindle
2006-10-19 15:06           ` Venkat Yekkirala
2006-10-19 16:04             ` Joshua Brindle
2006-10-19 16:54               ` Venkat Yekkirala
2006-10-19 21:27             ` James Morris

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.