All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Vermeulen <sven.vermeulen@siphos.be>
To: selinux@tycho.nsa.gov
Subject: Labeled IPSec trying to match policy for peer label?
Date: Fri, 5 Jul 2013 20:39:02 +0200	[thread overview]
Message-ID: <20130705183902.GA26996@siphos.be> (raw)

Hi all,

I'm trying to get a Labeled IPSec working, but the moment I enable a context
on the SPD, any attempt to set up an SA (by racoon) fails with the following
message:

Jul  5 20:25:16 test racoon: INFO: respond new phase 2 negotiation: 192.168.100.152[500]<=>192.168.100.153[500]
Jul  5 20:25:16 test racoon: ERROR: no policy found: 10.1.3.0/24[0] 10.1.2.0/24[0] proto=any dir=in sec_ctx:doi=1,alg=1,len=24,str=root:sysadm_r:ping_t:s0
Jul  5 20:25:16 test racoon: ERROR: failed to get proposal for responder.

There is (of course?) no policy for ping_t, only for ipsec_spd_t. Let me
show you the setkey instructions:

spdadd 10.1.2.0/24 10.1.3.0/24 any -ctx 1 1
  "system_u:object_r:ipsec_spd_t:s0" -P out ipsec
  esp/tunnel/192.168.100.152-192.168.100.153/require;

spdadd 10.1.3.0/24 10.1.2.0/24 any -ctx 1 1
  "system_u:object_r:ipsec_spd_t:s0" -P in ipsec
  esp/tunnel/192.168.100.153-192.168.100.152/require;

If I drop the "-ctx 1 1 "system_u:object_r:ipsec_spd_t:s0"" then the IPSec
works (I verified that it is indeed IPSec traffic). For allowing ping to
work across the Labeled IPSec setup, I have added allow rules for kernel_t
and ping_t to association:polmatch against ipsec_spd_t (without those, IPSec
isn't used as expected).

Considering I get the error message on the server side tells me that the
label is properly passed on (so ping_t is the peer label) but I was
expecting that it would match the policy on the ipsec_spd_t context?

What am I missing here? Is there a particular check that IPSec does further
that I'm not seeing (no denials are shown, even disabled all dontaudits)?

On the client side (where ping is invoked) the following is logged:

Jul  5 20:24:32 test racoon: INFO: initiate new phase 2 negotiation: 192.168.100.153[500]<=>192.168.100.152[500]
Jul  5 20:24:58 test racoon: INFO: unsupported PF_KEY message REGISTER
Jul  5 20:25:06 test racoon: INFO: security context doi: 1
Jul  5 20:25:06 test racoon: INFO: security context algorithm: 1
Jul  5 20:25:06 test racoon: INFO: security context length: 24
Jul  5 20:25:06 test racoon: INFO: security context: root:sysadm_r:ping_t:s0
Jul  5 20:25:06 test racoon: NOTIFY: no in-bound policy found: 10.1.2.0/24[0] 10.1.3.0/24[0] proto=any dir=in sec_ctx:doi=1,alg=1,len=24,str=root:sysadm_r:ping_t:s0
Jul  5 20:25:06 test racoon: INFO: initiate new phase 2 negotiation: 192.168.100.153[500]<=>192.168.100.152[500]
Jul  5 20:25:36 test racoon: INFO: IPsec-SA expired: ESP/Tunnel 192.168.100.152[500]->192.168.100.153[500] spi=220218943(0xd20463f)
Jul  5 20:25:36 test racoon: WARNING: PF_KEY EXPIRE message received from kernel for SA being negotiated. Stopping negotiation.


Wkr,
  Sven Vermeulen

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

             reply	other threads:[~2013-07-05 18:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-05 18:39 Sven Vermeulen [this message]
2013-07-05 20:50 ` Labeled IPSec trying to match policy for peer label? Paul Moore
2013-07-06  6:39   ` Sven Vermeulen
2013-07-06 12:41     ` Sven Vermeulen
2013-07-06 15:40       ` Chad Hanson
2013-07-06 19:21         ` Sven Vermeulen
2013-07-06 20:53           ` Joe Nall
2013-07-07  8:33           ` Labeled IPSec trying to match policy for peer label? (solved) Sven Vermeulen
2013-07-07 14:53             ` Chad Hanson

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=20130705183902.GA26996@siphos.be \
    --to=sven.vermeulen@siphos.be \
    --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.