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

Annotation Validation is enabled even when --enable-annotation-validation=false #12668

Closed
atalakey4work opened this issue Jan 11, 2025 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@atalakey4work
Copy link

atalakey4work commented Jan 11, 2025

What happened:

In helm chart 4.12.0 release changes were made to the command line arguments passed to the ingress controller executable. One of these changes is related to the annotation validation command line argument "--enable-annotation-validation". Prior to release 4.12.0 when ".controller.enableAnnotationValidations" chart value was set to "false", the "--enable-annotation-validation" command line argument was not passed to the ingress controller executable. On release 4.12.0 when ".controller.enableAnnotationValidations" chart value is set to "false", "--enable-annotation-validation=false" command line argument is passed to the ingress controller executable. Unfortunately, this does not seem to disable the annotation validation feature as shown below:

Screenshot 2025-01-11 at 9 31 08 AM Screenshot 2025-01-11 at 9 54 03 AM Screenshot 2025-01-11 at 9 31 26 AM

What you expected to happen:

The annotation validation feature should be disabled when ".controller.enableAnnotationValidations" chart value is set to "false".

NGINX Ingress controller version (exec into the pod and run /nginx-ingress-controller --version):

v1.12.0

Kubernetes version (use kubectl version):

v1.30.5

How to reproduce this issue:

  1. Install Ingress Nginx Controller via helm chart:
    helm install ingress-nginx ingress-nginx/ingress-nginx --version 4.12.0 --set controller.enableAnnotationValidations=false --set controller.allowSnippetAnnotations=true
  2. Apply ingress custom resource with "nginx.ingress.kubernetes.io/server-snippet" annotation. Example ingress below:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/server-snippet: |-
      proxy_hide_header X-Powered-By;
spec:
  ingressClassName: nginx
  rules:
  - host: example.test
    http:
      paths:
      - backend:
          service:
            name: example
            port:
              number: 80
        path: /
        pathType: Prefix
@atalakey4work atalakey4work added the kind/bug Categorizes issue or PR as related to a bug. label Jan 11, 2025
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 11, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors 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-sigs/prow repository.

@Gacko
Copy link
Member

Gacko commented Jan 11, 2025

The warning you are facing is not about annotation validation, it is about annotation risk levels. The default annotation risk level got reduced to High in v1.12.0. Consider setting the annotation-risk-level ConfigMap value back to Critical.

@saiharshitach
Copy link

@Gacko quick question here
annotation-risk-level ConfigMap value to Critical
does this mean it will accept all the annotation risk levels without any errors.. even the ones with Critical risk mentioned here ? or it doesnt accept critical annotations

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations-risk/

lets say if we want to disable this completely and accept all annoataions even the config and server snippets.. Should we just disable the annotation validation to false ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Development

No branches or pull requests

4 participants