All of lore.kernel.org
 help / color / mirror / Atom feed
* RHEL5 Kernel with labeled networking
@ 2006-10-03  0:23 Eric Paris
  2006-10-03 15:34 ` Linda Knippers
  2006-10-03 16:40 ` Paul Moore
  0 siblings, 2 replies; 33+ messages in thread
From: Eric Paris @ 2006-10-03  0:23 UTC (permalink / raw)
  To: selinux, redhat-lssp; +Cc: paul.moore, vyekkirala, jmorris

DO NOT USE THESE KERNELS ON A PRODUCTION SYSTEM!

If you go to http://people.redhat.com/eparis/RHEL5_labeled_networking/
you should find a set of kernels based off of the Red Hat RHEL5 source
tree.  These should include patches for 

network labeling support from Venkat
netlabel auditing
ipsec/secmark secid reconciliation
netlabel secid reconciliation

I need a very fast response from everyone involved if these kernels

A) boot
B) run without labeled networking (very very important)
C) run with labeled networking

If you run across a problem feel free to let me or the list know.  You
may also feel free to open a bug in bugzilla.redhat.com for the product
choose Red Hat Enterprise Linux Public Beta and RHEL5.  If you open a
bug for this labeled networking you can go ahead and assign it to
eparis@redhat.com so I'm sure to see it and bug the correct people.

At this time there is a known ipsec problem with these kernels.  I
haven't looked at it closely but I believe the problem is that processes
which intend to send over an ipsec tunnels but have certain avc denials
will actually cause traffic to flow unencrypted.  SO PLEASE DO NOT USE
THESE ON ANY PRODUCTION SYSTEM!!  There is work going on upstream (on
linux-netdev not either of these lists) to fix this issue in the 2.6-net
tree and when it is finished it will get brought back into RHEL5.  (I
don't think you will hit this bug with relatively modern policy but it
is there and can be a serious security flaw)

Before network labeling is completed we still need some work
implementing how we plan to audit configuration changes in ipsec
labeling decisions.  I believe we agreed today that this auditing must
be done in kernelspace since we do not have fine grained enough controls
on netlink messages to allow for all of the auditing in userspace.

DO NOT USE THESE KERNELS ON A PRODUCTION SYSTEM

-Eric


--
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] 33+ messages in thread
* Re: RHEL5 Kernel with labeled networking
@ 2006-10-03 18:37 Joy Latten
  2006-10-03 19:18 ` Joshua Brindle
  2006-10-03 21:27 ` Linda Knippers
  0 siblings, 2 replies; 33+ messages in thread
From: Joy Latten @ 2006-10-03 18:37 UTC (permalink / raw)
  To: eparis, redhat-lssp, selinux; +Cc: jmorris, paul.moore, vyekkirala

>Before network labeling is completed we still need some work
>implementing how we plan to audit configuration changes in ipsec
>labeling decisions.  I believe we agreed today that this auditing must
>be done in kernelspace since we do not have fine grained enough controls
>on netlink messages to allow for all of the auditing in userspace.
>

I've talked to Klaus about what needs to be audited for ipsec and
lspp compliance. I will begin work on a patch and get this out
to the list as soon as I can. We will audit everytime a policy is 
added/removed to/from the ipsec policy database.

Regards,
Joy 

--
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] 33+ messages in thread
* RE: [redhat-lspp] Re: RHEL5 Kernel with labeled networking
@ 2006-10-04 18:41 Venkat Yekkirala
  2006-10-04 22:18 ` Joy Latten
  2006-10-05 14:49 ` Joshua Brindle
  0 siblings, 2 replies; 33+ messages in thread
From: Venkat Yekkirala @ 2006-10-04 18:41 UTC (permalink / raw)
  To: Joshua Brindle, selinux
  Cc: paul.moore, Linda Knippers, redhat-lspp, Venkat Yekkirala,
	James Morris, Eric Paris

> > Using these kernels I'm getting some interesting denials. I labeled 
> > the spd's with system_u:object_r:ipsec_spd_t:s0 so that it would be 
> > discernible from any socket contexts that may appear.
> >
> > First I had to add a polmatch rule for unconfined_t to 
> ipsec_spd_t, so 
> > far it makes sense.

Yes.

> >
> > Next I need polmatch on unconfined_t to unconfined_t, I 
> assume this is 
> > because the SA is going to be labeled unconfined_t, seems 
> reasonable.

If you have the contraints from the policy patch I posted last night
applied to your policy, you won't need the above allow rule.

> > Racoon also needed setcontext for unconfined_t unconfined_t 
> (not sure 
> > what the source and target mean here)

The source should be racoon (running in unconfined_t?) and the
target is the new SA context (unconfined_t I suppose).

> >
> > the denial I totally don't understand is:
> > audit(1159877238.937:35): avc:  denied  { polmatch } for  
> > scontext=system_u:object_r:unlabeled_t:s0 
> > tcontext=root:system_r:unconfined_t:s0-s0:c0.c255 tclass=association

