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

Drop the verb update for the resource validatingwebhookconfigurations of the clusterRole 'ingress-nginx-admission' #10963

Closed
thejaswiniguduru opened this issue Feb 2, 2024 · 6 comments
Labels
kind/support Categorizes issue or PR as a support question. needs-priority triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@thejaswiniguduru
Copy link

I'm currently utilizing the Kubernetes Nginx Ingress Controller in Azure Kubernetes Service. In order to meet the security requirements, I need to drop the verb update for the resource validatingwebhookconfigurations of the clusterRole 'ingress-nginx-admission' for the ingress-nginx-admission-create, ingress-nginx-admission-patch pods.

As is setting:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/component: admission-webhook
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
app.kubernetes.io/version: 1.9.3
name: ingress-nginx-admission
rules:

  • apiGroups:
    • admissionregistration.k8s.io
      resources:
    • validatingwebhookconfigurations
      verbs:
    • get
    • update

To be setting:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/component: admission-webhook
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
app.kubernetes.io/version: 1.9.3
name: ingress-nginx-admission
rules:

  • apiGroups:
    • admissionregistration.k8s.io
      resources:
    • validatingwebhookconfigurations
      verbs:
    • get

Unfortunately, when I drop the verb "update", I encounter the following error:
W0130 13:35:20.945002 1 client_config.go:618] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
{"err":"secrets "ingress-nginx-admission" is forbidden: User "system:serviceaccount:ns-app-dp-ingress-comp-dev:ingress-nginx-admission" cannot get resource "secrets" in API group "" in the namespace "ns-app-dp-ingress-comp-dev": Azure does not have opinion for this user.","level":"fatal","msg":"error getting secret","source":"k8s/k8s.go:232","time":"2024-01-30T13:35:21Z"}

The following Kubernetes Ingress Controller Manifest file is used in my project.
https://github.com/kubernetes/ingress-nginx/blob/main/deploy/static/provider/baremetal/deploy.yaml

Kindly suggest on the above error at the earliest

@thejaswiniguduru thejaswiniguduru added the kind/bug Categorizes issue or PR as related to a bug. label Feb 2, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 2, 2024
@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/test-infra repository.

@strongjz
Copy link
Member

strongjz commented Feb 2, 2024

When the controller starts, there are several jobs that update/patch the admission controller. One is generating a certificate for the admission controller and placing it in a kubernetes secret. As you have noted, this will break if the controller can do this.

What is the concern you are trying to mitigate?

/triage needs-information

@k8s-ci-robot k8s-ci-robot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Feb 2, 2024
@strongjz strongjz removed the kind/bug Categorizes issue or PR as related to a bug. label Feb 2, 2024
@k8s-ci-robot k8s-ci-robot added the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Feb 2, 2024
@strongjz strongjz added kind/support Categorizes issue or PR as a support question. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 2, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Feb 2, 2024
@thejaswiniguduru
Copy link
Author

thejaswiniguduru commented Feb 20, 2024

Hi @strongjz ,

As you are asking for the concern to mitigate a security vulnerability has been raised as part of aquasec scan which i already explained in the issue description. Below is the link which explains better.
https://avd.aquasec.com/misconfig/kubernetes/general/avd-ksv-0114/

Kindly help me in knowing if anything else needs to be added. Looking forward to close this at the earliest.

@strongjz
Copy link
Member

This is the literally the job of our webhook to stop bad deployments of the nginx conf thru a misconfigured ingress object.

@thejaswiniguduru
Copy link
Author

Can you please elaborate on the above point which you mentioned.

@strongjz
Copy link
Member

This verb is needed for the webhook to do its job in validating an ingress object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. needs-priority triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
Development

No branches or pull requests

3 participants