All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-29 16:15 Venkat Yekkirala
  2007-08-29 16:41 ` Paul Moore
  0 siblings, 1 reply; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-29 16:15 UTC (permalink / raw)
  To: Stephen Smalley, Venkat Yekkirala
  Cc: Paul Moore, selinux, James Morris, Darrel Goeddel, kaigai, joe,
	Eric Paris

> > Good. Are you using the upstream or the LSPP kernel? I vaguely
> > remember James asking for stuff to be tested on the LSPP kernel
> > before being ported and presented upstream, but I am now not sure
> > if that applied only to development under the LSPP umbrella.
> > I will be OK either way. I presume Eric would love to see it be the
> > LSPP kernel.
> 
> I'm pretty sure it is the other way around - patches get submitted to
> mainline, vetted there, and then if accepted, back ported to distro
> kernels.

OK, thanks. This would be proper and distro-neutral.

Paul, is davem's net-2.6.24 git cool with you or would you
prefer the stable 2.6.22.5? Or would James' selinu-2.6 git
be proper?

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-29 15:29 Venkat Yekkirala
  2007-08-29 15:45 ` Stephen Smalley
  0 siblings, 1 reply; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-29 15:29 UTC (permalink / raw)
  To: Paul Moore
  Cc: selinux, James Morris, Darrel Goeddel, Stephen Smalley, kaigai,
	joe, Eric Paris

> Please keep sending RFCs/patches to the SELinux list while we 
> sort out all of 
> the implementation details and I'll see about setting up a 
> git tree where we 
> can do all of the bigger/intrusive changes.  This should make 
> it easier for 
> us to work together and people who are interesting in testing the new 
> features will have a working tree to pull from.  Once things 
> are looking good 
> I'll work to get all of the contributed patches upstream.

Good. Are you using the upstream or the LSPP kernel? I vaguely
remember James asking for stuff to be tested on the LSPP kernel
before being ported and presented upstream, but I am now not sure
if that applied only to development under the LSPP umbrella.
I will be OK either way. I presume Eric would love to see it be the
LSPP kernel.

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-29 15:07 Venkat Yekkirala
  0 siblings, 0 replies; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-29 15:07 UTC (permalink / raw)
  To: Paul Moore, Joshua Brindle
  Cc: Joe Nall, Darrel Goeddel, Venkat Yekkirala, selinux, James Morris,
	Darrel Goeddel, Stephen Smalley, kaigai, Eric Paris

Very well said. This should make for a nice chapter/section in SELinux by
Example.

> -----Original Message-----
> From: Paul Moore [mailto:paul.moore@hp.com]
> Sent: Wednesday, August 29, 2007 9:56 AM
> To: Joshua Brindle
> Cc: Joe Nall; Darrel Goeddel; Venkat Yekkirala; selinux@tycho.nsa.gov;
> James Morris; Darrel Goeddel; Stephen Smalley; kaigai@ak.jp.nec.com;
> Eric Paris
> Subject: Re: [RFC 0/5] Static/fallback external labels for NetLabel
> 
> 
> On Wednesday, August 29 2007 10:26:55 am Joshua Brindle wrote:
> > Paul Moore wrote:
> > > On Wednesday, August 29 2007 12:11:14 am Joshua Brindle wrote:
> > >> Because of
> > >> what I said above I think we should 1) not do node based 
> fallbacks and
> > >> 2) not do nic alias-level fallbacks. This is the safe 
> option (as already
> > >> pointed out) and minimizes trust in untrustworthy things 
> (eg., addresses
> > >> coming from the network).
> > >>
> > >> OTOH it may make some peoples lives easier to allow 
> this. It is a false
> > >> sense of security though so I vote for doing nic level 
> fallbacks only
> > >> and if someone *really* wants to do this they can just 
> plug several nics
> > >> into the same network (hopefully they'd recognize the 
> horrible things
> > >> they are doing if it is explicit like that).
> > >>
> > >> It sounds like the decision is still up in the air 
> though, does anyone
> > >> inherently disagree with me here?
> > >
> > > I guess every decision is technically up in the air until the
> > > changes/patches are included in a released kernel, 
> however, I'm pretty
> > > confident that host level granularity of both fallback 
> labels and flow
> > > control peer label filtering is "the right thing".
> > >
> > > I understand your point about not extending trust beyond 
> the level of the
> > > physical wire, that is very easy to 
> rationalize/understand.  However,
> > > from a practical real-world scenario (see my home network 
> behind a NAT
> > > box example, as well as others) I think there is real 
> value in extending
> > > the labeling beyond the wire to the host/network level.  
> SELinux has
> > > always made some allowances to facilitate adoption and 
> ease of use, i.e.
> > > unconfined_t, but has been careful to make sure that 
> these concessions
> > > were always at the discretion of the system 
> administrator.  Fallback
> > > labeling and peer flow controls are configuration options 
> which are only
> > > available to the system administrator and providing host level
> > > granularity can be a significant benefit to a lot of people.
> >
> > concessions are fine when the ramifications are understood, 
> unconfined_t
> > is pretty obvious.
> 
> I tend to think host level fallback labels are pretty obvious 
> too, at least as 
> obvious as unconfined_t if not more so.  The only way to 
> truly understand the 
> ramifications of unconfined_t are to actually look at the 
> policy and examine 
> all of the interactions between unconfined_t and all of the 
> types/attributes 
> defined in policy.  Short circuiting this by making an 
> assumption based on 
> the connotative meaning of the name "unconfined" is just as 
> dangerous, if not 
> more so in my opinion, then host level fallbacks.  Explaining the 
> ramifications of host level fallback labels are pretty 
> simple, here is my 
> quick take:
> 
>  "Choosing to enable multiple fallback labels per interface, i.e.
>   network or host level fallbacks, can be dangerous as it is possible
>   for malicious computers to masquerade as other computers with a
>   different fallback label.  Only use network or host level fallback
>   labels when you can guarantee the security of the network."
> 
> > But when there are security people that believe host 
> > based labeling buys anything then it may be an 
> inappropriate concession.
> 
> I think the key difference between the two sides here is the 
> acceptable level 
> or risk, or the level of assurance.  From what I gather, Joe 
> and the TCS guys 
> are deploying systems in installations where they are able to 
> put a fair 
> amount of trust in the network such that host level fallback 
> labels do not 
> introduce an unacceptable amount of risk.  Your argument 
> assumes a network 
> with no trust where host level fallback labels present a very 
> unacceptable 
> risk.
> 
> Both arguments are correct, the question is what level of 
> functionality do we 
> want to provide?
> 
> > I mean, if I can get on your network and in a matter of seconds take
> > over both your IP and MAC address it isn't good. Worse, I could use
> > something like ettercap and MiM you without you even 
> knowing (and even
> > inject data into the stream).
> 
> Yep, I think we're all familiar with ARP cache poisoning and 
> all the other 
> wonderful things you can do the network.
> 
> > The last email from Joe shows that even security centric 
> people are fine
> > with this situation in a 'medium assurance' environment, if medium
> > assurance means trivially bypassable please count me out. A single 
> > shared network is in no way medium assurance IMO, there is 
> no inherent
> > security when you are on a single network (save for fancy 
> switches that
> > do mac filtering and ip locking per port, how many people 
> actually use
> > those features though).
> 
> I'm making this argument up a bit as I go, so bear with me ...
> 
> You essentially define a network by the machines connected to 
> it, which means 
> that if you can control the machines on that network then you 
> effectively 
> control the network.  Joe is arguing the case for 
> installations where he does 
> control all of the machines on the network.
> 
> > One interesting thing that just occurred to me is vlans. 
> I'm not sure
> > how vlans are implemented on Linux (do they get their own interface
> > names?) but they are much better than the alternative which 
> lets anyone
> > do anything on a single network.
> 
> Like everything else I think this depends on the 
> configuration.  If you have 
> multiple vlans on a single wire and unknown machines on that 
> wire than vlan 
> separation is no different from IP address separation.
> 
> -- 
> paul moore
> linux security @ hp
> 

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-28 18:02 Venkat Yekkirala
  2007-08-28 19:47 ` Paul Moore
  0 siblings, 1 reply; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-28 18:02 UTC (permalink / raw)
  To: Darrel Goeddel
  Cc: Paul Moore, selinux, James Morris, Darrel Goeddel,
	Stephen Smalley, kaigai, joe, Eric Paris

> I am assuming that the *_socket checks used by netlabel would be 
> checking against the new peer label that is in (at least 
> near) the skb, 
> is that right?  If so, the *_socket checks also take care of the peer 
> label coming from loopback.  This would be a bit of a policy change 

I doubt it since NetLabel currently already uses the xfrm label,
if available, as the base sid.

> since the *_socket checks now apply to domains (not just the 
> base type 
> from the initial sid) since the loopback traffic goes through 
> the same 
> checks.  I at least hope we don't add another, separate, 
> check for the 
> loopback case...
> 
> That was just one idea, but I definitely think the 
> unification should be 
> a goal of this exercise.
> 
> -- 
> 
> Darrel
> 

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-28 16:30 Venkat Yekkirala
  2007-08-28 17:39 ` Darrel Goeddel
  2007-08-28 19:26 ` Paul Moore
  0 siblings, 2 replies; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-28 16:30 UTC (permalink / raw)
  To: Paul Moore, Venkat Yekkirala
  Cc: selinux, James Morris, Darrel Goeddel, Stephen Smalley, kaigai,
	joe, Eric Paris



> -----Original Message-----
> From: Paul Moore [mailto:paul.moore@hp.com]
> Sent: Tuesday, August 28, 2007 9:52 AM
> To: Venkat Yekkirala
> Cc: selinux@tycho.nsa.gov; James Morris; Darrel Goeddel; Stephen
> Smalley; kaigai@ak.jp.nec.com; joe@nall.com; Eric Paris
> Subject: Re: [RFC 0/5] Static/fallback external labels for NetLabel
> 
> 
> On Monday, August 27 2007 6:09:12 pm Venkat Yekkirala wrote:
> > [Darrel has made me aware I am breaking threads; will fix this
> > in a day or two]
> 
> I'm really curious at this point, someday you guys are going 
> to have to 
> explain how your email system works ;)
> 
> > > -----Original Message-----
> > > From: Paul Moore [mailto:paul.moore@hp.com]
> >
> > (snip)
> >
> > > > Also, in the forwarding case, while the original 
> xfrm-label should
> > > > still be around in the labeled-IPSec to 
> non-labeled-IPSec case, I
> > > > would imagine in the NetLabel case, the option field 
> would lose the
> > > > "original" label in a DOI gateway instance (if and when 
> NateLabel
> > > > does this), right?
> > >
> > > Yes, once you change the packet's label on the wire you have
> > > to potential to
> > > change the packet's label.  However, simply changing the
> > > label to reflect a
> > > different CIPSO DOI (I assume that is the DOI you were
> > > talking about?)
> >
> > Yes.
> >
> > > shouldn't change the NetLabel/CIPSO label as seen by SELinux
> > > since the only
> > > thing the on-the-wire label translation would be doing is
> > > translating the
> > > label between two different security domains/DOIs, the
> > > semantic value of the
> > > label should be preserved.
> > >
> > > I would consider removing the NetLabel/CIPSO label from a
> > > packet to be the
> > > same as relabeling a packet to unlabeled_t and I still
> > > believe that the
> > > kernel should not get involved in packet relabeling at this
> > > point, leave that
> > > up to userspace.
> >
> > Traditionally anyway, the original label has been used all the
> > way thru for flow-control, etc., since that's the original label
> > of the packet. I believe the packet losing the label is just
> > a recognition of the fact that the packet can't explicitly
> > carry the label onto the other network, but the label is
> > implicit from what I understand.
> 
> Okay, I understand your point now; I still don't think this 
> is too much of a 
> problem.  As you pointed out below we are most likely going 
> to need a final 
> catch-all flow control hook for the default, no-config case 
> (more on this 
> below) and this appears to be an excellent place to make the final 
> on-the-wire labeling decision for forwarded packets that make use of 
> CIPSOesque labeling protocols.  There is also the 
> ip_build_options() hook 
> which I keep talking about, but it may happen to early in the 
> forwarding 
> patch to be useful, I would have to check the stack.  
> Regardless, I'm pretty 
> confident that whatever hooks we put in place to control 
> packet flow should 
> be sufficient to handle the on-the-wire labeling we want/need 
> so lets move on 
> to defining those hooks and see where that leaves us.

As for xfrm, the patch we have already does this. I will send a version
out once we make a final decision on the filtering aspect. Major pieces
missing will be loopback labeling, fallback, OTW labeling for NetLabel
as you talked about earlier, compatibility coding etc. You can perhaps
take by patch and add these to it?

(snip)
> > > As far as I can tell there is still one important issue we
> > > need to resolve -
> > > how to introduce new packet access checks without causing a
> > > regression for
> > > users with older policy.  This of course is tied to the
> > > desire to have a
> > > default/unlabeled_t packet access check in the case where the
> > > admin has not
> > > explicitly setup any SECFILTER points/gates/etc.  Can we live
> > > without a
> > > default check?
> >
> > I highly doubt it. We have erred on the side of caution on this
> > in our patch since we didn't want any inadvertent flows between
> > Secret and TS networks for example. This also obviously retains
> > the SELinux philosophy of no allows by default.
> 
> I noticed there was no comment about how to avoid 
> compatibility issues :)
> 
> I agree that having a default, flow control "catch 
> all"/unlabeled_t check is a 
> good idea and preserved the SELinux philosophy but doing so 
> without breaking 
> the flow of packets in/out/through a system with old policy 
> is not an easy 
> task.  At some point in the future, if we want to reconcile 
> all of the peer 
> label access checks to a single object class, we'll probably 
> need to do 
> something similar to the compat_net (compat_net_peer?) flag.  

We could actually do this as part of this, correct (unless I
missed any one's objections elsewhere).

> If we want to 
> get the flow control functionality in sooner we'll need 
> something more 
> elegant.

Could you please elaborate on this.

> 
> <mental note>
> We should probably look at putting the old compat_net bits in 
> the feature 
> removal queue if they aren't already ...
> </mental note>

I wonder what the current standard is for removing deprecated
code. Is there a certain number of versions we need to wait or
does it vary based on what's been deprecated?

(snip)

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-28 16:13 Venkat Yekkirala
  2007-08-28 16:32 ` Joe Nall
  2007-08-28 19:08 ` Paul Moore
  0 siblings, 2 replies; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-28 16:13 UTC (permalink / raw)
  To: Paul Moore, Darrel Goeddel
  Cc: Venkat Yekkirala, selinux, James Morris, Darrel Goeddel,
	Stephen Smalley, kaigai, joe, Eric Paris

(snip)
> Hmm, so in summary, you (TCS) don't see a need for flow 
> control of 
> fallback 

or generically peer (right?; just trying to make sure I am not missing
anything subtle here ...)

> labels with granularity greater then a single host and if 
> really pushed 
> interface level granularity would most likely suffice.  I'll 
> venture that 
> host/network level granularity might be nice for normal users 
> who only have 
> one interface which connects to multiple networks, e.g. the 
> person sitting at 
> home on a private home network which also connects to the 
> big-bad-internet 
> via a nat box provided by their ISP.

You are right. I think the whole thing boils down to what you trust and
this can theoretically vary from case to case. For example, if one trusts
a host to compartmentalize/segregate/mac services appropriately but cannot
do OTW labeling, and they trust the network path to it (say by use of
IPSec),
it's conceivable that they may want the ability to fallback per-port
(granted
it could get challenging with the use of ephemeral ports by clients) and
further
flow-control per-port as well. But I guess we could always start with the
current ideas on what can *reasonably* and *commonly* be trusted, which it
looks like would be the netif and the node (usually using IPSec as you
mention below)
and see how far that will take us in the real world. At least this should
meet
our current needs. I would be curious to see specifically what other current
users such as Joe Nall, Ted Toth and others would like to see. IOW, will
this
meet their needs. An explicit (N)ACK would be great.

> 
> This now has me rethinking the need for a full featured 
> netfilter based 
> mechanism for flow control (SECFILTER).  I'm wondering if we 
> would be better 
> served by simple hooks in the network device layer for in/out 
> and possible 
> forward.  As James pointed out in the off-list discussion, the whole 
> netfilter mechanism seems like a bit much for what we actually need.

Agreed.

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-27 22:09 Venkat Yekkirala
  2007-08-28 14:51 ` Paul Moore
  2007-08-28 14:58 ` Darrel Goeddel
  0 siblings, 2 replies; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-27 22:09 UTC (permalink / raw)
  To: Paul Moore
  Cc: selinux, James Morris, Darrel Goeddel, Stephen Smalley, kaigai,
	joe, Eric Paris

[Darrel has made me aware I am breaking threads; will fix this
in a day or two]

> -----Original Message-----
> From: Paul Moore [mailto:paul.moore@hp.com]
(snip)
> 
> > Also, in the forwarding case, while the original xfrm-label should
> > still be around in the labeled-IPSec to non-labeled-IPSec case, I
> > would imagine in the NetLabel case, the option field would lose the
> > "original" label in a DOI gateway instance (if and when NateLabel
> > does this), right?
> 
> Yes, once you change the packet's label on the wire you have 
> to potential to 
> change the packet's label.  However, simply changing the 
> label to reflect a 
> different CIPSO DOI (I assume that is the DOI you were 
> talking about?) 

Yes.

> shouldn't change the NetLabel/CIPSO label as seen by SELinux 
> since the only 
> thing the on-the-wire label translation would be doing is 
> translating the 
> label between two different security domains/DOIs, the 
> semantic value of the 
> label should be preserved.
> 
> I would consider removing the NetLabel/CIPSO label from a 
> packet to be the 
> same as relabeling a packet to unlabeled_t and I still 
> believe that the 
> kernel should not get involved in packet relabeling at this 
> point, leave that 
> up to userspace.

Traditionally anyway, the original label has been used all the
way thru for flow-control, etc., since that's the original label
of the packet. I believe the packet losing the label is just
a recognition of the fact that the packet can't explicitly
carry the label onto the other network, but the label is
implicit from what I understand.

For example, in the case of xfrm, the label should be preserved
in the skb->sp field all the way thru, and so we should be able
to prevent a Top Secret xfrm-labeled packet from being forwarded
to a Secret interface even when the packet needs to be sent
in the clear (or using non-labeled IPsec) onto the Secret network.
In the NetLabel case, I wonder if we could use the
same special IP Option that we would use for Loopback packet labeling
to carry the "original" label thru to the last check and
strip it out before it gets on the wire? If this is possible, then
I guess we would need to take care to plant this option on the
packet after it has undergone any xfrms?


> 
> > >  The second idea was to
> > > divide the secmark
> > > field in the sk_buff into two 16 bit sub-fields effectively
> > > shortening peer
> > > and secmark SIDs to 16 bits.
> >
> > I would vote for this (or some variant). This has 2 advantages:
> >
> > 1. Resolve the external labels just once and plant it in the
> >    split secmark.
> >
> > 2. Also use this for a loopback packet labeling (as also pointed
> >    out by you later).
> 
> I'm slowly warming up to the idea of splitting the secmark 
> field, although I 
> still remain very concerned about the long term effects and 
> compatibility 
> issues.  Yes, there is the potential for a network SID mapper 
> but I'm not 
> very excited about that idea right now.  I guess what I'd 
> like to see is 
> something similar to the change below go through a few 
> iterations of testing 
> before we make up our minds.

Sounds like a plan.

>  We'd also need to entire 
> SELinux braintrust to 
> agree to the idea, and aside from Stephen and James, I'm not 
> sure they are 
> still reading this thread.
> 
> Index: linux-2.6_misc/security/selinux/ss/sidtab.c
> ===================================================================
> --- linux-2.6_misc.orig/security/selinux/ss/sidtab.c
> +++ linux-2.6_misc/security/selinux/ss/sidtab.c
> @@ -212,7 +212,7 @@ int sidtab_context_to_sid(struct sidtab
>                 if (sid)
>                         goto unlock_out;
>                 /* No SID exists for the context.  Allocate a 
> new one. */
> -               if (s->next_sid == UINT_MAX || s->shutdown) {
> +               if (s->next_sid > 0x0000ffff || s->shutdown) {
>                         ret = -ENOMEM;
>                         goto unlock_out;
> 
> Let's figure out what we need for flow control and forwarding 
> and then we can 
> start a separate thread regarding 16 bit SIDs to get 
> everyone's attention.

Sure.

> 
> > >  * Loopback/Localhost peer packet labeling
> > >
> > > This has been a long standing requirement which at first
> > > glance seems like it
> > > would be simple to achieve but in practice it has proven
> > > quiet difficult to
> > > implement.  Current solutions to the problem involve using either
> > > NetLabel/CIPSO or labeled IPsec over loopback to provide 
> peer labels,
> > > unfortunately both have drawbacks.  NetLabel/CIPSO is
> > > currently limited to
> > > only conveying the MLS sensitivity label over the wire and
> > > only then for IPv4
> > > packets.
> >
> > This can perhaps be worked-around by passing the sid verbatim
> > using a special IP option (I believe suggested by Pete looking
> > at the Symposium minutes).
> 
> Yep, this is basically the idea behind Selopt or similar.
> 
> > >  * Packet flow control
> > >
> > > Another long standing goal that has not seen much success
> > > over the years.  The
> > > two approaches currently being considered are: per-interface
> > > checks against
> > > the peer label with the possibility of an additional
> > > forwarding hook/check if
> > > needed for labeling purposes, as well as an iptables 
> based filtering
> > > mechanism which has already been discussed off and on on the
> > > public SELinux
> > > and LSPP mailing lists (SECFILTER/SECPOINT).  The idea behind
> > > the iptables
> > > based filtering mechanism is that "filter points" could be
> > > defined using
> > > iptables/netfilter which would provide very granular access
> > > control checks.
> > > The big question that is currently being debated is how much
> > > granularity is
> > > needed and how much makes sense?
> >
> > I believe this is hard to predict for the general case.
> 
> Yep, I believe you're right and the fact that this discussion 
> has gone on for 
> quite some time without any real obvious answer makes me 
> think we won't 
> arrive at one.  In that case, I guess we should just provide the most 
> granularity possible and let the admins sort it out (the 
> SECFILTER idea).
> 
> As far as I can tell there is still one important issue we 
> need to resolve - 
> how to introduce new packet access checks without causing a 
> regression for 
> users with older policy.  This of course is tied to the 
> desire to have a 
> default/unlabeled_t packet access check in the case where the 
> admin has not 
> explicitly setup any SECFILTER points/gates/etc.  Can we live 
> without a 
> default check?

I highly doubt it. We have erred on the side of caution on this
in our patch since we didn't want any inadvertent flows between
Secret and TS networks for example. This also obviously retains
the SELinux philosophy of no allows by default.

> It certainly makes the implementation cleaner and the 
> compatibility issues less of a concern.  Thoughts?
> 
> > >  * Fallback labels
> > >
> > > The simple idea that started this whole discussion.  The need
> > > for a usable
> > > peer label fallback mechanism is understood by everyone but
> > > the granularity
> > > with which peer fallback labels are assigned are still a
> > > source of debate.
> > > The idea is wether the granularity proposed in this NetLabel
> > > patchset which
> > > allows per-host/subnet granularity for each interface is
> > > enough, and if not
> > > is a very granular iptables/netfilter peer label assignment
> > > of fallback
> > > labels required?  This topic did come up briefly some time
> > > ago on the public
> > > mailing list between Joshua Brindle and myself and we 
> agreed that the
> > > granularity presented in this patchset is sufficient,
> > > however, not everyone
> > > feels this way so we are still discussing the best solution.
> >
> > Well, there may be a case, where there's a need to identify an
> > sshd_t peer different from a httpd_t peer. Or a http_client_t
> > peer from an rss_aggregator_t peer. Scalability from coarse to
> > granular should meet the entire spectrum of general cases.
> 
> Yes, but you're not really distinguishing between a ssh_t 
> peer and a http_t 
> peer, e.g. ssh -p 80, which is what troubles me about port 
> level granularity.  
> I sent another mail earlier which I believe described these 
> concerns a bit 
> better.

I missed it earlier. We have been brainstorming on this among
myself, Chad and Darrel and our current thinking (assuming I am
putting it forward correctly) is that if one limits trust to the
interface, it actually seems to make sense to allow defaults at
just the interface level and further it seems to make sense to
have the same level of granularity for both the fallback and the
filtering case. At least for MLS, it seems enough to have the ability
to define fallbacks as also perform filtering at just the interface level.
The question to be debated is if for TE, we need granularity
beyond the interface for fallbacks and flow-control.

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-27 13:02 Venkat Yekkirala
  2007-08-27 13:48 ` Paul Moore
  0 siblings, 1 reply; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-27 13:02 UTC (permalink / raw)
  To: Paul Moore, casey
  Cc: selinux, James Morris, Darrel Goeddel, Stephen Smalley, kaigai,
	joe, Eric Paris