This can happen if, for example, iptables rejects an "unlabeled"
packet with a TCP Reset. The reply packet flow will derive its
label from the original packet (unlabeled in this case).

Other examples are where an outgoing packet would derive its label
from an incoming packet are:

- icmp messages
- tcp resets generated by tcp.
- tcp aknowledgements when the socket is in time_wait and SYN_RCVD states.

One thing to keep in mind is that secid reconciliation occurs AFTER all
the IPSec xfrm(s) are applied (decrypted, decompressed, etc). So the
label a packet has at the point a response is generated (expect the last
2 tcp in the above) might not have been reconciled, and thus could be
carrying whatever label has been defined via secmark.

> >
> > there is no unlabeled anything, except for a non-ipsec connection 
> > which isn't being used, I don't understand how this would 
> happen at all.
> >
> > After all that it isn't working as expected. the SA's get set up 
> > correctly based on the initiators socket (I'm using 
> semanage_t in this 
> > case) but the reciever SA's aren't set up with the 
> receiving process 
> > socket context so I get:
> >
> > Received: Hello, root:system_r:semanage_t:s0-s0:c0.c255 from 
> > root:system_r:semanage_t:s0-s0:c0.c255

Is the context after Hello, the context returned by getpeercon?

Also, where are you getting the "from" context from?

> >
> > no matter what context the server is running in.

Likely because you are running in permissive mode. ANY process can now
"sendto" the same SA.

> >
> > Further, once that SA is created all domains can use it and 
> it retains 
> > the same context, if I rerun the client in unconfined_t I still get:
> >
> > Received: Hello, root:system_r:semanage_t:s0-s0:c0.c255 from 
> > root:system_r:semanage_t:s0-s0:c0.c255
> >
> > I am running in permissive (I'd hope that wouldn't affect 
> this but I 
> > can see how it could)

In fact it does.

> because my policy doesn't yet have 
> flow_in and 
> > flow_out permissions (any chance to get a policy patch? :) )
> >
> > Am I off base here, is this the expected results? 
> On the bright side localhost connections seem to work well:
> # ./client 127.0.0.1
> Received: Hello, root:system_r:unconfined_t:s0-s0:c0.c255 from 
> root:system_r:semanage_t:s0-s0:c0.c255
> 
> so getpeercon got the right answer on both sides.

Are you able to rerun the tests AFTER applying the
constrains from last night's policy patch and while
in enforcing?

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

end of thread, other threads:[~2006-10-06 16:45 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-03  0:23 RHEL5 Kernel with labeled networking Eric Paris
2006-10-03 15:34 ` Linda Knippers
2006-10-03 15:41   ` Stephen Smalley
2006-10-03 15:51     ` Linda Knippers
2006-10-03 16:12       ` Linda Knippers
2006-10-03 15:45   ` Eric Paris
2006-10-03 16:08     ` James Morris
2006-10-03 16:24       ` Linda Knippers
2006-10-03 16:41         ` James Morris
2006-10-03 16:46           ` Linda Knippers
2006-10-03 16:46       ` Joshua Brindle
2006-10-03 19:29         ` Joshua Brindle
2006-10-04 14:09       ` [redhat-lspp] " Stephen Smalley
2006-10-04 19:04       ` Daniel J Walsh
2006-10-03 16:40 ` Paul Moore
  -- strict thread matches above, loose matches on Subject: below --
2006-10-03 18:37 Joy Latten
2006-10-03 19:18 ` Joshua Brindle
2006-10-03 19:16   ` Joy Latten
2006-10-03 20:40     ` Linda Knippers
2006-10-03 21:25       ` Joshua Brindle
2006-10-03 21:26       ` [redhat-lspp] " Klaus Weidner
2006-10-04 16:25         ` Steve Grubb
2006-10-04 16:39           ` George C. Wilson
2006-10-04 16:13       ` Steve Grubb
2006-10-04 16:28         ` Karl MacMillan
2006-10-03 21:27 ` Linda Knippers
2006-10-03 21:30   ` Karl MacMillan
2006-10-03 21:47     ` Linda Knippers
2006-10-03 22:40       ` Joshua Brindle
2006-10-03 22:59         ` Linda Knippers
2006-10-03 23:38           ` [redhat-lspp] " Casey Schaufler
2006-10-05 22:47             ` Klaus Weidner
2006-10-06 10:49               ` Joshua Brindle
2006-10-06 16:45               ` Karl MacMillan
2006-10-04 14:57           ` Stephen Smalley
2006-10-04 15:20             ` Linda Knippers
2006-10-04 17:41               ` [redhat-lspp] " Klaus Weidner
2006-10-04 17:51                 ` Eric Paris
2006-10-04 17:57                   ` Linda Knippers
2006-10-04 17:57                   ` Stephen Smalley
2006-10-04 17:56                 ` Stephen Smalley
2006-10-04 16:34     ` Steve Grubb
2006-10-04 18:41 Venkat Yekkirala
2006-10-04 22:18 ` Joy Latten
2006-10-05 14:49 ` Joshua Brindle

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.