Code Monkey home page Code Monkey logo

Comments (5)

dwertent avatar dwertent commented on June 10, 2024 1

Thank you for reporting this.
@YiscahLevySilas1 can you please take a look?

from kubescape.

YiscahLevySilas1 avatar YiscahLevySilas1 commented on June 10, 2024

Hi @jankoh ,
AFAIU, the runAsNonRoot field affects the UID but not the GID, so even if runAsNonRoot is true it would still be best practice to define runAsGroup explicitly. From the k8s documentation:
runAsNonRoot (boolean): Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

I agree that our remediation does not reflect that, wdyt about the following suggestion?
Remediation
If your application does not need root privileges, make sure to define runAsNonRoot as true or explicitly set the runAsUser using ID 1000 or higher under the PodSecurityContext or container securityContext. In addition, set an explicit value for runAsGroup using ID 1000 or higher.

from kubescape.

jankoh avatar jankoh commented on June 10, 2024

@YiscahLevySilas1 I think that change whould make it clear what needs to be done to prevent the finding. Thank you! 😃

from kubescape.

YiscahLevySilas1 avatar YiscahLevySilas1 commented on June 10, 2024

Great - thanks for reporting, I'll update the remediation

from kubescape.

YiscahLevySilas1 avatar YiscahLevySilas1 commented on June 10, 2024

Resolved in regolibrary PR #585

from kubescape.

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.