mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-05 00:00:45 -04:00
testing: Add ikev2/rw-sig-auth scenario
This commit is contained in:
parent
3b31245a0f
commit
2f1b2d9183
10
testing/tests/ikev2/rw-sig-auth/description.txt
Normal file
10
testing/tests/ikev2/rw-sig-auth/description.txt
Normal file
@ -0,0 +1,10 @@
|
||||
The roadwarriors <b>carol</b> an <b>dave</b> set up a connection to gateway
|
||||
<b>moon</b>. They authenticate themselves using <b>RSA signatures</b> but
|
||||
they use different hash algorithms. <b>moon</b> uses signature scheme constraints
|
||||
to only allow access to the <b>research</b> and <b>accounting</b> subnets if
|
||||
specific algorithms are used. <b>Note:</b> Because the client certificate's are signed
|
||||
with SHA-256 we have to accept that algorithm too because signature schemes in
|
||||
<b>rightauth</b> are also used as constraints for the whole certificate chain.
|
||||
Therefore, <b>carol</b> obtains access to the <b>research</b> subnet behind gateway
|
||||
<b>moon</b> whereas <b>dave</b> has access to the <b>accounting</b> subnet, but not
|
||||
vice-versa.
|
20
testing/tests/ikev2/rw-sig-auth/evaltest.dat
Normal file
20
testing/tests/ikev2/rw-sig-auth/evaltest.dat
Normal file
@ -0,0 +1,20 @@
|
||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||
moon ::cat /var/log/daemon.log::authentication of .*carol@strongswan.org.* with RSA_EMSA_PKCS1_SHA384 successful::YES
|
||||
moon ::ipsec status 2> /dev/null::research.*ESTABLISHED.*moon.strongswan.org.*PH_IP_CAROL::YES
|
||||
carol::ipsec status 2> /dev/null::alice.*ESTABLISHED.*PH_IP_CAROL.*moon.strongswan.org::YES
|
||||
moon ::ipsec status 2> /dev/null::research.*INSTALLED, TUNNEL::YES
|
||||
carol::ipsec status 2> /dev/null::alice.*INSTALLED, TUNNEL::YES
|
||||
carol::ipsec status 2> /dev/null::venus.*INSTALLED, TUNNEL::NO
|
||||
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||
moon ::cat /var/log/daemon.log::authentication of .*dave@strongswan.org.* with RSA_EMSA_PKCS1_SHA512 successful::YES
|
||||
moon ::ipsec status 2> /dev/null::accounting.*ESTABLISHED.*moon.strongswan.org.*PH_IP_DAVE::YES
|
||||
dave ::ipsec status 2> /dev/null::alice.*ESTABLISHED.*PH_IP_DAVE.*moon.strongswan.org::YES
|
||||
moon ::ipsec status 2> /dev/null::accounting.*INSTALLED, TUNNEL::YES
|
||||
dave ::ipsec status 2> /dev/null::alice.*INSTALLED, TUNNEL::NO
|
||||
dave ::ipsec status 2> /dev/null::venus.*INSTALLED, TUNNEL::YES
|
||||
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||
dave::ping -c 1 PH_IP_VENUS::64 bytes from PH_IP_VENUS: icmp_req=1::YES
|
||||
moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
|
||||
moon::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
|
||||
moon::tcpdump::IP dave.strongswan.org > moon.strongswan.org: ESP::YES
|
||||
moon::tcpdump::IP moon.strongswan.org > dave.strongswan.org: ESP::YES
|
29
testing/tests/ikev2/rw-sig-auth/hosts/carol/etc/ipsec.conf
Normal file
29
testing/tests/ikev2/rw-sig-auth/hosts/carol/etc/ipsec.conf
Normal file
@ -0,0 +1,29 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
|
||||
conn alice
|
||||
rightsubnet=10.1.0.10/32
|
||||
also=home
|
||||
auto=add
|
||||
|
||||
conn venus
|
||||
rightsubnet=10.1.0.20/32
|
||||
also=home
|
||||
auto=add
|
||||
|
||||
conn home
|
||||
left=%any
|
||||
leftcert=carolCert.pem
|
||||
leftauth=pubkey-sha384
|
||||
leftfirewall=yes
|
||||
right=PH_IP_MOON
|
||||
rightid=@moon.strongswan.org
|
||||
rightauth=pubkey
|
@ -0,0 +1,5 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac xcbc stroke kernel-netlink socket-default fips-prf updown
|
||||
}
|
29
testing/tests/ikev2/rw-sig-auth/hosts/dave/etc/ipsec.conf
Normal file
29
testing/tests/ikev2/rw-sig-auth/hosts/dave/etc/ipsec.conf
Normal file
@ -0,0 +1,29 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
|
||||
conn alice
|
||||
rightsubnet=10.1.0.10/32
|
||||
also=home
|
||||
auto=add
|
||||
|
||||
conn venus
|
||||
rightsubnet=10.1.0.20/32
|
||||
also=home
|
||||
auto=add
|
||||
|
||||
conn home
|
||||
left=%any
|
||||
leftcert=daveCert.pem
|
||||
leftauth=pubkey-sha512
|
||||
leftfirewall=yes
|
||||
right=PH_IP_MOON
|
||||
rightid=@moon.strongswan.org
|
||||
rightauth=pubkey
|
@ -0,0 +1,5 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac xcbc stroke kernel-netlink socket-default fips-prf updown
|
||||
}
|
30
testing/tests/ikev2/rw-sig-auth/hosts/moon/etc/ipsec.conf
Normal file
30
testing/tests/ikev2/rw-sig-auth/hosts/moon/etc/ipsec.conf
Normal file
@ -0,0 +1,30 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
|
||||
conn research
|
||||
rightauth=pubkey-sha384-sha256
|
||||
leftsubnet=10.1.0.0/28
|
||||
also=rw
|
||||
auto=add
|
||||
|
||||
conn accounting
|
||||
rightauth=pubkey-sha512-sha256
|
||||
leftsubnet=10.1.0.16/28
|
||||
also=rw
|
||||
auto=add
|
||||
|
||||
conn rw
|
||||
left=PH_IP_MOON
|
||||
leftid=@moon.strongswan.org
|
||||
leftcert=moonCert.pem
|
||||
leftauth=pubkey
|
||||
leftfirewall=yes
|
||||
right=%any
|
@ -0,0 +1,3 @@
|
||||
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||
|
||||
: RSA moonKey.pem
|
@ -0,0 +1,5 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac xcbc stroke kernel-netlink socket-default fips-prf updown
|
||||
}
|
6
testing/tests/ikev2/rw-sig-auth/posttest.dat
Normal file
6
testing/tests/ikev2/rw-sig-auth/posttest.dat
Normal file
@ -0,0 +1,6 @@
|
||||
moon::ipsec stop
|
||||
carol::ipsec stop
|
||||
dave::ipsec stop
|
||||
moon::iptables-restore < /etc/iptables.flush
|
||||
carol::iptables-restore < /etc/iptables.flush
|
||||
dave::iptables-restore < /etc/iptables.flush
|
12
testing/tests/ikev2/rw-sig-auth/pretest.dat
Normal file
12
testing/tests/ikev2/rw-sig-auth/pretest.dat
Normal file
@ -0,0 +1,12 @@
|
||||
moon::iptables-restore < /etc/iptables.rules
|
||||
carol::iptables-restore < /etc/iptables.rules
|
||||
dave::iptables-restore < /etc/iptables.rules
|
||||
moon::ipsec start
|
||||
carol::ipsec start
|
||||
dave::ipsec start
|
||||
carol::sleep 1
|
||||
carol::ipsec up alice
|
||||
carol::ipsec up venus
|
||||
dave::ipsec up alice
|
||||
dave::ipsec up venus
|
||||
dave::sleep 1
|
26
testing/tests/ikev2/rw-sig-auth/test.conf
Normal file
26
testing/tests/ikev2/rw-sig-auth/test.conf
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This configuration file provides information on the
|
||||
# guest instances used for this test
|
||||
|
||||
# All guest instances that are required for this test
|
||||
#
|
||||
VIRTHOSTS="alice venus moon carol winnetou moon"
|
||||
|
||||
# Corresponding block diagram
|
||||
#
|
||||
DIAGRAM="a-v-m-c-w-d.png"
|
||||
|
||||
# Guest instances on which tcpdump is to be started
|
||||
#
|
||||
TCPDUMPHOSTS="moon"
|
||||
|
||||
# Guest instances on which IPsec is started
|
||||
# Used for IPsec logging purposes
|
||||
#
|
||||
IPSECHOSTS="moon carol dave"
|
||||
|
||||
# Guest instances on which FreeRadius is started
|
||||
#
|
||||
RADIUSHOSTS=""
|
||||
|
Loading…
x
Reference in New Issue
Block a user