Skip to content
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

[FEATURE_REQUEST] Question: How to disable privileged check for initcontainers #928

Open
bbkgh opened this issue Mar 15, 2025 · 1 comment

Comments

@bbkgh
Copy link

bbkgh commented Mar 15, 2025

Hi. I want to disable privileged check for initcontainers but containers must be checked by that. I there any solution for this? sth like:

customChecks:
  - name: privileged-containers-just-containers
    template: privileged
    scope:
      fieldSelector: "spec.containers"
@janisz
Copy link
Collaborator

janisz commented Mar 18, 2025

Maybe we should add option to choose if all containers or containers except init

return util.PerContainerCheck(func(container *v1.Container) []diagnostic.Diagnostic {

// PerNonInitContainerCheck returns a check that abstracts away some of the boilerplate of writing a check
// that applies to all non-init containers. The given function is passed each non-init container,
// and is allowed to return diagnostics if an error is found.
func PerNonInitContainerCheck(matchFunc func(container *v1.Container) []diagnostic.Diagnostic) check.Func {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants