Open AbrohamLincoln opened 3 years ago
@mddamato should we consider using strongswan from k3s-root? see https://github.com/k3s-io/k3s-root/tree/v0.9.1/package/strongswan
@dweomer I think using the binary from k3os-root is the better approach, I can create a PR in the next days.
Is there a way to get the executables in a similar manner to this line?
@dweomer I think using the binary from k3os-root is the better approach, I can create a PR in the next days.
Is there a way to get the executables in a similar manner to this line?
$ curl -fsSL https://github.com/k3s-io/k3s-root/releases/download/v0.10.1/k3s-root-amd64.tar | tar tv | grep swan
-rwxr-xr-x root/root 934304 2021-11-15 09:10 ./bin/swanctl
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/strongswan.d/
-rw-r--r-- root/root 2105 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon-logging.conf
-rw-r--r-- root/root 65 2021-11-15 09:10 ./etc/strongswan/strongswan.d/pki.conf
-rw-r--r-- root/root 151 2021-11-15 09:10 ./etc/strongswan/strongswan.d/swanctl.conf
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/
-rw-r--r-- root/root 270 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/drbg.conf
-rw-r--r-- root/root 383 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-tls.conf
-rw-r--r-- root/root 131 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/sha1.conf
-rw-r--r-- root/root 147 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-simaka-pseudonym.conf
-rw-r--r-- root/root 346 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-tnc.conf
-rw-r--r-- root/root 131 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/sha2.conf
-rw-r--r-- root/root 879 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-ttls.conf
-rw-r--r-- root/root 139 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-mschapv2.conf
-rw-r--r-- root/root 297 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/updown.conf
-rw-r--r-- root/root 3093 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-radius.conf
-rw-r--r-- root/root 133 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/pkcs12.conf
-rw-r--r-- root/root 131 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/mgf1.conf
-rw-r--r-- root/root 131 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/x509.conf
-rw-r--r-- root/root 130 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/pem.conf
-rw-r--r-- root/root 131 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/hmac.conf
-rw-r--r-- root/root 133 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/pubkey.conf
-rw-r--r-- root/root 144 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-simaka-reauth.conf
-rw-r--r-- root/root 130 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/aes.conf
-rw-r--r-- root/root 269 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-dynamic.conf
-rw-r--r-- root/root 139 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-identity.conf
-rw-r--r-- root/root 130 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/rc2.conf
-rw-r--r-- root/root 132 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/pkcs7.conf
-rw-r--r-- root/root 986 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/stroke.conf
-rw-r--r-- root/root 136 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/tnc-tnccs.conf
-rw-r--r-- root/root 615 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/tnccs-20.conf
-rw-r--r-- root/root 138 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/constraints.conf
-rw-r--r-- root/root 340 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/resolve.conf
-rw-r--r-- root/root 131 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/xcbc.conf
-rw-r--r-- root/root 130 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/md5.conf
-rw-r--r-- root/root 140 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/tnccs-dynamic.conf
-rw-r--r-- root/root 491 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/socket-default.conf
-rw-r--r-- root/root 135 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/counters.conf
-rw-r--r-- root/root 425 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/random.conf
-rw-r--r-- root/root 140 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/xauth-generic.conf
-rw-r--r-- root/root 131 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/cmac.conf
-rw-r--r-- root/root 132 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/pkcs8.conf
-rw-r--r-- root/root 2449 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/kernel-netlink.conf
-rw-r--r-- root/root 132 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/nonce.conf
-rw-r--r-- root/root 133 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/af-alg.conf
-rw-r--r-- root/root 183 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-simaka-sql.conf
-rw-r--r-- root/root 133 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/dnskey.conf
-rw-r--r-- root/root 132 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/pkcs1.conf
-rw-r--r-- root/root 134 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-md5.conf
-rw-r--r-- root/root 283 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/revocation.conf
-rw-r--r-- root/root 164 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-aka.conf
-rw-r--r-- root/root 362 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/attr.conf
-rw-r--r-- root/root 133 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/sshkey.conf
-rw-r--r-- root/root 777 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-peap.conf
-rw-r--r-- root/root 130 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/des.conf
-rw-r--r-- root/root 130 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/pgp.conf
-rw-r--r-- root/root 164 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-sim.conf
-rw-r--r-- root/root 215 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-gtc.conf
-rw-r--r-- root/root 137 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/curve25519.conf
-rw-r--r-- root/root 130 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/gmp.conf
-rw-r--r-- root/root 221 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/vici.conf
-rw-r--r-- root/root 231 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/tnccs-11.conf
-rw-r--r-- root/root 139 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-sim-file.conf
-rw-r--r-- root/root 262 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/eap-aka-3gpp2.conf
-rw-r--r-- root/root 135 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon/fips-prf.conf
-rw-r--r-- root/root 173 2021-11-15 09:10 ./etc/strongswan/strongswan.d/starter.conf
-rw-r--r-- root/root 11396 2021-11-15 09:10 ./etc/strongswan/strongswan.d/charon.conf
-rw-r--r-- root/root 113 2021-11-15 09:10 ./etc/strongswan/strongswan.d/tnc.conf
-rw-r--r-- root/root 281 2021-11-15 09:10 ./etc/strongswan/strongswan.conf
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/pubkey/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/x509crl/
drwxr-x--- root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/private/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/x509ocsp/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/conf.d/
drwxr-x--- root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/pkcs8/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/x509ca/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/x509aa/
-rw-r----- root/root 16058 2021-11-15 09:10 ./etc/strongswan/swanctl/swanctl.conf
drwxr-x--- root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/ecdsa/
drwxr-x--- root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/rsa/
drwxr-x--- root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/pkcs12/
drwxr-x--- root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/bliss/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/x509ac/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/swanctl/x509/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/ipsec.d/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/ipsec.d/crls/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/ipsec.d/reqs/
drwxr-x--- root/root 0 2021-11-15 09:10 ./etc/strongswan/ipsec.d/private/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/ipsec.d/cacerts/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/ipsec.d/certs/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/ipsec.d/acerts/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/ipsec.d/ocspcerts/
drwxr-xr-x root/root 0 2021-11-15 09:10 ./etc/strongswan/ipsec.d/aacerts/
-rw------- root/root 48 2021-11-15 09:10 ./etc/strongswan/ipsec.secrets
-rw-r--r-- root/root 608 2021-11-15 09:10 ./etc/strongswan/ipsec.conf
Thanks you for the pointer to the files @dweomer
The k3s version especially the needed charon
daemon seems out of the box not compatible with flannel
00[LIB] no files found matching '/var/lib/rancher/k3s/agent/strongswan/strongswan.conf'
00[LIB] abort initialization due to invalid configuration
I also tested the PR #8 which in the end did not find the needed binary (charon
)
I assume changing the image to alpine is not an option, as this snippet e.g. works and establishes a connection?
FROM alpine:3.15
RUN apk add --no-cache ca-certificates strongswan net-tools
COPY --from=builder /opt/xtables/bin/ /usr/sbin/
COPY --from=builder /usr/local/bin/ /opt/bin/
Sorry, I missed this issue! Are you running k3s or rke2?
Currently running an rke2 cluster, but for the sake of simplicity in terms of flannel switched to wireguard, so probably not going to pursue this any further.
The Strongswan package is not installed. This prevents the use of the IPSEC flannel backend.
If I build the image, the build succeeds but strongswan is not installed:
It appears as though two things need to happen for the strongswan package to be linstalled:
https://github.com/rancher/image-build-flannel/blob/f3f20870d28b32f11bad3438cd3432f0f2aee370/Dockerfile#L37