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

open() "/etc/ingress-controller/auth/monitoring-dashboard.passwd" failed (13: Permission denied) #210

Closed
webwurst opened this issue Feb 2, 2017 · 11 comments
Assignees

Comments

@webwurst
Copy link
Contributor

webwurst commented Feb 2, 2017

I am testing kubeadm/nginx-ingress-controller.yaml with gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.1.

Using annotations to configure basic-auth seems to be broken:

  annotations:
    ingress.kubernetes.io/auth-secret: dashboard-basic-auth
    ingress.kubernetes.io/auth-type: basic

The following error shows up:

2017/02/02 15:06:10 [crit] 4082#4082: *57727 open() "/etc/ingress-controller/auth/monitoring-dashboard.passwd" failed (13: Permission denied), client: 127.0.0.1, server: dashboard.kube.codeformuenster.org, request: "GET / HTTP/2.0", host: "dashboard.kube.codeformuenster.org"
127.0.0.1 - [127.0.0.1] - admin [02/Feb/2017:15:06:10 +0000] "GET / HTTP/2.0" 500 706 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36" 254 0.000 [monitoring-dashboard-9090] - - - -

Here the access rights for that specific file:

root@5f40511e-8ca2-4968-95b5-aabcb56b15cd:/# ls -ld /etc
drwxr-x--- 1 root root 4096 Feb  1 23:58 /etc
root@5f40511e-8ca2-4968-95b5-aabcb56b15cd:/# ls -ld /etc/ingress-controller 
drw-r-xr-x 3 root root 4096 Feb  1 23:58 /etc/ingress-controller
root@5f40511e-8ca2-4968-95b5-aabcb56b15cd:/# ls -ld /etc/ingress-controller/auth 
drw-r-xr-x 2 root root 4096 Feb  2 00:09 /etc/ingress-controller/auth
root@5f40511e-8ca2-4968-95b5-aabcb56b15cd:/# ls -l /etc/ingress-controller/auth/monitoring-dashboard.passwd  
-rwxr-xr-x 1 root root 44 Feb  2 15:07 /etc/ingress-controller/auth/monitoring-dashboard.passwd

When setting chmod o+rx /etc this works fine. But not sure if this is a proper fix..

@bprashanth
Copy link
Contributor

Slightly OT, but please add an example for this in: https://github.com/kubernetes/ingress/tree/master/examples if you have the time.

I'll need to debug to give more meaningful help, maybe @aledbf knows off the top of his head

@aledbf aledbf self-assigned this Feb 2, 2017
@aledbf
Copy link
Member

aledbf commented Feb 3, 2017

@webwurst are you mounting the /etc directory? (I cannot reproduce this error)

@webwurst
Copy link
Contributor Author

webwurst commented Feb 3, 2017

I am using this configuration https://github.com/codeformuenster/kubernetes-deployment/blob/master/manifests/ingress/daemonset.yaml which is the same as the kubeadm example from this repo, except of the labeling. No mounting. I just restarted the Pods and verified that there is the permission error. chmod fixed it again. I just checked the docker images and there is something different: 🎉

$ docker run -ti gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.1 bash -c "ls -ld /etc"
drwxr-x--- 1 root root 4096 Feb  3 11:01 /etc
$ docker run -ti gcr.io/google_containers/nginx-ingress-controller:0.8.3 bash -c "ls -ld /etc"
drwxr-xr-x 1 root root 4096 Feb  3 11:01 /etc

@pstadler
Copy link

I can confirm that 0.9.0-beta.1 is currently broken, whereas basic auth with 0.8.3 works well.

In both cases I used the following template to create the ingress controller: https://github.com/kubernetes/ingress/blob/3a37607138e3bbdb83dd393241d1fdd3a6232176/examples/deployment/nginx/kubeadm/nginx-ingress-controller.yaml

@andrewstuart
Copy link
Contributor

https://github.com/kubernetes/ingress/blob/master/core/pkg/ingress/annotations/auth/main.go#L62

Pretty sure this TODO needs to be completed. The /etc/ingress-controller has owner root:root and permissions 0750. The nginx user/worker user (nobody) cannot traverse to the auth directory.

@Hronom
Copy link

Hronom commented Feb 20, 2017

Hi guys, when this fix will be available in new images ?

@aledbf
Copy link
Member

aledbf commented Feb 20, 2017

@Hronom not yet. After this PR #303

@Hronom
Copy link

Hronom commented Feb 20, 2017

Thanks, am I understand correctly that I can use 0.8.3 without problems?

@evgf
Copy link

evgf commented Feb 22, 2017

@Hronom Yes, 0.8.3 works with the basic authentication without any issues.

@Hronom
Copy link

Hronom commented Feb 22, 2017

@evgf Yeah, already switched, thanks

@pstadler
Copy link

This seems to work well with the newly released 0.9.0-beta.2

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

7 participants