Giter Site home page Giter Site logo

Comments (11)

fjogeleit avatar fjogeleit commented on June 20, 2024 1

I created kyverno/policies#348 which should resolve your issue and the Policy should no longer the Policy Reporter deployment.

from policy-reporter.

Dentrax avatar Dentrax commented on June 20, 2024

If i set automountServiceAccountToken: "false" in deployment, pod falling back to crash with the following error:

Error: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory

Any ideas how to make it run without setting it true?

from policy-reporter.

fjogeleit avatar fjogeleit commented on June 20, 2024

The SA is required to get permissions for accessing the K8s API. Thats because it is set to true. There is no really work around for it. Only possible solution could be to add a manual volume and volumeMount instead the automount feature.

from policy-reporter.

Dentrax avatar Dentrax commented on June 20, 2024

So it's something we can fix in the deployment manifests? I prefer to handle all that manual stuff in the helm side during installation.

Currently, it's unable to run this project with Kyverno's default policy enforcement, which decreases the UX a bit in the first place.

from policy-reporter.

fjogeleit avatar fjogeleit commented on June 20, 2024

But you will have the same problem with all tools that access the K8s API in some case, the Policy description also says that the intention is to prevent automount for pods that are not interacting with the K8s API.

Kubernetes automatically mounts ServiceAccount credentials in each Pod.
The ServiceAccount may be assigned roles allowing Pods to access API resources.
Blocking this ability is an extension of the least privilege best practice and should
be followed if Pods do not need to speak to the API server to function.
This policy ensures that mounting of these ServiceAccount tokens is blocked.

Because the SA secret name has a dynamic suffix like policy-reporter-token-vdt6m, the manual mount is not really an option because I don't know the secret name before it is created.

from policy-reporter.

fjogeleit avatar fjogeleit commented on June 20, 2024

You could add an exclude label and add this label to the policy-reporter pods and other K8s API related tools.

Would it make sense to add some kind of exclusion (e.g. label) to the Kyverno Policy directly @chipzoller @realshuting?

from policy-reporter.

chipzoller avatar chipzoller commented on June 20, 2024

Sure, should it exclude by name?

from policy-reporter.

fjogeleit avatar fjogeleit commented on June 20, 2024

If you want to add a policy-reporter specific exclude I would suggest the label app.kubernetes.io/part-of: policy-reporter. Its currently only added on the deployment but I can create a minor version which also add it on pod level. So we don't need multiple values for the different components.

from policy-reporter.

chipzoller avatar chipzoller commented on June 20, 2024

Glad to accept a PR to the policy if one is made.

from policy-reporter.

fjogeleit avatar fjogeleit commented on June 20, 2024

Thanks @chipzoller . I will open one

from policy-reporter.

fjogeleit avatar fjogeleit commented on June 20, 2024

The updated Policy has now an exclude filter for Policy Reporter (kyverno/policies#348) which should fix this issue.

from policy-reporter.

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.