-
Notifications
You must be signed in to change notification settings - Fork 40.6k
Compressed pod log files default to 644 permissions #129787
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
Comments
/sig node |
In environments containers, where logs may need to be accessed by multiple users or processes (such as for debugging or operational monitoring), 0644 ensures the file is readable by any user on the same machine, while still ensuring that only the owner can modify the file. Other users that are part of the same group or have general access to the system can read the logs without modifying them. The above reason, i think 0600 is not given as permission because only owner will have rw permission even read permission is not given to group. |
sig-node CI meeting notes:
|
/assign |
Sorry for the delay in response. For my system I see the uncompressed logs as 0600, but once they go through compression they get assigned with 0644 - -rw-------. 1 root root 9446029 Jan 25 06:59 0.log |
/triage accepted |
/priority backlog |
What happened?
When the pod logs rotate and get compressed, the gzipped file defaults to the permissions of 644. With the directories set to 755 this allows the logs to be world readable at that point.
This appears to be where this issue is happening at - https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/logs/container_log_manager.go#L422
What did you expect to happen?
For the compressed logs to either inherit the original log file permissions (600) or for this file permission to be configurable in the kubelet configuration
How can we reproduce it (as minimally and precisely as possible)?
Generate logs & wait until they compress - https://kubernetes.io/docs/concepts/cluster-administration/logging/#basic-logging-in-kubernetes
Anything else we need to know?
No response
Kubernetes version
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: