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

Nginx Ingress annotation snippet related checks are not checking the correct configuration #6761

Open
tepentti opened this issue Oct 10, 2024 · 1 comment
Labels
checks Check additions or changes good first issue Good for newcomers

Comments

@tepentti
Copy link

tepentti commented Oct 10, 2024

There are 3 checks that are related to Nginx Ingress annotation snippets:

  • checkov/kubernetes/checks/resource/k8s/NginxIngressCVE202125742Alias.py
  • checkov/kubernetes/checks/resource/k8s/NginxIngressCVE202125742AllSnippets.py
  • checkov/kubernetes/checks/resource/k8s/NginxIngressCVE202125742Lua.py

However all of these only check if some annotation snippets are in place, not if the feature is actually disabled. It can be disabled with configuration allow-snippet-annotations which defaults to false:

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#allow-snippet-annotations

I suggest that those three checks are consolidated into one which fails if in the ConfigMap for Nginx Ingress that configuration is set to true.

@tepentti tepentti added the checks Check additions or changes label Oct 10, 2024
@bo156 bo156 added the good first issue Good for newcomers label Nov 11, 2024
@bo156
Copy link
Contributor

bo156 commented Nov 11, 2024

@tepentti thanks for the suggestion, the best way to keep all of our policies up to date (and add new ones) is using our community 💯 Please feel free to introduce a PR for this change (or anyone else which might want to contribute :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checks Check additions or changes good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants