All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Antill <jantill@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: "Christopher J. PeBenito" <cpebenito@tresys.com>,
	Joshua Brindle <jbrindle@tresys.com>,
	SE Linux <selinux@tycho.nsa.gov>
Subject: Re: ipsec, netlabels, secmark- How about a little usability?
Date: Thu, 14 Sep 2006 13:24:55 -0400	[thread overview]
Message-ID: <1158254695.8442.30.camel@code.and.org> (raw)
In-Reply-To: <1158252565.25629.111.camel@moss-spartans.epoch.ncsc.mil>

[-- Attachment #1: Type: text/plain, Size: 2480 bytes --]

On Thu, 2006-09-14 at 12:49 -0400, Stephen Smalley wrote:
> On Thu, 2006-09-14 at 12:02 -0400, James Antill wrote:

> The iptables rule only deals with labeling the packet with a type.  The
> policy deals with what domains can send/recv a given packet via allow
> rules like:
> 	allow httpd_t http_client_packet_t:packet { send recv };
> encapsulated in interfaces like:
> 	corenet_sendrecv_http_client_packet(httpd_t)
> 
> But the problem I see with the above example is that refpolicy already
> generates a netfilter contexts entry that maps _everything_ going to
> port 80 with http_client_packet_t, so we would need to delete that entry
> to make the above work, or use a different type
> (http_client_packet_lo_t) and only allow httpd_t to send it, not the
> generic http_client_packet_t.  All of which gets back to proper
> integration.

 The problem is you can't just use "send recv", because httpd_t needs to
call send on sockets it receives from all over the place. So you need an
interface specifically for connect (which, I understood, was called 
something like name_bind)?
 Think of the difference between something coming to port X:80 from Y:Z,
being accepted, processed and a response being sent against some
attacker in httpd_t doing a connect from X:80 to Y:Z as part of some
botnet.

> > 1. httpd_t on one machine is only allowed to connect to mysqld_t(?) on
> > one of these 3 machines.
> > 
> > ...AIUI secmark doesn't know the label of the proc. on the other
> > machines, even when using ipsec/netlabel.
> 
> Yes, but you can label the output packet via secmark with one type if it
> is destined for the mysql port on one of the "good" machines and a
> different type otherwise, and only allow httpd_t to send the "good"
> type.   On the internal machines, you can ensure that only mysqld_t can
> bind to that port.  That doesn't really require a network labeling
> mechanism like ipsec or netlabel per se.

 That works, but is significantly more interdependent. From a useability
POV it would be much nicer to just be able to say something like
"httpd_t can only connect to mysqld_t, and also only on these
machines/networks".

 Also I can pretty much guarantee that if the accepted practice is "just
trust the port number on the other machines". The solution will be to
just use iptables to REJECT packets without that port (as that works
with or without SELinux).

-- 
James Antill <jantill@redhat.com>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-09-14 17:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14 12:52 ipsec, netlabels, secmark- How about a little usability? Daniel J Walsh
2006-09-14 13:50 ` Joshua Brindle
2006-09-14 13:55   ` Joshua Brindle
2006-09-14 14:43   ` Stephen Smalley
2006-09-15 15:36     ` Daniel J Walsh
2006-09-14 16:02   ` James Antill
2006-09-14 16:49     ` Stephen Smalley
2006-09-14 17:24       ` James Antill [this message]
2006-09-14 19:45         ` Stephen Smalley
2006-09-19 20:13           ` Karl MacMillan
2006-09-19 20:35             ` Christopher J. PeBenito
2006-09-19 21:12               ` Karl MacMillan
2006-09-19 20:47       ` Karl MacMillan
2006-09-20 13:30         ` Christopher J. PeBenito
2006-09-20 13:45           ` James Morris
2006-09-20 14:27             ` Christopher J. PeBenito
2006-09-20 14:45               ` James Morris
  -- strict thread matches above, loose matches on Subject: below --
2006-09-14 14:52 Stuart James
2006-09-14 22:52 Venkat Yekkirala
2006-09-15  9:00 ` Stuart James
2006-09-19 21:19 Venkat Yekkirala
2006-09-20  1:35 ` Joshua Brindle
2006-09-20 13:02 Venkat Yekkirala

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=1158254695.8442.30.camel@code.and.org \
    --to=jantill@redhat.com \
    --cc=cpebenito@tresys.com \
    --cc=jbrindle@tresys.com \
    --cc=sds@tycho.nsa.gov \
    --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.