Skip to content

Docs: Update documentation of auth-tls-match-cn annotation to add possible check on all DN fields #11842

Open
@hichem

Description

@hichem

Hi All,

I have just a small suggestion to improve/complete the documentation of auth-tls-match-cn annotation.

The doc mentions that the annotation is used to add a sanity check on the CN of the client certificate during an mTLS handshake.

However, the sanity check may also apply to other fields of the DN of the certificate like "OU" and this might be very handy when performing checks on a group of certificates based on "OU" (group of certificate belonging to an Organizational Unit) or other criteria.

So for example, the annotation may have the following value to accept only certificates whose DN contains "'OU=FOO,OU=BAR'"fields
nginx.ingress.kubernetes.io/auth-tls-match-cn: "'OU=FOO,OU=BAR'"

This type of check is already working, having tested it recently, and the code shows indeed that the condition applies the DN, not only CN:

if ( $ssl_client_s_dn !~ {{ $server.CertificateAuth.MatchCN }} ) {
    return 403 "client certificate unauthorized";
}

Refer to https://github.com/kubernetes/ingress-nginx/blob/main/rootfs/etc/nginx/template/nginx.tmpl#L1016

Would it be possible therefore to update the annotation documentation to add these possible checks?

Thanks,

/kind documentation
/remove-kind feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docskind/documentationCategorizes issue or PR as related to documentation.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.needs-prioritytriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions