haugene / vpn-configs-contrib

A collection of configs for various VPN providers
GNU General Public License v3.0
180 stars 744 forks source link

AUTH_FAILED with Windscribe #86

Closed DrissiReda closed 2 years ago

DrissiReda commented 2 years ago

Is there a pinned issue for this?

Is there an existing or similar issue for this?

Is there any comment in the documentation for this?

Is this related to the container/transmission?

Are you using the latest release?

Have you tried using the dev branch latest?

Config used

I'm using Kubernetes, here is my deployment:

deployment.yaml ```yaml kind: Deployment apiVersion: apps/v1 metadata: name: torrent-transmission-openvpn namespace: media spec: replicas: 1 selector: matchLabels: app: transmission-openvpn release: torrent template: metadata: creationTimestamp: null labels: app: transmission-openvpn release: torrent spec: volumes: - name: downloads persistentVolumeClaim: claimName: torrent-pvc - name: config secret: secretName: windscribe-uk-udp-1194 defaultMode: 420 - name: auth-user-pass secret: secretName: windscribe-user-pass defaultMode: 420 - name: dev-tun hostPath: path: /dev/net/tun type: '' containers: - name: transmission-openvpn image: haugene/transmission-openvpn:latest ports: - name: http containerPort: 9091 protocol: TCP env: - name: OPENVPN_PROVIDER value: WINDSCRIBE - name: OPENVPN_USERNAME valueFrom: secretKeyRef: name: windscribe-credentials key: username - name: OPENVPN_PASSWORD valueFrom: secretKeyRef: name: windscribe-credentials key: password - name: TRANSMISSION_RPC_USERNAME value: foo - name: TRANSMISSION_RPC_PASSWORD value: foo - name: TRANSMISSION_PEER_PORT value: '47444' - name: TRANSMISSION_RPC_AUTHENTICATION_REQUIRED value: 'true' - name: TRANSMISSION_DOWNLOAD_DIR value: /downloads/transmission - name: PUID value: '1000' - name: PGID value: '1000' resources: {} volumeMounts: - name: downloads mountPath: /data subPath: configs/transmission-data - name: downloads mountPath: /downloads/transmission subPath: downloads/transmission - name: config mountPath: /etc/openvpn/custom/default.ovpn subPath: openvpn.conf - name: dev-tun mountPath: /dev/net/tun - name: auth-user-pass mountPath: /config/openvpn-credentials.txt subPath: openvpn-credentials.txt terminationMessagePath: /dev/termination-log terminationMessagePolicy: File imagePullPolicy: IfNotPresent securityContext: capabilities: add: - NET_ADMIN restartPolicy: Always terminationGracePeriodSeconds: 30 dnsPolicy: None securityContext: {} schedulerName: default-scheduler dnsConfig: nameservers: - 8.8.8.8 - 8.8.4.4 ```

Here is the config file I'm using from the secret windscribe-uk-udp-1194 : I obtained it from windscribe website directly, generated for openvpn version 2.6+

