linux-sg2042/drivers/net
Thomas Graf 3511494ce2 vxlan: Group Policy extension
Implements supports for the Group Policy VXLAN extension [0] to provide
a lightweight and simple security label mechanism across network peers
based on VXLAN. The security context and associated metadata is mapped
to/from skb->mark. This allows further mapping to a SELinux context
using SECMARK, to implement ACLs directly with nftables, iptables, OVS,
tc, etc.

The group membership is defined by the lower 16 bits of skb->mark, the
upper 16 bits are used for flags.

SELinux allows to manage label to secure local resources. However,
distributed applications require ACLs to implemented across hosts. This
is typically achieved by matching on L2-L4 fields to identify the
original sending host and process on the receiver. On top of that,
netlabel and specifically CIPSO [1] allow to map security contexts to
universal labels.  However, netlabel and CIPSO are relatively complex.
This patch provides a lightweight alternative for overlay network
environments with a trusted underlay. No additional control protocol
is required.

           Host 1:                       Host 2:

      Group A        Group B        Group B     Group A
      +-----+   +-------------+    +-------+   +-----+
      | lxc |   | SELinux CTX |    | httpd |   | VM  |
      +--+--+   +--+----------+    +---+---+   +--+--+
	  \---+---/                     \----+---/
	      |                              |
	  +---+---+                      +---+---+
	  | vxlan |                      | vxlan |
	  +---+---+                      +---+---+
	      +------------------------------+

Backwards compatibility:
A VXLAN-GBP socket can receive standard VXLAN frames and will assign
the default group 0x0000 to such frames. A Linux VXLAN socket will
drop VXLAN-GBP  frames. The extension is therefore disabled by default
and needs to be specifically enabled:

   ip link add [...] type vxlan [...] gbp

In a mixed environment with VXLAN and VXLAN-GBP sockets, the GBP socket
must run on a separate port number.

Examples:
 iptables:
  host1# iptables -I OUTPUT -m owner --uid-owner 101 -j MARK --set-mark 0x200
  host2# iptables -I INPUT -m mark --mark 0x200 -j DROP

 OVS:
  # ovs-ofctl add-flow br0 'in_port=1,actions=load:0x200->NXM_NX_TUN_GBP_ID[],NORMAL'
  # ovs-ofctl add-flow br0 'in_port=2,tun_gbp_id=0x200,actions=drop'

[0] https://tools.ietf.org/html/draft-smith-vxlan-group-policy
[1] http://lwn.net/Articles/204905/

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 01:11:41 -05:00
..
appletalk net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
arcnet ARCNET: enable eae arcnet card support 2014-09-29 14:36:26 -04:00
bonding bonding: cleanup bond_opts array 2015-01-12 16:39:31 -05:00
caif caif: Fix napi poll list corruption 2014-12-22 16:34:39 -05:00
can Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
cris
dsa net: dsa: bcm_sf2: always select FIXED_PHY 2014-12-16 00:57:07 -05:00
ethernet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
fddi net: fddi: skfp: smt.c: Remove unused function 2015-01-02 16:36:07 -05:00
hamradio hamradio: 6pack: remove unnecessary check 2014-11-03 15:34:31 -05:00
hippi
hyperv hyperv: Fix some variable name typos in send-buffer init/revoke 2014-12-22 16:11:11 -05:00
ieee802154 at86rf230: Constify struct regmap_config 2015-01-05 16:30:50 -05:00
ipvlan ipvlan: move the device check function into netdevice.h 2014-12-09 16:10:06 -05:00
irda irda: vlsi_ir: Replace timeval with ktime_t 2015-01-11 21:39:40 -05:00
phy net: phy: micrel: use generic config_init for KSZ8021/KSZ8031 2014-12-26 16:19:50 -05:00
plip
ppp ppp_read(): switch to skb_copy_datagram_iter() 2014-12-09 16:29:10 -05:00
slip
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
vmxnet3 net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
wan net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
wimax kbuild: remove unnecessary "obj- := dummy.o" trick 2014-10-02 13:55:02 +02:00
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
xen-netback xen-netback: fixing the propagation of the transmit shaper timeout 2015-01-06 14:17:37 -05:00
Kconfig ipvlan: ipvlan depends on INET and IPV6 2014-11-29 20:53:05 -08:00
LICENSE.SRC
Makefile ipvlan: Initial check-in of the IPVLAN driver. 2014-11-24 15:29:18 -05:00
Space.c
dummy.c dummy: use MODULE_VERSION 2014-12-09 21:51:06 -05:00
eql.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
ifb.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
loopback.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
macvlan.c macvlan: play well with ipvlan device 2014-12-09 16:10:06 -05:00
macvtap.c net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tun.c net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
veth.c
virtio_net.c virtio-net: don't do header check for dodgy gso packets 2014-12-30 18:53:20 -05:00
vxlan.c vxlan: Group Policy extension 2015-01-15 01:11:41 -05:00
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00