Allow certificates to contain subjects with allowed external names
@NickLarsenNZ đang làm issue này rồi.
Từ ngày 20/8/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Overview
Currently, secret-operator can only sign/request certificates with IP/DNS names based on these scopes:
listener-volume(The external-name that is reported back by the Load Balancer controller[^1]).node(eg:10.0.0.1ornode-1.local.domain. If I understand correctly, this becomes obsolete sincelistener-volumescope)pod(STS) (eg:pod-0.app-service.app-namespace.svc.cluster.local)service(FQDN of the named service, eg:app-service.app-namespace.svc.cluster.local
Customers often want to use an external[^2] DNS name, and in many cases use external-dns to automatically create DNS records for Services/Ingress/Gateway resources.
Common environment setups
In many environments (both Cloud and On-Prem):
- The kubelet clusterDomain is not usable outside of the cluster (especially
when it is the default ofcluster.local), and - Customers often use names under a suffix separate from the kubelet
clusterDomain. Often this is a shorter name (eg:app.team.example.com
instead ofapp.app-service.app-namespace.cluster.domain). - DNS is often auto-configured using External DNS, which is configured in these
ways:- For Services, an annotation is place to map the DNS name to the Service
(NodePort, or LoadBalancer) IP. - For Ingress/Gateway, there are dedicated fields for specifying the DNS name.
- For Services, an annotation is place to map the DNS name to the Service
- Load balancers do TLS termination
- In the case of internet-facing load balancers, this can be used to hide the
subject names on the internal certificate which leak information such as the
Kubernetes namespace and clusterDomain.
- In the case of internet-facing load balancers, this can be used to hide the
In some cases, they can work around this by using a Load Balancer that does L5 (TLS termination) or L7 (HTTP proxying), however with SNI checks becoming more prevalent these methods are becoming less effective when the external name used is not in the certificate used by the application.
This issue is about allowing external names to be added to certificates and a suggested approach follows...
[^1]: Often, this is a dynamic (and not user-friendly) name and is not intended to be used directly, but rather be the value of the DNS CNAME record of the intended external name.
[^2]: Whether that is on the internet, or just within their organization - it is external to the Kubernetes cluster.
Suggested approach
- Extend the
SecretClassto allow a list of suffixes (and minDepth/maxDepth number of dots) for additional names that can be added to the certificate. - Extend
Listenerwith anexternalName(or externalNames?) field.- If the listener-volume scope is used, and the suffix is permitted (within the minDepth/maxDepth bounds), then secret-operator will add that as a subject to the certificate request.
- Extend
Listenerwith aserviceAnnotationsfield.- We could use this opportunity to consistently name the fields in
ListenerandListenerClass(either all fields to be passed to Service are prefixed withservice, or we put everything underServiceOverrides.
- We could use this opportunity to consistently name the fields in
[!IMPORTANT]
Question: If the externalName set on the listener is not permitted in the certificate (or minDepth/maxDepth are out of bounds), where should an error event go? It could go on the Listener, but the listener doesn't concern itself too much with TLS details.
Example config:
Have a SecretClass which allows signing names under certain additional suffixes.
apiVersion: secrets.stackable.tech/v1alpha1
kind: SecretClass
metadata:
name: org-pki
spec:
backend:
# Using autoTls as an example, but same applies for any supported backend
autoTls:
ca:
secret:
name: secret-provisioner-tls-ca
namespace: default
autoGenerate: true
maxCertificateLifetime: 15d
# 👇 New
allowedSuffixes: # maybe should be additionalSuffixes, since it is on top of existing names
- suffix: internal.example.com
maxDepth: 0 # allow anything under internal.example.com, eg: a.b.c.d.internal.example.com
# or
- suffix: internal.example.com
maxDepth: 1 # default, only allow one dot between the name and the suffix, eg: a.internal.example.com
# or
- suffix: internal.example.com
# Example: the organisation allows signing certs for $app.$team.internal.example.com
# by requiring two dots between the name and the suffix
# allow a.b.internal.example.com
# disallow a.internal.example.com
# disallow a.b.c.internal.example.com
minDepth: 2
maxDepth: 2
# alternatively we could define depth and make it mutually exclusive to minDepth/maxDepth
- suffix: internal.example.net
Have a ListenerClass ready for making public facing AWS NLBs with TLS termination
apiVersion: listeners.stackable.tech/v1alpha1
kind: ListenerClass
metadata:
name: aws-ec2-nlb-public
spec:
# I think it would make more sense to make a serviceOverrides key instead of prefixing some with "service" and missing it in others (eg: loadBalancerClass)
serviceType: LoadBalancer
# https://docs.aws.amazon.com/eks/latest/userguide/auto-configure-nlb.html#_sample_service
loadBalancerClass: eks.amazonaws.com/nlb
loadBalancerAllocateNodePorts: false
preferredAddressType: HostnameConservative
serviceExternalTrafficPolicy: Local
serviceAnotations:
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip # Forward directly through node to Pod IP instead of an L3 hop/NAT through the node.
service.beta.kubernetes.io/aws-load-balancer-attributes: >-
proxy_protocol_v2.enabled=true
Have a NifiCluster, specifying an externalName (to be used in the resultant Listener) and service annotations to enable TLS temination on the Load Balancer, and a hostname to be configured by External DNS.
apiVersion: nifi.stackable.tech/v1alpha1
kind: NifiCluster
metadata:
name: simple-nifi
spec:
clusterConfig:
tls:
serverSecretClass: org-pki
nodes:
roleConfig:
# I think this should be moved under listenerOverrides as className...
listenerClass: aws-nlb-tls
# 👇 New
listenerOverrides:
className: aws-nlb-tls # moved from roleConfig.listenerClass
externalName: app.internal.example.com
serviceAnnotations:
external-dns.alpha.kubernetes.io/hostname: app.internal.example.com
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:eu-central-1:123456789012:certificate/4e12c4fe-eed9-48db-98d8-820b6b50ace4
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "8443"
Based on the configurations above, the objects below should be created by the NiFi Operator:
# This is the Listener produced by NifiCluster
kind: Listener
metadata:
name: the-nifi-listener
spec:
className: aws-nlb-tls-public
# 👇 New
externalName: app.internal.example.com # this came from the NifiCluster overrides
# 👇 Not yet available, see (see: https://github.com/stackabletech/listener-operator/issues/331)
serviceAnnotations:
external-dns.alpha.kubernetes.io/hostname: app.internal.example.com
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:eu-central-1:123456789012:certificate/4e12c4fe-eed9-48db-98d8-820b6b50ace4
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "8443"
# This is the Pod produced by the Deployment produced by the NifiCluster
apiVersion: v1
kind: Pod
metadata:
name: nifi-0
spec:
volumes:
- name: tls
ephemeral:
volumeClaimTemplate:
metadata:
annotations:
secrets.stackable.tech/class: org-pki
secrets.stackable.tech/scope: pod,service=nifi,listener-volume=the-nifi-listener
Based on the configurations above, the object below should be created by the Listener Operator:
apiVersion: v1
kind: Service
metadata:
name: nifi-listener
annotations:
external-dns.alpha.kubernetes.io/hostname: app.internal.example.com
service.beta.kubernetes.io/aws-load-balancer-attributes: proxy_protocol_v2.enabled=true
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:eu-central-1:123456789012:certificate/4e12c4fe-eed9-48db-98d8-820b6b50ace4
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "8443"
spec:
type: LoadBalancer
loadBalancerClass: eks.amazonaws.com/nlb
loadBalancerAllocateNodePorts: false
externalTrafficPolicy: Local
ports: ...
- Ngôn ngữ chính
- Rust
- Star
- 13
- Fork
- 8
- Merge trung bình
- 18 giờ 48 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stackabletech/secret-operator
-
type/bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
stackabletech/secret-operator#754 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
stackabletech/secret-operator#753 · 1 bình luận ·
-
skip the PodListeners lookup when the served Pod is being deletedCó thể đã có người làm @soenkeliebau đã nhận 25 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
stackabletech/secret-operator#720 · 1 bình luận ·
-
customer-request type/bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
stackabletech/secret-operator#666 · 2 bình luận ·
-
Add missing Pod IPs to created certificatesCó thể làm lại được @Techassi đã nhận 222 ngày trước và không có pull request nào đang mở. Đang mở
stackabletech/secret-operator#620 · 2 bình luận · 1 người được giao ·
Tất cả issue của stackabletech/secret-operator
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
zcashlabs/thus-spoke-zakura#153 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app bug windows-os
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Improve sublime text syntaxĐang mởeditor good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
funnyboy-roks/inq#54 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pnpm/pnpm#16635 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Bedrock request metadata forwarding does not work for /embeddingsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug llm translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày