GithubHelp home page GithubHelp logo

Set container logs to an "admin" GID other than root to make life easier for users and logging/o11y implementers about kubernetes HOT 4 OPEN

matthewmodestino avatar matthewmodestino commented on May 23, 2024
Set container logs to an "admin" GID other than root to make life easier for users and logging/o11y implementers

from kubernetes.

Comments (4)

k8s-ci-robot avatar k8s-ci-robot commented on May 23, 2024

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from kubernetes.

kannon92 avatar kannon92 commented on May 23, 2024

#124228

Related issue.

from kubernetes.

yong-jie-gong avatar yong-jie-gong commented on May 23, 2024

Still have customers adopting Kubernetes and having the discussion about why logging daemonsets need user 0.

By now, is there no adopted way to do what we'd do in nix days, and add the logging agents to a admin group that can access Kubelet logs on disk - /var/log/pods

Has this been documented and solved in the last few years? Would make a lot of folks lives easier!

Even a documented security profile that explains to k8s admins, devs and compliance departments, why theres all these tools trying to "run as root". Would definitely help ISVs as well!

Specifically talking about node level logging architectures: https://kubernetes.io/docs/concepts/cluster-administration/logging/

currently, raw logs(.log) under /var/logs/pods is generated by container runtime instead of kubelet. there is nothing kubelet can do. archive logs (.gz) is genrated by kubelet but is world-wide visible considerd as security issue. which logs do you refer to,?

# ls -rlt /var/log/pods/*/**/*
-rw-r-----. 1 root root /var/log/pods/kube-system_apiserver-demo1.test.com_712b37831be464ccc2fb1553ef89aa91/apiserver/66.log
-rw-r--r--. 1 root root /var/log/pods/kube-system_coredns-cfngt_8a5bacf2-063b-4ffc-b86a-237b94a07246/coredns/18.log.20240329-044703.gz

from kubernetes.

matthewmodestino avatar matthewmodestino commented on May 23, 2024

I am referring to /var/log/pods. I am not personally concerned about the world readable archives.

Most logging vendor agents only read the live raw log, and yes, I understand the container engine generates them, but in service of the kubelet. Kubelet already exposes container engine settings like rotation size (which are also super low defaults in production environments k8s runs in).

The only issue we have is they are owned as root, thus we have to mess with privileged security context and running as user 0.

Some setting between kubelet and container engine should set it to some acceptable admin group like, root:adm - just using adm as an example of an admin group - then us logging vendors and k8s admins won't need to go thru security friction every single time a new user adopts k8s and runs a logging daemonset.

Its way better than the hacky ways im seeing it done now. Logging vendors shouldnt have to step on these perms out of band, or be on the hook to explain why k8s and their chosen container engines are the way they are and to solve for this.

Otherwise this should be at very least covered in the logging architecure documentation. And perhaps with guidance on a locked down security profile that everyone can jump off from that allows read only to hostpath.

Discussions have happened at the container engine level around this in the past - for example -

containerd/cri#613

containerd/containerd#8920

Would like to see some k8s leadership on this.

from kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.