> 
> Actually, after reading Josh's mail I'm now thinking 
> "netfilter label" is 
> probably a better choice.  After all, the bikeshed will need 
> to be repainted 
> in a few years ... ;)

I like "netfilter label" as well (I take it most admins know what
netfilter is; otherwise firewall label?)

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-27 12:59 Venkat Yekkirala
  0 siblings, 0 replies; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-27 12:59 UTC (permalink / raw)
  To: Joshua Brindle, Paul Moore
  Cc: James Morris, casey, selinux, Darrel Goeddel, Stephen Smalley,
	kaigai, joe, Eric Paris

> > What do other people think?  I know you've got an opinion Casey ...

Might I add "firewall" label?

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-27 12:57 Venkat Yekkirala
  0 siblings, 0 replies; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-27 12:57 UTC (permalink / raw)
  To: Joshua Brindle, casey
  Cc: Paul Moore, selinux, James Morris, Darrel Goeddel,
	Stephen Smalley, kaigai, joe, Eric Paris


> > It makes me uncomfortable to hear you say that XFRM is 
> SELinux specific
> > and that it needs to be integrated with NetLabel, which 
> currently isn't.
> > I know that Smack isn't upstream yet. Nonetheless, I would 
> hate to see
> > underlying mechanisms that currently provide useful 
> facilities become
> > SELinux specific.
> >   
> 
> Joy will know better but I don't think there is anything 
> really SELinux 
> specific about XRFM. As far as the racoon support goes it just 
> serializes and sends over a string context, algorithm and 
> DOI.

This is correct.

> The LSM 
> would responsible for verifying the context when it is set. One thing 
> you'd have to figure out as an LSM writer is how to reconcile 
> multiple 
> incoming labels, much like we are trying to do right now. There are 
> already function pointers in the security_ops struct for 
> managing xfrm 
> security data, it shouldn't be any problem for you to use them.

Right.

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-27 12:44 Venkat Yekkirala
  2007-08-27 14:37 ` Paul Moore
  0 siblings, 1 reply; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-27 12:44 UTC (permalink / raw)
  To: Paul Moore, selinux
  Cc: James Morris, Darrel Goeddel, Stephen Smalley, kaigai, joe,
	Eric Paris



> -----Original Message-----
> From: Paul Moore [mailto:paul.moore@hp.com]
> Sent: Friday, August 24, 2007 11:31 AM
> To: selinux@tycho.nsa.gov
> Cc: James Morris; Darrel Goeddel; Stephen Smalley; 
> kaigai@ak.jp.nec.com;
> joe@nall.com; Eric Paris
> Subject: Re: [RFC 0/5] Static/fallback external labels for NetLabel
> 
> 
> For those of you who are still paying attention to this 
> thread you may have 
> been wondering why it went quiet all of a sudden; well, the 
> thread didn't go 
> quiet, it went off-list.  Needless to say, we'd like to bring 
> the discussion 
> back on-list so that others can participate, or at the very 
> least get some 
> cheap entertainment on a Friday afternoon.  The discussion 
> was pretty lively 
> so it's not really practical to replay the entire off-list 
> thread here but 
> I'll try to hit upon where we are currently at as well as some of the 
> highlights that brought us to this point.
> 
> If anyone who was a part of the discussion has anything to 
> add to these notes, 
> feel free.
> 
>  * Packet labels (one or two)
> 
> There was quite a bit of debate about the possibility of 
> going from the two 
> packet labels we have currently, external and internal, to a 
> single packet 
> label.  In order to consolidate the two labels there were two 
> approaches 
> considered: a form of "reconciliation" similar to what was 
> discussed earlier 
> this year, and the elimination of internal labels so that 
> only the external 
> label would be used.  After much discussion it was deemed 
> that the two 
> labels, as currently defined/used, are truly independent 
> labels used for two 
> different purposes and that "reconciliation" was still a bad 
> idea and should 
> not be pursued.  Further, while SECMARK and internal labeling 
> have been slow 
> to be adopted in the major distributions it still serves a 
> useful purpose and 
> should not be eliminated.  The end result was the majority, 
> including Stephen 
> and James, voting to continue with the two packet labels as 
> they currently 
> exist.
> 
> One thing that did arise during the discussion was the slow 
> realization that 
> the names for the two packet labels are probably not as 
> descriptive as they 
> should be and that has most likely led to a certain amount of 
> confusion.  In 
> an effort to help make the two different label types more 
> clear it was 
> decided to start calling the external labels "peer labels" as 
> the external 
> label always represents the label of the peer who originated 
> the packet and 
> it's data.  It was also decided to start calling the internal 
> labels "secmark 
> labels", while the compat_net mechanism still exists it is 
> deprecated in 
> favor of the SECMARK mechanism which is the only way to 
> set/manipulate the 
> internal label.
> 
> As a reminder, below is a definition of the two types of labels.
> 
> Secmark, or internal, labels are essentially a means for 
> integrating the 
> traditional firewall rules with SELinux mandatory access 
> controls.  The 
> secmark labels allow policy writers and security 
> administrators to meet 
> security goals similar to the following:
>  "Only allow Apache to accept connections over tcp/80 from 
>   192.168.0.0/24, restricting it to my local network and not
>   the Big-Bad-Internet."
>  -- or --
>  "Only allow a particular instance of Firefox to connect to
>   1.2.3.4 over tcp/443, restricting it to my online banking
>   site."
> 
> Peer, or external, labels, furnished by NetLabel or labeled 
> IPsec/XFRM, 
> provide the domain/context/label of the process which generated the 
> packet/data.  The external labels allow policy writers and security 
> administrators to meet security goals similar to the following:
>  "This instance of Apache serves sensitive financial data and
>   I only want specific clients/peers/domains to be able to access
>   the data from this Apache instance."
>  -- or --
>  "I want to ensure that users connecting to the login server over
>   a Secret connection run in a Secret domain."

Good description (and I am finally with you guys here).

> 
>  * Splitting the SECMARK field
> 
> After it was agreed to continue using both the peer and 
> secmark labels the 
> discussion turned to how best to propagate those labels with 
> the packet.  As 
> you probably know there is a 32 bit field already in the 
> packet/sk_buff 
> structure which is currently used exclusively by the secmark 
> label.  Once 
> again, there were two approaches considered.  The first was 
> the continuation 
> of the status quo where the secmark label is determined by 
> looking directly 
> at the secmark field in the sk_buff, "sk_buff.secmark", and 
> the peer label is 
> determined through a function call with the sk_buff as an 
> argument, "peer_label(sk_buff)".

This should be possible, with the obvious drawback that of a
performance overhead of "resolving" all the different "peer"
labels each time we need it (for example at each filter point).

Also, in the forwarding case, while the original xfrm-label should
still be around in the labeled-IPSec to non-labeled-IPSec case, I
would imagine in the NetLabel case, the option field would lose the
"original" label in a DOI gateway instance (if and when NateLabel
does this), right?

>  The second idea was to 
> divide the secmark 
> field in the sk_buff into two 16 bit sub-fields effectively 
> shortening peer 
> and secmark SIDs to 16 bits.

I would vote for this (or some variant). This has 2 advantages:

1. Resolve the external labels just once and plant it in the
   split secmark.

2. Also use this for a loopback packet labeling (as also pointed
   out by you later).

> 
> While there is still no final agreement on the best way 
> forward, there does 
> seem to be agreement that the split secmark field offers a 
> good deal of 
> implementation convenience/cleanliness but it requires either 
> a reduction in 
> the system's SID space from 32 bits to 16 bits (4.<mumble> 
> billion unique 
> labels down to 65 thousand unique labels for all 
> subjects/objects on the 
> system) or some sort of additional internal SID mapping 
> mechanism which has 
> yet to be defined.  Both of which have the potential for introducing 
> compatibility problems.
> 
>  * Loopback/Localhost peer packet labeling
> 
> This has been a long standing requirement which at first 
> glance seems like it 
> would be simple to achieve but in practice it has proven 
> quiet difficult to 
> implement.  Current solutions to the problem involve using either 
> NetLabel/CIPSO or labeled IPsec over loopback to provide peer labels, 
> unfortunately both have drawbacks.  NetLabel/CIPSO is 
> currently limited to 
> only conveying the MLS sensitivity label over the wire and 
> only then for IPv4 
> packets.

This can perhaps be worked-around by passing the sid verbatim
using a special IP option (I believe suggested by Pete looking
at the Symposium minutes).

>  Labeled IPsec can convey the full SELinux 
> label/context of the peer 
> for both IPv4 and IPv6 but is difficult to configure and introduces 
> unnecessary overhead for packets that never leave the machine.

(snip)

>  * Packet flow control
> 
> Another long standing goal that has not seen much success 
> over the years.  The 
> two approaches currently being considered are: per-interface 
> checks against 
> the peer label with the possibility of an additional 
> forwarding hook/check if 
> needed for labeling purposes, as well as an iptables based filtering 
> mechanism which has already been discussed off and on on the 
> public SELinux 
> and LSPP mailing lists (SECFILTER/SECPOINT).  The idea behind 
> the iptables 
> based filtering mechanism is that "filter points" could be 
> defined using 
> iptables/netfilter which would provide very granular access 
> control checks.  
> The big question that is currently being debated is how much 
> granularity is 
> needed and how much makes sense? 

I believe this is hard to predict for the general case.

While in some cases you could get away with the use of fine-grained
labeling of packets and then subjecting them to interface-only
controls, I would imagine an approach that can scale from coarse to
granular would make the most sense for the general case.

For the MLS-case, we seem to need at least node-level granularity.

> 
>  * Fallback labels
> 
> The simple idea that started this whole discussion.  The need 
> for a usable 
> peer label fallback mechanism is understood by everyone but 
> the granularity 
> with which peer fallback labels are assigned are still a 
> source of debate.  
> The idea is wether the granularity proposed in this NetLabel 
> patchset which 
> allows per-host/subnet granularity for each interface is 
> enough, and if not 
> is a very granular iptables/netfilter peer label assignment 
> of fallback 
> labels required?  This topic did come up briefly some time 
> ago on the public 
> mailing list between Joshua Brindle and myself and we agreed that the 
> granularity presented in this patchset is sufficient, 
> however, not everyone 
> feels this way so we are still discussing the best solution.

Well, there may be a case, where there's a need to identify an
sshd_t peer different from a httpd_t peer. Or a http_client_t
peer from an rss_aggregator_t peer. Scalability from coarse to
granular should meet the entire spectrum of general cases. 

> 
> As part of the peer fallback label discussion it became 
> apparent to everyone 
> that better integration/cooperation between the NetLabel and 
> XFRM labeling 
> mechanisms is needed.  The strict separation worked well in 
> the beginning but 
> as we start to develop a richer set of functionality the two labeling 
> mechanisms need to work better together to ensure the 
> consistency of the 
> network access controls.  If the approach put forward in this 
> patch set is 
> agreed upon as the right way to solve the peer fallback 
> problem I will be 
> modifying it to take into account XFRM labels so that the 
> NetLabel provided 
> fallback peer label will only be used when there is no XFRM 
> or NetLabel/CIPSO 
> label on the packet.  Further, work will be done to ensure 
> that when both a 
> XFRM and NetLabel/CIPSO label are present on an incoming 
> packet that the 
> labels are the same, otherwise the packet will be dropped/rejected.

Yep.

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-24 18:11 Venkat Yekkirala
  0 siblings, 0 replies; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-24 18:11 UTC (permalink / raw)
  To: Paul Moore, selinux
  Cc: James Morris, Darrel Goeddel, Stephen Smalley, kaigai, joe,
	Eric Paris

> -----Original Message-----
> From: Venkat Yekkirala [mailto:vyekkirala@TrustedCS.com]
> Sent: Friday, August 24, 2007 12:37 PM
> To: Paul Moore; selinux@tycho.nsa.gov
> Cc: James Morris; Darrel Goeddel; Stephen Smalley; 
> kaigai@ak.jp.nec.com;
> joe@nall.com; Eric Paris
> Subject: RE: [RFC 0/5] Static/fallback external labels for NetLabel
> 
> 
> I will go ahead and offer my comments to the below in my
> personal capacity.
> 
> > -----Original Message-----
> > From: Paul Moore [mailto:paul.moore@hp.com]
> (snip)
> > As a reminder, below is a definition of the two types of labels.
> > 
> > Secmark, or internal, labels are essentially a means for 
> > integrating the 
> > traditional firewall rules with SELinux mandatory access 
> > controls.  The 
> > secmark labels allow policy writers and security 
> > administrators to meet 
> > security goals similar to the following:
> >  "Only allow Apache to accept connections over tcp/80 from 
> >   192.168.0.0/24, restricting it to my local network and not
> >   the Big-Bad-Internet."
> >  -- or --
> >  "Only allow a particular instance of Firefox to connect to
> >   1.2.3.4 over tcp/443, restricting it to my online banking
> >   site."
> > 
> 
> Secmark is currently playing the role of arbitrating between
> a socket and a packet, based on the internal knowledge of the
> packet. I don't see why this "internal" label of the packet
> couldn't be the internally defined peer label that MUST be
> the same as any external peer label coming in with the packet.
> 
> Thus the current socket Vs. packet.recv check would be 
> retained intact.
> 
> For the outgoing, the packet would get it's label from the socket
> and then the check would whether the label on the packet matches
> the "internally" defined "local" label. There can further be a
> socket Vs. packet.send, but this will typically boil down to
> can a httpd_t socket send a httpd_t packet (if and when the
> ability to write a packet to a socket with a label different
> from the socket's, the target of the check would then be
> that label).
> 
> Essentially, the following characterization:
> 
> One would define what peers are "expected" to come in with what
> characteristics using iptables selectors. Similarly, one would
> define what local domains are expected to go out with what
> characteristics using iptables selectors. A label coming in with
> a packet MUST match the "expected" label or the packet will 
> be dropped.
> For the outgoing also, a packet's label (domain label from the socket)
> MUST match the "expected" label (defined using iptables 
> selectors) or the
> packet will be dropped.
> 
> We also inherently have flow control in the above.

Also, this doesn't mean we couldn't have additional flow control
at the interface or node levels for added assurance and to meet
controlled interface requirements. Its just that even without these
additional flow-controls, we do have flow-control for forwarded packets
built-in.

--
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] 100+ messages in thread
* RE: [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-24 17:37 Venkat Yekkirala
  2007-08-25 21:01 ` Paul Moore
  0 siblings, 1 reply; 100+ messages in thread
From: Venkat Yekkirala @ 2007-08-24 17:37 UTC (permalink / raw)
  To: Paul Moore, selinux
  Cc: James Morris, Darrel Goeddel, Stephen Smalley, kaigai, joe,
	Eric Paris

I will go ahead and offer my comments to the below in my
personal capacity.

> -----Original Message-----
> From: Paul Moore [mailto:paul.moore@hp.com]
(snip)
> As a reminder, below is a definition of the two types of labels.
> 
> Secmark, or internal, labels are essentially a means for 
> integrating the 
> traditional firewall rules with SELinux mandatory access 
> controls.  The 
> secmark labels allow policy writers and security 
> administrators to meet 
> security goals similar to the following:
>  "Only allow Apache to accept connections over tcp/80 from 
>   192.168.0.0/24, restricting it to my local network and not
>   the Big-Bad-Internet."
>  -- or --
>  "Only allow a particular instance of Firefox to connect to
>   1.2.3.4 over tcp/443, restricting it to my online banking
>   site."
> 

Secmark is currently playing the role of arbitrating between
a socket and a packet, based on the internal knowledge of the
packet. I don't see why this "internal" label of the packet
couldn't be the internally defined peer label that MUST be
the same as any external peer label coming in with the packet.

Thus the current socket Vs. packet.recv check would be retained intact.

For the outgoing, the packet would get it's label from the socket
and then the check would whether the label on the packet matches
the "internally" defined "local" label. There can further be a
socket Vs. packet.send, but this will typically boil down to
can a httpd_t socket send a httpd_t packet (if and when the
ability to write a packet to a socket with a label different
from the socket's, the target of the check would then be
that label).

Essentially, the following characterization:

One would define what peers are "expected" to come in with what
characteristics using iptables selectors. Similarly, one would
define what local domains are expected to go out with what
characteristics using iptables selectors. A label coming in with
a packet MUST match the "expected" label or the packet will be dropped.
For the outgoing also, a packet's label (domain label from the socket)
MUST match the "expected" label (defined using iptables selectors) or the
packet will be dropped.

We also inherently have flow control in the above.

> Peer, or external, labels, furnished by NetLabel or labeled 
> IPsec/XFRM, 
> provide the domain/context/label of the process which generated the 
> packet/data.  The external labels allow policy writers and security 
> administrators to meet security goals similar to the following:
>  "This instance of Apache serves sensitive financial data and
>   I only want specific clients/peers/domains to be able to access
>   the data from this Apache instance."
>  -- or --
>  "I want to ensure that users connecting to the login server over
>   a Secret connection run in a Secret domain."
> 
>  * Splitting the SECMARK field

Having a single label for a packet, essentially, the label of the
data contained in the packet, would greatly simplify things and
IMHO easier to understand.

(snip)

>  * Packet flow control
> 
> Another long standing goal that has not seen much success 
> over the years.  The 
> two approaches currently being considered are: per-interface 
> checks against 
> the peer label with the possibility of an additional 
> forwarding hook/check if 
> needed for labeling purposes, as well as an iptables based filtering 
> mechanism which has already been discussed off and on on the 
> public SELinux 
> and LSPP mailing lists (SECFILTER/SECPOINT).  The idea behind 
> the iptables 
> based filtering mechanism is that "filter points" could be 
> defined using 
> iptables/netfilter which would provide very granular access 
> control checks.  
> The big question that is currently being debated is how much 
> granularity is 
> needed and how much makes sense? 

See the above.

> 
>  * Fallback labels
> 
> The simple idea that started this whole discussion.  The need 
> for a usable 
> peer label fallback mechanism is understood by everyone but 
> the granularity 
> with which peer fallback labels are assigned are still a 
> source of debate.  
> The idea is wether the granularity proposed in this NetLabel 
> patchset which 
> allows per-host/subnet granularity for each interface is 
> enough, and if not 
> is a very granular iptables/netfilter peer label assignment 
> of fallback 
> labels required?  This topic did come up briefly some time 
> ago on the public 
> mailing list between Joshua Brindle and myself and we agreed that the 
> granularity presented in this patchset is sufficient, 
> however, not everyone 
> feels this way so we are still discussing the best solution.

I am one of those that feel that non-granular fallbacks would
be restrictive enough for the general case. We would essentially
need per interface/node/port granularity, which is easily
accomplished via iptables.

> 
> As part of the peer fallback label discussion it became 
> apparent to everyone 
> that better integration/cooperation between the NetLabel and 
> XFRM labeling 
> mechanisms is needed.  The strict separation worked well in 
> the beginning but 
> as we start to develop a richer set of functionality the two labeling 
> mechanisms need to work better together to ensure the 
> consistency of the 
> network access controls.  If the approach put forward in this 
> patch set is 
> agreed upon as the right way to solve the peer fallback 
> problem I will be 
> modifying it to take into account XFRM labels so that the 
> NetLabel provided 
> fallback peer label will only be used when there is no XFRM 
> or NetLabel/CIPSO 
> label on the packet.  Further, work will be done to ensure 
> that when both a 
> XFRM and NetLabel/CIPSO label are present on an incoming 
> packet that the 
> labels are the same, otherwise the packet will be dropped/rejected.

I agree here.

--
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] 100+ messages in thread
* [RFC 0/5] Static/fallback external labels for NetLabel
@ 2007-08-07 14:14 Paul Moore
  2007-08-09 10:57 ` KaiGai Kohei
                   ` (2 more replies)
  0 siblings, 3 replies; 100+ messages in thread
From: Paul Moore @ 2007-08-07 14:14 UTC (permalink / raw)
  To: selinux; +Cc: kaigai, joe

This patchset adds the static/fallback labeling feature to NetLabel that has
been requested on the SELinux mailing list more and more recently.  This new
bit of functionality also matches what can be found on similar trusted/labeled
OSs such as Trusted Solaris, HP-UX CMW, etc.  This patchset it not yet ready
for "upstreaming" so please do not pull this into any tree bound for the
mainline kernel; I still need to do more review and testing of the code.
However, I know there are several of you on this list that have been anxiously
awaiting this patchset so I thought I would make an early release so you could
get a peek and test it out.  I won't be able to work on this patchset much, if
at all, between August 10th and the 20th so don't expect an update from me
until the end of August.

The basic idea is that currently there is no method for providing an external
label to fallback on if a labeled networking mechanism such as NetLabel/CIPSO
or labeled IPsec is not in use.  This patch adds a mechanism for providing a
static fallback label, specified per interface/network, which is used when
a NetLabel recognized labeling protocol (at this point CIPSO) is not in use.