openvpn.conf ```yaml client dev tun proto udp remote lhr-171.whiskergalaxy.com 1194 verify-x509-name lhr-171.windscribe.com name nobind auth-user-pass /config/openvpn-credentials.txt resolv-retry infinite cipher AES-256-GCM ncp-ciphers AES-256-GCM:AES-256-CBC:AES-128-GCM auth SHA512 verb 2 mute-replay-warnings remote-cert-tls server persist-key persist-tun key-direction 1 -----BEGIN CERTIFICATE----- MIIF5zCCA8+gAwIBAgIUXKzAwOtQBNDoTXcnwR7GxbVkRqAwDQYJKoZIhvcNAQEL BQAwezELMAkGA1UEBhMCQ0ExCzAJBgNVBAgMAk9OMRAwDgYDVQQHDAdUb3JvbnRv MRswGQYDVQQKDBJXaW5kc2NyaWJlIExpbWl0ZWQxEDAOBgNVBAsMB1N5c3RlbXMx HjAcBgNVBAMMFVdpbmRzY3JpYmUgTm9kZSBDQSBYMTAeFw0yMTA3MDYyMTM5NDNa Fw0zNzA3MDIyMTM5NDNaMHsxCzAJBgNVBAYTAkNBMQswCQYDVQQIDAJPTjEQMA4G A1UEBwwHVG9yb250bzEbMBkGA1UECgwSV2luZHNjcmliZSBMaW1pdGVkMRAwDgYD VQQLDAdTeXN0ZW1zMR4wHAYDVQQDDBVXaW5kc2NyaWJlIE5vZGUgQ0EgWDEwggIi MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDg/79XeOvthNbhtocxaJ6raIsr lSrnUJ9xAyYHJV+auT4ZlACNE54NVhrGPBEVdNttUdezHaPUlQA+XTWUPlHMayIg 9dsQEFdHH3StnFrjYBzeCO76trPZ8McU6PzW+LqNEvFAwtdKjYMgHISkt0YPUPdB 7vED6yqbyiIAlmN5u/uLG441ImnEq5kjIQxVB+IHhk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c/PT7a+PxDT8co2m6TtcRK3mFT/71svWB0zy7qAtSWT1C82 W5JFkhkP44UMLwGUuJsrYy2qAZVru6Jp6vU/zOghLp5kwa1cO1GEbYinvoyTw4Xk OuaIfEMUZA10QCCW8uocxqIZXTzvF7LaqqsTCcAMcviKGXS5lvxLtqTEDO5rYbf8 n71J2qUyUQ5yYTE0UFQYiYTuvCbtRg2TJdQy05nisw1O8Hm2erAmUveSTr3CWZ/a v7Dtup352gRS6qxW4w0jRN3NLfLyazK/JjTX -----END CERTIFICATE----- -----BEGIN OpenVPN Static key V1----- 5801926a57ac2ce27e3dfd1dd6ef8204 2d82bd4f3f0021296f57734f6f1ea714 a6623845541c4b0c3dea0a050fe6746c b66dfab14cda27e5ae09d7c155aa554f 399fa4a863f0e8c1af787e5c602a801d 3a2ec41e395a978d56729457fe6102d7 d9e9119aa83643210b33c678f9d4109e 3154ac9c759e490cb309b319cf708cae 83ddadc3060a7a26564d1a24411cd552 fe6620ea16b755697a4fc5e6e9d0cfc0 c5c4a1874685429046a424c026db672e 4c2c492898052ba59128d46200b40f88 0027a8b6610a4d559bdc9346d33a0a6b 08e75c7fd43192b162bfd0aef0c716b3 1584827693f676f9a5047123466f0654 eade34972586b31c6ce7e395f4b478cb -----END OpenVPN Static key V1----- ```
And finally the secret `windscribe-user-pass`, using credentials supplied by windscribe in the same configuration page: openvpn-credentials.txt ```yaml username password ```

Current Behavior

When the pod starts I get the error AUTH_FAILED:

Expected Behavior

Authentication to work

How have you tried to solve the problem?

Log output

Here is a complete log:

