linux/include/net
Trent Jaeger df71837d50 [LSM-IPSec]: Security association restriction.
This patch series implements per packet access control via the
extension of the Linux Security Modules (LSM) interface by hooks in
the XFRM and pfkey subsystems that leverage IPSec security
associations to label packets.  Extensions to the SELinux LSM are
included that leverage the patch for this purpose.

This patch implements the changes necessary to the XFRM subsystem,
pfkey interface, ipv4/ipv6, and xfrm_user interface to restrict a
socket to use only authorized security associations (or no security
association) to send/receive network packets.

Patch purpose:

The patch is designed to enable access control per packets based on
the strongly authenticated IPSec security association.  Such access
controls augment the existing ones based on network interface and IP
address.  The former are very coarse-grained, and the latter can be
spoofed.  By using IPSec, the system can control access to remote
hosts based on cryptographic keys generated using the IPSec mechanism.
This enables access control on a per-machine basis or per-application
if the remote machine is running the same mechanism and trusted to
enforce the access control policy.

Patch design approach:

The overall approach is that policy (xfrm_policy) entries set by
user-level programs (e.g., setkey for ipsec-tools) are extended with a
security context that is used at policy selection time in the XFRM
subsystem to restrict the sockets that can send/receive packets via
security associations (xfrm_states) that are built from those
policies.

A presentation available at
www.selinux-symposium.org/2005/presentations/session2/2-3-jaeger.pdf
from the SELinux symposium describes the overall approach.

Patch implementation details:

On output, the policy retrieved (via xfrm_policy_lookup or
xfrm_sk_policy_lookup) must be authorized for the security context of
the socket and the same security context is required for resultant
security association (retrieved or negotiated via racoon in
ipsec-tools).  This is enforced in xfrm_state_find.

On input, the policy retrieved must also be authorized for the socket
(at __xfrm_policy_check), and the security context of the policy must
also match the security association being used.

The patch has virtually no impact on packets that do not use IPSec.
The existing Netfilter (outgoing) and LSM rcv_skb hooks are used as
before.

Also, if IPSec is used without security contexts, the impact is
minimal.  The LSM must allow such policies to be selected for the
combination of socket and remote machine, but subsequent IPSec
processing proceeds as in the original case.

Testing:

The pfkey interface is tested using the ipsec-tools.  ipsec-tools have
been modified (a separate ipsec-tools patch is available for version
0.5) that supports assignment of xfrm_policy entries and security
associations with security contexts via setkey and the negotiation
using the security contexts via racoon.

The xfrm_user interface is tested via ad hoc programs that set
security contexts.  These programs are also available from me, and
contain programs for setting, getting, and deleting policy for testing
this interface.  Testing of sa functions was done by tracing kernel
behavior.

Signed-off-by: Trent Jaeger <tjaeger@cse.psu.edu>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-03 13:10:24 -08:00
..
bluetooth [Bluetooth]: Remove the usage of /proc completely 2005-11-08 09:57:38 -08:00
irda [IRDA]: IrDA prototype fixes 2005-09-05 18:08:11 -07:00
netfilter [NETFILTER]: Add nf_conntrack subsystem. 2005-11-09 16:38:16 -08:00
sctp [SCTP]: Include ulpevents in socket receive buffer accounting. 2005-11-11 16:08:24 -08:00
tc_act
act_api.h
act_generic.h
addrconf.h
af_unix.h
ah.h
arp.h
atmclip.h
ax25.h drivers/net: Remove pointless checks for NULL prior to calling kfree() 2005-10-28 16:53:13 -04:00
checksum.h
compat.h [NET]: Need struct sock forward decl in net/compat.h 2005-09-08 12:32:46 -07:00
datalink.h
dn.h [DECNET]: add memory buffer settings 2005-12-05 13:42:06 -08:00
dn_dev.h
dn_fib.h
dn_neigh.h
dn_nsp.h [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
dn_route.h [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
dsfield.h
dst.h [IPSEC]: Kill obsolete get_mss function 2005-10-26 00:48:45 -02:00
esp.h
flow.h [LSM-IPSec]: Security association restriction. 2006-01-03 13:10:24 -08:00
gen_stats.h
genetlink.h [NETLINK]: Generic netlink family 2005-11-10 02:26:41 +01:00
icmp.h
ieee80211.h [PATCH] git-netdev-all-ieee80211_get_payload-warning-fix 2005-11-18 13:33:31 -05:00
ieee80211_crypt.h ieee80211: cleanup crypto list handling, other minor cleanups. 2005-11-09 01:01:04 -05:00
ieee80211_radiotap.h [PATCH] ieee80211: Added ieee80211_radiotap.h 2005-09-21 23:03:55 -04:00
if_inet6.h [IPV6] mcast: Fix multiple issues in MLDv2 reports. 2005-12-27 14:03:00 -08:00
inet6_hashtables.h [INET]: speedup inet (tcp/dccp) lookups 2005-10-03 14:13:38 -07:00
inet_common.h
inet_connection_sock.h [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
inet_ecn.h [NET]: Introduce INET_ECN_set_ce() function 2005-11-05 22:02:24 +01:00
inet_hashtables.h [TCP/DCCP]: Randomize port selection 2005-11-05 21:23:15 -02:00
inet_timewait_sock.h [TWSK]: Grab the module refcount for timewait sockets 2005-10-10 21:25:23 -07:00
inetpeer.h
ip.h
ip6_checksum.h
ip6_fib.h
ip6_route.h
ip6_tunnel.h
ip_fib.h
ip_mp_alg.h
ip_vs.h [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
ipcomp.h
ipconfig.h
ipip.h
ipv6.h Merge git://git.skbuff.net/gitroot/yoshfuji/linux-2.6.14+advapi-fix/ 2005-11-20 20:52:16 -08:00
ipx.h
iw_handler.h [PATCH] WE-19 for kernel 2.6.13 2005-09-06 22:40:24 -04:00
lapb.h
llc.h [LLC]: Fix sparse warnings 2005-09-22 05:14:33 -03:00
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
llc_if.h
llc_pdu.h [LLC]: Fix typo 2005-11-14 21:58:18 -08:00
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h [LLC]: Fix the accept path 2005-09-22 07:57:21 -03:00
ndisc.h
neighbour.h
netlink.h [NETLINK]: Generic netlink receive queue processor 2005-11-10 02:26:40 +01:00
netrom.h drivers/net: Remove pointless checks for NULL prior to calling kfree() 2005-10-28 16:53:13 -04:00
p8022.h
pkt_act.h
pkt_cls.h
pkt_sched.h
protocol.h
psnap.h
raw.h
rawv6.h
red.h [PKT_SCHED]: Generic RED layer 2005-11-05 22:02:24 +01:00
request_sock.h
rose.h
route.h [IPV4]: Fix secondary IP addresses after promotion 2005-11-22 14:47:37 -08:00
sch_generic.h
scm.h
slhc_vj.h
snmp.h
sock.h [TCP]: speed up SACK processing 2005-11-10 17:14:59 -08:00
syncppp.h [PATCH] drivers/net/wan/: possible cleanups 2005-09-14 08:36:54 -04:00
tcp.h [TCP]: More spelling fixes. 2005-11-15 15:17:10 -08:00
tcp_ecn.h
tcp_states.h
transp_v6.h [IPV6]: Support IPV6_{RECV,}TCLASS socket options / ancillary data. 2005-09-08 10:19:03 +09:00
udp.h
x25.h
x25device.h
xfrm.h [LSM-IPSec]: Security association restriction. 2006-01-03 13:10:24 -08:00