Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[incubator/openvpn] Can't log in in VPN client #228

Open
fredsted opened this issue Jan 24, 2020 · 9 comments
Open

[incubator/openvpn] Can't log in in VPN client #228

fredsted opened this issue Jan 24, 2020 · 9 comments

Comments

@fredsted
Copy link

fredsted commented Jan 24, 2020

Hi,

I've managed to install the chart and make it work with the latest letsencrypt (had to create RBAC stuff and set the letsencrypt_ca to https://acme-v02.api.letsencrypt.org/directory to avoid an "ACME V1" error), but I can't seem to log in in my VPN client.

The certificate is created as simon even though my github username is fredsted, not sure if that has anything to do with it.

Here's some output from the openvpn pod:

Fri Jan 24 13:50:30 2020 172.21.48.88:7254 PLUGIN_CALL: POST /usr/lib/openvpn/plugins/openvpn-plugin-auth-pam.so/PLUGIN_AUTH_USER_PASS_VERIFY status=1
Fri Jan 24 13:50:30 2020 172.21.48.88:7254 PLUGIN_CALL: plugin function PLUGIN_AUTH_USER_PASS_VERIFY failed with status 1: /usr/lib/openvpn/plugins/openvpn-plugin-auth-pam.so
Fri Jan 24 13:50:30 2020 172.21.48.88:7254 TLS Auth Error: Auth Username/Password verification failed for peer
Fri Jan 24 13:50:30 2020 172.21.48.88:7254 WARNING: cipher with small block size in use, reducing reneg-bytes to 64MB to mitigate SWEET32 attacks.
Fri Jan 24 13:50:30 2020 172.21.48.88:7254 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Fri Jan 24 13:50:30 2020 172.21.48.88:7254 [simon] Peer Connection Initiated with [AF_INET]172.21.48.88:7254

I'm using Google Authenticator for Github, so I've tried several combinations of simon/fredsted and with/without my Google Authenticator code.

I can also see that the link to "Github PAM" does not work, so I can't investigate that part further. https://github.com/cloudposse/github-pam

Is it possible to just delete the password authentication from the VPN? I can make do with the oauth sign-in-to-download-vpn-config part.

@alebabai @osterman

@natcohen
Copy link

@fredsted Were you able to find a solution? Could you please share your RBAC file you created, that would be awesome!

Thanks!

@fredsted
Copy link
Author

Hi @natcohen

I added these to my adaptation of the openvpn chart here:

templates/letsencrypt.role.yaml

{{ if .Values.ui.ssl.enabled }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
  name: {{ template "fullname_letsencrypt" . }}-role
  labels:
    app: "{{ .Chart.Name }}"
    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
rules:
- apiGroups:      ['']
  resources:      ['secrets']
  verbs:          ["get", "watch", "list", "create", "update", "patch"]
{{- end }}

templates/letsencrypt.rolebinding.yaml

{{ if .Values.ui.ssl.enabled }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
  name: {{ template "fullname_letsencrypt" . }}-rolebinding
  labels:
    app: "{{ .Chart.Name }}"
    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ template "fullname_letsencrypt" . }}-role
subjects:
- kind: ServiceAccount
  name: {{ template "fullname_letsencrypt" . }}-sa
{{- end -}}

I wasn't able to find a solution. We initially considered this to allow developers access to a central K8s cluster, but we are now using Teleport for this purpose, which also has an Oauth access flow.

@natcohen
Copy link

Thank you so much, that is extremely helpful!

@natcohen
Copy link

@fredsted Sorry to bother but how did you integrate those files into the current project? Do I have to add them into the letsencrypt jobs-pre-install file? If yes, how? Thanks again

@fredsted
Copy link
Author

@natcohen I basically copied all the files from the chart on this repo and made my own helm chart with the changes :)

@natcohen
Copy link

@fredsted I did the same but the problem is I don't know where to add these two files into the deployment process... Adding them to the chart doesn't seem to work.

@fredsted
Copy link
Author

Did you set the value .Values.ui.ssl.enabled?

@natcohen
Copy link

yes I did...

@natcohen
Copy link

I created the two files and added them into the same folder and rebuilt the package. But it seems that it's not deploying the RBAC files on pre-install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants