Bug 1475137
| Summary: | Permission denied for secrets mounting as files | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Takayoshi Tanaka <tatanaka> |
| Component: | Node | Assignee: | Andrew McDermott <amcdermo> |
| Status: | CLOSED DUPLICATE | QA Contact: | DeShuai Ma <dma> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.6.0 | CC: | aos-bugs, erich, jokerman, jpazdziora, mmccomas, nschuetz, rhowe, sjenning, tkimura |
| Target Milestone: | --- | ||
| Target Release: | 3.6.z | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-09-08 18:38:25 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Takayoshi Tanaka
2017-07-26 07:17:51 UTC
volumeMounts:
- mountPath: /opt/test-secret.txt
name: volume-sekrit
subPath: somexml
- name: volume-sekrit
secret:
defaultMode: 420
secretName: sekrits
The root of this issue is that the right selinux context is not set for the target.
drwxrwsrwt. root 1000080000 system_u:object_r:svirt_sandbox_file_t:s0:c4,c9 default-token-r5bmh
drwxrwsrwt. root 1000080000 system_u:object_r:tmpfs_t:s0 volume-sekrit
lrwxrwxrwx. root root system_u:object_r:svirt_sandbox_file_t:s0:c4,c9 /var/lib/origin/openshift.local.volumes/pods/5972781e-7967-11e7-96bd-fa163eb9684a/volumes/kubernetes.io~secret/volume-sekrit/somexml -> ..data/somexml
-rw-r--r--. root 1000080000 system_u:object_r:tmpfs_t:s0 /var/lib/origin/openshift.local.volumes/pods/5972781e-7967-11e7-96bd-fa163eb9684a/volumes/kubernetes.io~secret/volume-sekrit/..data/somexml
If I mount the secret 2x one with out the subpath it works as a workaround.
Thinking its an error some where here in this code:
https://github.com/kubernetes/kubernetes/blob/release-1.5/pkg/kubelet/kubelet_pods.go#L117-L150
It looks like a bug. With the subpath specified, only the subpath symlink gets relabeled. The symlink target, actual content file won't be relabeled and access denied. reducing to medium since customer issue is closed and there are workarounds. Andrew, please take a look. Probably just want to recreate first, then run it down. Issue is with selinux labeling for secrets with using subPath. There is upstream issue https://github.com/openshift/origin/issues/15750 referencing this bugzilla which talks about upgrades. I wonder if the fact that the issue can be seen on one instance and not on another one of the same version (do I read it right?) is due to the fact that one instance was upgraded from older version and the other one was not. Looks like a dup of 1481617 *** This bug has been marked as a duplicate of bug 1481617 *** |