kubernetes / ingress-nginx

Ingress-NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
16.95k stars 8.14k forks source link

Possibility to use ssl_client_fingerprint #9741

Open KosShutenko opened 1 year ago

KosShutenko commented 1 year ago

What happened:

I am trying to use "$ssl_client_fingerprint" variable in my configuration. I've added annotations for my ingress:

    nginx.ingress.kubernetes.io/auth-tls-verify-client: optional_no_ca
    nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream: "true"
    nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header X-SSL-Client-Fingerprint $ssl_client_fingerprint;

but it doesn't help.

What you expected to happen:

I want to see header X-SSL-Client-Fingerprint with client fingerprint hash.

NGINX Ingress controller version:

NGINX Ingress controller
  Release:       v1.5.1
  Build:         d003aae913cc25f375deb74f898c7f3c65c06f05
  Repository:    https://github.com/kubernetes/ingress-nginx
  nginx version: nginx/1.21.6

Kubernetes version: Server Version: v1.23.14-gke.1800

Also I've tried to use modSecurity with OWASP

I've found relevant issue but without any solution :(

How I can get ssl_client_fingerprint? Thank you for advices.

k8s-ci-robot commented 1 year ago

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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
longwuyuan commented 1 year ago

/remove-kind bug /kind feature /help

k8s-ci-robot commented 1 year ago

@longwuyuan: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to [this](https://github.com/kubernetes/ingress-nginx/issues/9741): >/remove-kind bug >/kind feature >/help Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
strongjz commented 1 year ago

Can you share what your nginx.conf looks like? I'm not sure that $ssl_client_fingerprint is getting used properly.

You can use the kubectl plugin https://kubernetes.github.io/ingress-nginx/kubectl-plugin/#conf

or

kubectl exec $INGRESS_POD -- cat /etc/nginx/nginx.conf

KosShutenko commented 1 year ago

Hello,

Our current nginx.conf looks like: nginx.conf.txt

I've removed part of servers sections, which not related to this test. I've added proxy_set_header X-SSL-Client-Fingerprint $ssl_client_fingerprint; for one server only.

github-actions[bot] commented 1 year ago

This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach #ingress-nginx-dev on Kubernetes Slack.

ryanotella commented 4 months ago

Did you add ssl_verify_client on;?