For those of you wishing to try this patchset, it is backed against Linus'
linux-2.6 git tree from the afternoon of August 6th, but I don't imagine you'll
have many problems applying the patchset to later trees at this point in the
2.6.23 release cycle.  In addition to the kernel patches you will also need a
modified version of netlabelctl from the netlabel_tools package.  A very crude
version of the modified tools can be found in the netlabel_tools SVN repository
in the static_label branch.  Please check the NetLabel website on SourceForge,
http://netlabel.sf.net, for information on the SVN repository.  The three new
netlabelctl commands are as follows:

 # netlabelctl unlbl add interface:<DEV> address:<ADDR>[/<MASK>] label:<LABEL>
 # netlabelctl unlbl del interface:<DEV> address:<ADDR>[/<MASK>]
 # netlabelctl -p unlbl list

   DEV = interface, examples: eth0, lo
   ADDR = IP address, examples: 192.168.0.3, ::1
   MASK = IP address mask length, examples 8, 24, 64
   LABEL = LSM/SELinux label, example: system_u:object_r:unlabeled_t:s2

For example, if you wanted to label all inbound traffic on eth1 from
192.168.0.0/16 with the label "system_u:object_r:staticlabel_t:s7" you would
type:

 # netlabelctl unlbl add interface:eth1 address:192.168.0.0/16 \
                         label:system_u:object_r:staticlabel_t:s7

Both IPv4 and IPv6 addresses can be used and if the address mask is ommitted
from the command the address is assumed to be a host address, not a network,
and the maximum mask size for that address family is used.  If you do not wish
to specify an address, simply use a address mask of zero, "/0", which will
cause all addresses within that address family to match.

-- 
paul moore
linux security @ hp

--
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] 100+ messages in thread

end of thread, other threads:[~2007-08-29 16:55 UTC | newest]

Thread overview: 100+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 16:15 [RFC 0/5] Static/fallback external labels for NetLabel Venkat Yekkirala
2007-08-29 16:41 ` Paul Moore
  -- strict thread matches above, loose matches on Subject: below --
2007-08-29 15:29 Venkat Yekkirala
2007-08-29 15:45 ` Stephen Smalley
2007-08-29 15:07 Venkat Yekkirala
2007-08-28 18:02 Venkat Yekkirala
2007-08-28 19:47 ` Paul Moore
2007-08-28 16:30 Venkat Yekkirala
2007-08-28 17:39 ` Darrel Goeddel
2007-08-28 19:36   ` Paul Moore
2007-08-28 19:26 ` Paul Moore
2007-08-28 16:13 Venkat Yekkirala
2007-08-28 16:32 ` Joe Nall
2007-08-28 19:08 ` Paul Moore
2007-08-27 22:09 Venkat Yekkirala
2007-08-28 14:51 ` Paul Moore
2007-08-28 14:58 ` Darrel Goeddel
2007-08-28 15:12   ` Darrel Goeddel
2007-08-28 15:51   ` Paul Moore
2007-08-28 16:18     ` Joe Nall
2007-08-28 18:51       ` Paul Moore
2007-08-28 19:10         ` Joe Nall
2007-08-28 19:08           ` Stephen Smalley
2007-08-28 19:48           ` Joshua Brindle
2007-08-28 22:26             ` Joe Nall
2007-08-29  0:16               ` Joshua Brindle
2007-08-29  3:45                 ` Joshua Brindle
2007-08-29  4:11                   ` Joshua Brindle
2007-08-29  4:49                     ` Joe Nall
2007-08-29 14:04                       ` Joshua Brindle
2007-08-29 15:50                         ` Joe Nall
2007-08-29 16:31                           ` Joshua Brindle
2007-08-29 12:21                     ` Paul Moore
2007-08-29 14:26                       ` Joshua Brindle
2007-08-29 14:56                         ` Paul Moore
2007-08-29 15:08                           ` Joshua Brindle
2007-08-29 16:55                             ` Paul Moore
2007-08-28 17:23     ` Darrel Goeddel
2007-08-28 19:07       ` Paul Moore
2007-08-27 13:02 Venkat Yekkirala
2007-08-27 13:48 ` Paul Moore
2007-08-27 12:59 Venkat Yekkirala
2007-08-27 12:57 Venkat Yekkirala
2007-08-27 12:44 Venkat Yekkirala
2007-08-27 14:37 ` Paul Moore
2007-08-24 18:11 Venkat Yekkirala
2007-08-24 17:37 Venkat Yekkirala
2007-08-25 21:01 ` Paul Moore
2007-08-07 14:14 Paul Moore
2007-08-09 10:57 ` KaiGai Kohei
2007-08-09 11:48   ` Paul Moore
2007-08-09 12:42 ` Stephen Smalley
2007-08-09 13:29   ` Paul Moore
2007-08-09 13:54     ` Stephen Smalley
2007-08-09 14:48       ` Paul Moore
2007-08-09 15:49         ` James Morris
2007-08-09 16:01         ` Stephen Smalley
2007-08-09 22:35           ` Paul Moore
2007-08-09 13:59     ` James Morris
2007-08-09 14:50       ` Paul Moore
2007-08-09 15:13         ` Stephen Smalley
2007-08-09 14:41     ` Darrel Goeddel
2007-08-09 14:57       ` Paul Moore
2007-08-09 15:07         ` Darrel Goeddel
2007-08-09 15:32     ` Casey Schaufler
2007-08-09 15:39       ` Stephen Smalley
2007-08-09 16:16         ` Casey Schaufler
2007-08-09 14:09   ` Darrel Goeddel
2007-08-09 14:24     ` James Morris
2007-08-09 16:42       ` Darrel Goeddel
2007-08-09 19:20         ` Joe Nall
2007-08-09 19:47           ` Darrel Goeddel
2007-08-09 20:12             ` Joe Nall
2007-08-09 21:15               ` Stephen Smalley
2007-08-09 21:18               ` Darrel Goeddel
2007-08-09 22:48                 ` Paul Moore
2007-08-09 20:17             ` Paul Moore
2007-08-09 14:53     ` Paul Moore
2007-08-09 16:08       ` Darrel Goeddel
2007-08-09 22:55       ` Darrel Goeddel
2007-08-10 16:49         ` James Morris
2007-08-14 14:47           ` Darrel Goeddel
2007-08-15  4:24             ` James Morris
2007-08-15 22:35               ` Darrel Goeddel
2007-08-16 15:04                 ` James Morris
2007-08-24 16:31                   ` Paul Moore
2007-08-24 18:34                     ` James Morris
2007-08-24 19:02                     ` Casey Schaufler
2007-08-24 19:49                       ` Paul Moore
2007-08-24 20:17                         ` James Morris
2007-08-24 20:24                           ` Paul Moore
2007-08-24 20:47                             ` Joshua Brindle
2007-08-24 20:42                         ` Casey Schaufler
2007-08-24 21:10                           ` Paul Moore
2007-08-24 21:37                             ` Casey Schaufler
2007-08-24 20:29                       ` Joshua Brindle
2007-08-28 14:03                     ` Darrel Goeddel
2007-08-28 15:16                       ` Paul Moore
2007-08-09 15:48 ` Casey Schaufler
2007-08-09 19:38   ` Paul Moore

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.