logs.txt ```bash Starting container with revision: 8cc1870cc039201e0e2f8b7684a9f4e96ae03ab9 Creating TUN device /dev/net/tun mknod: /dev/net/tun: File exists Using OpenVPN provider: WINDSCRIBE Running with VPN_CONFIG_SOURCE auto No bundled config script found for WINDSCRIBE. Defaulting to external config Downloading configs from https://github.com/haugene/vpn-configs-contrib/archive/main.zip into /tmp/tmp.Jr4ukIUBWb Extracting configs to /tmp/tmp.Y2ALqRDBwC Found configs for WINDSCRIBE in /tmp/tmp.Y2ALqRDBwC/vpn-configs-contrib-main/openvpn/windscribe, will replace current content in /etc/openvpn/windscribe Cleanup: deleting /tmp/tmp.Jr4ukIUBWb and /tmp/tmp.Y2ALqRDBwC No VPN configuration provided. Using default. Modifying /etc/openvpn/windscribe/default.ovpn for best behaviour in this container Modification: Point auth-user-pass option to the username/password file Modification: Change ca certificate path Modification: Change ping options Modification: Update/set resolv-retry to 15 seconds Modification: Change tls-crypt keyfile path Modification: Set output verbosity to 3 Modification: Remap SIGUSR1 signal to SIGTERM, avoid OpenVPN restart loop Setting OpenVPN credentials... /etc/openvpn/start.sh: line 160: /config/openvpn-credentials.txt: Read-only file system /etc/openvpn/start.sh: line 161: /config/openvpn-credentials.txt: Read-only file system chmod: changing permissions of '/config/openvpn-credentials.txt': Read-only file system Fri Feb 18 17:54:13 2022 WARNING: file '/config/openvpn-credentials.txt' is group or others accessible Fri Feb 18 17:54:13 2022 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 19 2021 Fri Feb 18 17:54:13 2022 library versions: OpenSSL 1.1.1f 31 Mar 2020, LZO 2.10 Fri Feb 18 17:54:13 2022 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts Fri Feb 18 17:54:13 2022 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication Fri Feb 18 17:54:13 2022 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication Fri Feb 18 17:54:13 2022 TCP/UDP: Preserving recently used remote address: [AF_INET]103.108.92.83:1194 Fri Feb 18 17:54:13 2022 Socket Buffers: R=[212992->212992] S=[212992->212992] Fri Feb 18 17:54:13 2022 UDP link local: (not bound) Fri Feb 18 17:54:13 2022 UDP link remote: [AF_INET]103.108.92.83:1194 Fri Feb 18 17:54:13 2022 TLS: Initial packet from [AF_INET]103.108.92.83:1194, sid=09680171 36ec70dd Fri Feb 18 17:54:13 2022 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this Fri Feb 18 17:54:13 2022 VERIFY OK: depth=2, C=CA, ST=ON, L=Toronto, O=Windscribe Limited, OU=Systems, CN=Windscribe Node CA X1 Fri Feb 18 17:54:13 2022 VERIFY OK: depth=1, C=CA, ST=ON, L=Toronto, O=Windscribe Limited, OU=Systems, CN=Windscribe Node CA X2 Fri Feb 18 17:54:13 2022 VERIFY KU OK Fri Feb 18 17:54:13 2022 Validating certificate extended key usage Fri Feb 18 17:54:13 2022 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication Fri Feb 18 17:54:13 2022 VERIFY EKU OK Fri Feb 18 17:54:13 2022 VERIFY X509NAME OK: C=CA, ST=ON, L=Toronto, O=Windscribe Limited, OU=Systems, CN=adl-354.windscribe.com Fri Feb 18 17:54:13 2022 VERIFY OK: depth=0, C=CA, ST=ON, L=Toronto, O=Windscribe Limited, OU=Systems, CN=adl-354.windscribe.com Fri Feb 18 17:54:14 2022 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 4096 bit RSA Fri Feb 18 17:54:14 2022 [adl-354.windscribe.com] Peer Connection Initiated with [AF_INET]103.108.92.83:1194 Fri Feb 18 17:54:15 2022 SENT CONTROL [adl-354.windscribe.com]: 'PUSH_REQUEST' (status=1) Fri Feb 18 17:54:15 2022 AUTH: Received control message: AUTH_FAILED Fri Feb 18 17:54:15 2022 SIGTERM[soft,auth-failure] received, process exiting ```

Environment

- OS: Debian 11
- Containerd: 1.4.9
- Kubernetes: 1.22.2

Anything else?

No response

pkishino commented 2 years ago

check your log:

Setting OpenVPN credentials...
/etc/openvpn/start.sh: line 160: /config/openvpn-credentials.txt: Read-only file system
/etc/openvpn/start.sh: line 161: /config/openvpn-credentials.txt: Read-only file system
chmod: changing permissions of '/config/openvpn-credentials.txt': Read-only file system
Fri Feb 18 17:54:13 2022 WARNING: file '/config/openvpn-credentials.txt' is group or others accessible

you need to check your file permissions etc, the script cannot set the credentials, hence when it tries to authenticate it will have empty credentials and then the auth fails