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

fix system internal encryption #1110

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/secret-delegation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ metadata:
app.kubernetes.io/version: devel
spec:
delegations:
- secretName: knative-serving-certs
- secretName: routing-serving-certs
targetNamespaces:
- "*"
7 changes: 6 additions & 1 deletion pkg/reconciler/contour/resources/httpproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ func MakeHTTPProxies(ctx context.Context, ing *v1alpha1.Ingress, serviceToProtoc
if cfg.Network != nil && cfg.Network.SystemInternalTLSEnabled() {
svc.UpstreamValidation = &v1.UpstreamValidation{
CACertificate: fmt.Sprintf("%s/%s", system.Namespace(), netcfg.ServingRoutingCertName),
SubjectName: certificates.LegacyFakeDnsName,
SubjectName: certificates.DataPlaneUserSAN(ing.Namespace),
SubjectNames: []string{
certificates.DataPlaneUserSAN(ing.Namespace),
certificates.DataPlaneRoutingSAN,
},
}
}

Expand Down Expand Up @@ -256,6 +260,7 @@ func MakeHTTPProxies(ctx context.Context, ing *v1alpha1.Ingress, serviceToProtoc
if rule.Visibility == v1alpha1.IngressVisibilityClusterLocal {
ai = true
}

routes = append(routes, v1.Route{
Conditions: conditions,
TimeoutPolicy: top,
Expand Down
38 changes: 31 additions & 7 deletions pkg/reconciler/contour/resources/httpproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,7 @@ func TestMakeProxies(t *testing.T) {
}
}

func TestMakeProxiesInternalEncryption(t *testing.T) {
func TestMakeProxiesSystemInternalEncryption(t *testing.T) {
tlsProto := InternalEncryptionProtocol
h2Proto := InternalEncryptionH2Protocol
serviceToProtocol := map[string]string{
Expand Down Expand Up @@ -1968,7 +1968,11 @@ func TestMakeProxiesInternalEncryption(t *testing.T) {
Protocol: &tlsProto,
UpstreamValidation: &v1.UpstreamValidation{
CACertificate: fmt.Sprintf("%s/%s", system.Namespace(), netcfg.ServingRoutingCertName),
SubjectName: "data-plane.knative.dev",
SubjectName: "kn-user-foo",
SubjectNames: []string{
"kn-user-foo",
"kn-routing",
},
},
Weight: 100,
RequestHeadersPolicy: &v1.HeadersPolicy{
Expand Down Expand Up @@ -2001,7 +2005,11 @@ func TestMakeProxiesInternalEncryption(t *testing.T) {
Protocol: &tlsProto,
UpstreamValidation: &v1.UpstreamValidation{
CACertificate: fmt.Sprintf("%s/%s", system.Namespace(), netcfg.ServingRoutingCertName),
SubjectName: "data-plane.knative.dev",
SubjectName: "kn-user-foo",
SubjectNames: []string{
"kn-user-foo",
"kn-routing",
},
},
Weight: 100,
RequestHeadersPolicy: &v1.HeadersPolicy{
Expand Down Expand Up @@ -2105,7 +2113,11 @@ func TestMakeProxiesInternalEncryption(t *testing.T) {
Protocol: &h2Proto,
UpstreamValidation: &v1.UpstreamValidation{
CACertificate: fmt.Sprintf("%s/%s", system.Namespace(), netcfg.ServingRoutingCertName),
SubjectName: "data-plane.knative.dev",
SubjectName: "kn-user-foo",
SubjectNames: []string{
"kn-user-foo",
"kn-routing",
},
},
Weight: 100,
RequestHeadersPolicy: &v1.HeadersPolicy{
Expand Down Expand Up @@ -2138,7 +2150,11 @@ func TestMakeProxiesInternalEncryption(t *testing.T) {
Protocol: &h2Proto,
UpstreamValidation: &v1.UpstreamValidation{
CACertificate: fmt.Sprintf("%s/%s", system.Namespace(), netcfg.ServingRoutingCertName),
SubjectName: "data-plane.knative.dev",
SubjectName: "kn-user-foo",
SubjectNames: []string{
"kn-user-foo",
"kn-routing",
},
},
Weight: 100,
RequestHeadersPolicy: &v1.HeadersPolicy{
Expand Down Expand Up @@ -2258,7 +2274,11 @@ func TestMakeProxiesInternalEncryption(t *testing.T) {
Protocol: &tlsProto,
UpstreamValidation: &v1.UpstreamValidation{
CACertificate: fmt.Sprintf("%s/%s", system.Namespace(), netcfg.ServingRoutingCertName),
SubjectName: "data-plane.knative.dev",
SubjectName: "kn-user-foo",
SubjectNames: []string{
"kn-user-foo",
"kn-routing",
},
},
Weight: 100,
RequestHeadersPolicy: &v1.HeadersPolicy{
Expand Down Expand Up @@ -2315,7 +2335,11 @@ func TestMakeProxiesInternalEncryption(t *testing.T) {
Protocol: &tlsProto,
UpstreamValidation: &v1.UpstreamValidation{
CACertificate: fmt.Sprintf("%s/%s", system.Namespace(), netcfg.ServingRoutingCertName),
SubjectName: "data-plane.knative.dev",
SubjectName: "kn-user-foo",
SubjectNames: []string{
"kn-user-foo",
"kn-routing",
},
},
Weight: 100,
RequestHeadersPolicy: &v1.HeadersPolicy{
Expand Down
Loading