diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.in.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.in.yaml index 55baa156f00..f61fc1b98a6 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.in.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.in.yaml @@ -26,8 +26,8 @@ secrets: name: tls-secret-1 type: kubernetes.io/tls data: - tls.crt: Zm9vCg== - tls.key: YmFyCg== + tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWnZieTVpWVhJdVkyOXRNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDCkFRRUFuZEh6d21wS2NUSUViamhGZ2RXd1RSTjc1Y3A4b3VsWnhMMUdydlI2SXc3ejdqaTBSNFcvTm85bkdmOU0KWVAyQ1JqaXN6NTFtd3hTeGVCcm9jTGVBK21reGkxK2lEdk5kQytyU0x4MTN6RUxTQ25xYnVzUHM3bUdmSlpxOAo5TGhlbmx5bzQzaDVjYTZINUxqTXd1L1JHVWlGMzFYck5yaVlGQlB2RTJyQitkd24vTkVrUTRoOFJxcXlwcmtuCkYvcWM5Sk1ZQVlGRld1VkNwa0lFbmRYMUN5dlFOT2FkZmN2cmd6dDV2SmwwT2kxQWdyaU5hWGJFUEdudWY3STQKcXBCSEdVWE5lMVdsOVdlVklxS1g0T2FFWERWQzZGQzdHOHptZWVMVzFBa1lFVm5pcFg2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AvSXZBb1F3S0JnQjNaRWlRUWhvMVYrWjBTMlpiOG5KS0plMy9zMmxJTXFHM0ZkaS9RS3Q0eWViQWx6OGY5ClBZVXBzRmZEQTg5Z3grSU1nSm5sZVptdTk2ZnRXSjZmdmJSenllN216TG5zZU05TXZua1lHbGFGWmJRWnZubXMKN3ZoRmtzY3dHRlh4d21GMlBJZmU1Z3pNMDRBeVdjeTFIaVhLS2dNOXM3cGsxWUdyZGowZzdacmRBb0dCQUtLNApDR3MrbkRmMEZTMFJYOWFEWVJrRTdBNy9YUFhtSG5YMkRnU1h5N0Q4NTRPaWdTTWNoUmtPNTErbVNJejNQbllvCk41T1FXM2lHVVl1M1YvYmhnc0VSUzM1V2xmRk9BdDBzRUR5bjF5SVdXcDF5dG93d3BUNkVvUXVuZ2NYZjA5RjMKS1NROXowd3M4VmsvRWkvSFVXcU5LOWFXbU51cmFaT0ZqL2REK1ZkOUFvR0FMWFN3dEE3K043RDRkN0VEMURSRQpHTWdZNVd3OHFvdDZSdUNlNkpUY0FnU3B1MkhNU3JVY2dXclpiQnJZb09FUnVNQjFoMVJydk5ybU1qQlM0VW9FClgyZC8vbGhpOG1wL2VESWN3UDNRa2puanBJRFJWMFN1eWxrUkVaZURKZjVZb3R6eDdFdkJhbzFIbkQrWEg4eUIKVUtmWGJTaHZKVUdhRmgxT3Q1Y3JoM1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K httpRoutes: - apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml index c5b7e621f4b..fe62a8c3ce8 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace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3MrbkRmMEZTMFJYOWFEWVJrRTdBNy9YUFhtSG5YMkRnU1h5N0Q4NTRPaWdTTWNoUmtPNTErbVNJejNQbllvCk41T1FXM2lHVVl1M1YvYmhnc0VSUzM1V2xmRk9BdDBzRUR5bjF5SVdXcDF5dG93d3BUNkVvUXVuZ2NYZjA5RjMKS1NROXowd3M4VmsvRWkvSFVXcU5LOWFXbU51cmFaT0ZqL2REK1ZkOUFvR0FMWFN3dEE3K043RDRkN0VEMURSRQpHTWdZNVd3OHFvdDZSdUNlNkpUY0FnU3B1MkhNU3JVY2dXclpiQnJZb09FUnVNQjFoMVJydk5ybU1qQlM0VW9FClgyZC8vbGhpOG1wL2VESWN3UDNRa2puanBJRFJWMFN1eWxrUkVaZURKZjVZb3R6eDdFdkJhbzFIbkQrWEg4eUIKVUtmWGJTaHZKVUdhRmgxT3Q1Y3JoM1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K routes: - name: default-httproute-1-rule-0-match-0-* pathMatch: diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.in.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.in.yaml index bf254c658b1..6e1a5cdea95 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.in.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.in.yaml @@ -66,5 +66,5 @@ secrets: name: tls-secret-1 type: kubernetes.io/tls data: - tls.crt: Zm9vCg== - tls.key: YmFyCg== + tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWn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b09FUnVNQjFoMVJydk5ybU1qQlM0VW9FClgyZC8vbGhpOG1wL2VESWN3UDNRa2puanBJRFJWMFN1eWxrUkVaZURKZjVZb3R6eDdFdkJhbzFIbkQrWEg4eUIKVUtmWGJTaHZKVUdhRmgxT3Q1Y3JoM1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml index c296c33ca02..2594fb3d395 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml @@ -111,8 +111,8 @@ xdsIR: hostnames: - "foo.com" tls: - serverCertificate: Zm9vCg== - privateKey: YmFyCg== + serverCertificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWnZieTVpWVhJdVkyOXRNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDCkFRRUFuZEh6d21wS2NUSUViamhGZ2RXd1RSTjc1Y3A4b3VsWnhMMUdydlI2SXc3ejdqaTBSNFcvTm85bkdmOU0KWVAyQ1JqaXN6NTFtd3hTeGVCcm9jTGVBK21reGkxK2lEdk5kQytyU0x4MTN6RUxTQ25xYnVzUHM3bUdmSlpxOAo5TGhlbmx5bzQzaDVjYTZINUxqTXd1L1JHVWlGMzFYck5yaVlGQlB2RTJyQitkd24vTkVrUTRoOFJxcXlwcmtuCkYvcWM5Sk1ZQVlGR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RcE5CMzZFdkpKZFVteHdkU2MyWDhrOGcxMC85NVlLQkdWQWoKL3d0YVZYbE9WeEFvK0ZSelpZeFpyQ29uWWFSMHVwUzFybDRtenN4REhlZU9mUVZUTUgwUjdZN0pnbTA5dXQ4SwplanAvSXZBb1F3S0JnQjNaRWlRUWhvMVYrWjBTMlpiOG5KS0plMy9zMmxJTXFHM0ZkaS9RS3Q0eWViQWx6OGY5ClBZVXBzRmZEQTg5Z3grSU1nSm5sZVptdTk2ZnRXSjZmdmJSenllN216TG5zZU05TXZua1lHbGFGWmJRWnZubXMKN3ZoRmtzY3dHRlh4d21GMlBJZmU1Z3pNMDRBeVdjeTFIaVhLS2dNOXM3cGsxWUdyZGowZzdacmRBb0dCQUtLNApDR3MrbkRmMEZTMFJYOWFEWVJrRTdBNy9YUFhtSG5YMkRnU1h5N0Q4NTRPaWdTTWNoUmtPNTErbVNJejNQbllvCk41T1FXM2lHVVl1M1YvYmhnc0VSUzM1V2xmRk9BdDBzRUR5bjF5SVdXcDF5dG93d3BUNkVvUXVuZ2NYZjA5RjMKS1NROXowd3M4VmsvRWkvSFVXcU5LOWFXbU51cmFaT0ZqL2REK1ZkOUFvR0FMWFN3dEE3K043RDRkN0VEMURSRQpHTWdZNVd3OHFvdDZSdUNlNkpUY0FnU3B1MkhNU3JVY2dXclpiQnJZb09FUnVNQjFoMVJydk5ybU1qQlM0VW9FClgyZC8vbGhpOG1wL2VESWN3UDNRa2puanBJRFJWMFN1eWxrUkVaZURKZjVZb3R6eDdFdkJhbzFIbkQrWEg4eUIKVUtmWGJTaHZKVUdhRmgxT3Q1Y3JoM1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K routes: - name: default-httproute-1-rule-0-match-0-foo.com pathMatch: diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.in.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.in.yaml index 9d531fa0040..58feff7c6ed 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.in.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.in.yaml @@ -25,8 +25,8 @@ secrets: name: tls-secret-1 type: kubernetes.io/tls data: - tls.crt: Zm9vCg== - tls.key: YmFyCg== + tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWnZieTVpWVhJdVkyOXRNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDCkFRRUFuZEh6d21wS2NUSUViamhGZ2RXd1RSTjc1Y3A4b3VsWnhMMUdydlI2SXc3ejdqaTBSNFcvTm85bkdmOU0KWVAyQ1JqaXN6NTFtd3hTeGVCcm9jTGVBK21reGkxK2lEdk5kQytyU0x4MTN6RUxTQ25xYnVzUHM3bUdmSlpxOAo5TGhlbmx5bzQzaDVjYTZINUxqTXd1L1JHVWlGMzFYck5yaVlGQlB2RTJyQitkd24vTkVrUTRoOFJxcXlwcmtuCkYvcWM5Sk1ZQVlGRld1VkNwa0lFbmRYMUN5dlFOT2FkZmN2cmd6dDV2SmwwT2kxQWdyaU5hWGJFUEdudWY3STQKcXBCSEdVWE5lMVdsOVdlVklxS1g0T2FFWERWQzZGQzdHOHptZWVMVzFBa1lFVm5pcFg2b1NCK0JjL1NIVlZOaApzQkxSbXRuc3pmTnRUMlFyZCttcGt4ODBaUUlEQVFBQk1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQ1VKOElDCkJveUVqT3V3enBHYVJoR044QjRqT1B6aHVDT0V0ZDM3UzAybHUwN09IenlCdmJzVEd6S3dCZ0x5bVdmR2tINEI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GMlBJZmU1Z3pNMDRBeVdjeTFIaVhLS2dNOXM3cGsxWUdyZGowZzdacmRBb0dCQUtLNApDR3MrbkRmMEZTMFJYOWFEWVJrRTdBNy9YUFhtSG5YMkRnU1h5N0Q4NTRPaWdTTWNoUmtPNTErbVNJejNQbllvCk41T1FXM2lHVVl1M1YvYmhnc0VSUzM1V2xmRk9BdDBzRUR5bjF5SVdXcDF5dG93d3BUNkVvUXVuZ2NYZjA5RjMKS1NROXowd3M4VmsvRWkvSFVXcU5LOWFXbU51cmFaT0ZqL2REK1ZkOUFvR0FMWFN3dEE3K043RDRkN0VEMURSRQpHTWdZNVd3OHFvdDZSdUNlNkpUY0FnU3B1MkhNU3JVY2dXclpiQnJZb09FUnVNQjFoMVJydk5ybU1qQlM0VW9FClgyZC8vbGhpOG1wL2VESWN3UDNRa2puanBJRFJWMFN1eWxrUkVaZURKZjVZb3R6eDdFdkJhbzFIbkQrWEg4eUIKVUtmWGJTaHZKVUdhRmgxT3Q1Y3JoM1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K httpRoutes: - apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml index cbe5d347100..99ab2eb9aec 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml @@ -66,8 +66,8 @@ xdsIR: hostnames: - "*" tls: - serverCertificate: Zm9vCg== - privateKey: YmFyCg== + serverCertificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16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URSRQpHTWdZNVd3OHFvdDZSdUNlNkpUY0FnU3B1MkhNU3JVY2dXclpiQnJZb09FUnVNQjFoMVJydk5ybU1qQlM0VW9FClgyZC8vbGhpOG1wL2VESWN3UDNRa2puanBJRFJWMFN1eWxrUkVaZURKZjVZb3R6eDdFdkJhbzFIbkQrWEg4eUIKVUtmWGJTaHZKVUdhRmgxT3Q1Y3JoM1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K routes: - name: default-httproute-1-rule-0-match-0-* pathMatch: diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.in.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.in.yaml index fe57e8f0dbd..26afb769e00 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.in.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.in.yaml @@ -31,8 +31,8 @@ secrets: name: tls-secret-1 type: kubernetes.io/tls data: - tls.crt: Zm9vCg== - tls.key: YmFyCg== + tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWnZieTVpWVhJdVkyOXRNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDCkFRRUFuZEh6d21wS2NUSUViamhGZ2RXd1RSTjc1Y3A4b3VsWnhMMUdydlI2SXc3ejdqaTBSNFcvTm85bkdmOU0KWVAyQ1JqaXN6NTFtd3hTeGVCcm9jTGVBK21reGkxK2lEdk5kQytyU0x4MTN6RUxTQ25xYnVzUHM3b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--git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml index c5d5ea6b7ce..a8909655e95 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml @@ -95,8 +95,8 @@ xdsIR: hostnames: - "*" tls: - serverCertificate: Zm9vCg== - privateKey: YmFyCg== + serverCertificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWnZieTVpWVhJdVkyOXRNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDCkFRRUFuZEh6d21wS2NUSUViamhGZ2RXd1RSTjc1Y3A4b3VsWnhMMUdydlI2SXc3ejdqaTBSNFcvTm85bkdmOU0KWVAyQ1JqaXN6NTFtd3hTeGVCcm9jTGVBK21reGkxK2lEdk5kQytyU0x4MTN6RUxTQ25xYnVzUHM3bUdmSlpxOAo5TGhlbmx5bzQzaDVjYTZINUxqTXd1L1JHVWlGMzFYck5yaVlGQlB2RTJyQitkd24vTkVrUTRoOFJxcXlwcmtuCkYvcWM5Sk1ZQVlGRld1VkNwa0lFbmRYMUN5dlFOT2FkZmN2cmd6dDV2SmwwT2kxQWdyaU5hWGJFUEdudWY3STQKcXBCSEdVWE5lMVdsOVdlVklxS1g0T2FFWERWQzZGQzdHOHptZWVMVzFBa1lFVm5pcFg2b1NCK0JjL1NIVlZOaApzQkxSbXRuc3pmTnRUMl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iOG5KS0plMy9zMmxJTXFHM0ZkaS9RS3Q0eWViQWx6OGY5ClBZVXBzRmZEQTg5Z3grSU1nSm5sZVptdTk2ZnRXSjZmdmJSenllN216TG5zZU05TXZua1lHbGFGWmJRWnZubXMKN3ZoRmtzY3dHRlh4d21GMlBJZmU1Z3pNMDRBeVdjeTFIaVhLS2dNOXM3cGsxWUdyZGowZzdacmRBb0dCQUtLNApDR3MrbkRmMEZTMFJYOWFEWVJrRTdBNy9YUFhtSG5YMkRnU1h5N0Q4NTRPaWdTTWNoUmtPNTErbVNJejNQbllvCk41T1FXM2lHVVl1M1YvYmhnc0VSUzM1V2xmRk9BdDBzRUR5bjF5SVdXcDF5dG93d3BUNkVvUXVuZ2NYZjA5RjMKS1NROXowd3M4VmsvRWkvSFVXcU5LOWFXbU51cmFaT0ZqL2REK1ZkOUFvR0FMWFN3dEE3K043RDRkN0VEMURSRQpHTWdZNVd3OHFvdDZSdUNlNkpUY0FnU3B1MkhNU3JVY2dXclpiQnJZb09FUnVNQjFoMVJydk5ybU1qQlM0VW9FClgyZC8vbGhpOG1wL2VESWN3UDNRa2puanBJRFJWMFN1eWxrUkVaZURKZjVZb3R6eDdFdkJhbzFIbkQrWEg4eUIKVUtmWGJTaHZKVUdhRmgxT3Q1Y3JoM1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K routes: - name: default-httproute-1-rule-0-match-0-* pathMatch: diff --git a/internal/gatewayapi/testdata/tls/.gitignore b/internal/gatewayapi/testdata/tls/.gitignore new file mode 100644 index 00000000000..a813e7b2fd9 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/.gitignore @@ -0,0 +1,2 @@ +# allow test keys to be checked-in to test folder only +!*.key diff --git a/internal/gatewayapi/testdata/tls/ecdsa-p256-cert.pem b/internal/gatewayapi/testdata/tls/ecdsa-p256-cert.pem new file mode 100644 index 00000000000..494e899e3d2 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/ecdsa-p256-cert.pem @@ -0,0 +1,8 @@ +-----BEGIN CERTIFICATE----- +MIIBGzCBwgIJAI/x1sCD/IRkMAoGCCqGSM49BAMCMBYxFDASBgNVBAMMC2Zvby5i +YXIuY29tMB4XDTIzMDEwNTIxNTMyOVoXDTI0MDEwNTIxNTMyOVowFjEUMBIGA1UE +AwwLZm9vLmJhci5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQflW2tzOs8 +o66NTITfaHnpG6S27chdJWsjYJubHJAmOkXu/+TlKMxFS9xGkG+OAB02GFPhxPW7 +FqZLRh8JtbVdMAoGCCqGSM49BAMCA0gAMEUCIQDvZeSZAgUVWei3z4dHNLGthzbi +1DvtjtPzHXgTwY/vbgIgNJY+Mq4pxRg6+wyM8GTxs5TWy9fiyDhLPE9BxelK1J4= +-----END CERTIFICATE----- diff --git a/internal/gatewayapi/testdata/tls/ecdsa-p256.key b/internal/gatewayapi/testdata/tls/ecdsa-p256.key new file mode 100644 index 00000000000..857ab7b7080 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/ecdsa-p256.key @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEILDnvM3TJ3sGboDy1xOwjIZiTSVyfWUayaQ1qgkuGZpKoAoGCCqGSM49 +AwEHoUQDQgAEH5VtrczrPKOujUyE32h56Ruktu3IXSVrI2CbmxyQJjpF7v/k5SjM +RUvcRpBvjgAdNhhT4cT1uxamS0YfCbW1XQ== +-----END EC PRIVATE KEY----- diff --git a/internal/gatewayapi/testdata/tls/ecdsa-p384-cert.pem b/internal/gatewayapi/testdata/tls/ecdsa-p384-cert.pem new file mode 100644 index 00000000000..5ed4f7858d9 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/ecdsa-p384-cert.pem @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE----- +MIIBVzCB3wIJAI7PYBTYSCWbMAoGCCqGSM49BAMCMBYxFDASBgNVBAMMC2Zvby5i +YXIuY29tMB4XDTIzMDEwNTIxNTczMFoXDTI0MDEwNTIxNTczMFowFjEUMBIGA1UE +AwwLZm9vLmJhci5jb20wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATj+tPY8lWvrR9r +54SAa8cnBtIMFg/6Ij51GRAZ+WGQcemJRQ3nPBPrhsV9tjuMvUvLND+H6Btygn5U +22M3l78OZRFl4k3dpOwleeJNQPjlyw0cBtcpW2aYGOQTD2wqW7MwCgYIKoZIzj0E +AwIDZwAwZAIwWnPBWsKCs6eExDUW7KR/Fh60Ump3Raxn0ciaJaXFsSOCCPBfrt2c +ms8dgyESs1dCAjBrZiSpycdsDBMrMdhIhpKWGSXm3LeIxYDbc0+rYhzJd6dvcGXt +r6WRBeo5xynQYvw= +-----END CERTIFICATE----- diff --git a/internal/gatewayapi/testdata/tls/ecdsa-p384.key b/internal/gatewayapi/testdata/tls/ecdsa-p384.key new file mode 100644 index 00000000000..ea832b72dea --- /dev/null +++ b/internal/gatewayapi/testdata/tls/ecdsa-p384.key @@ -0,0 +1,6 @@ +-----BEGIN EC PRIVATE KEY----- +MIGkAgEBBDBLXL+q1XPabzsdhr9upqiVM40q0WQY016/fUI4Q3/X/GcrdxSMD+dD +BOGdvKdYo/6gBwYFK4EEACKhZANiAATj+tPY8lWvrR9r54SAa8cnBtIMFg/6Ij51 +GRAZ+WGQcemJRQ3nPBPrhsV9tjuMvUvLND+H6Btygn5U22M3l78OZRFl4k3dpOwl +eeJNQPjlyw0cBtcpW2aYGOQTD2wqW7M= +-----END EC PRIVATE KEY----- diff --git a/internal/gatewayapi/testdata/tls/invalid-key-type.key b/internal/gatewayapi/testdata/tls/invalid-key-type.key new file mode 100644 index 00000000000..5d5aa4d36eb --- /dev/null +++ b/internal/gatewayapi/testdata/tls/invalid-key-type.key @@ -0,0 +1,3 @@ +-----BEGIN FOO----- +SGVsbG8gd29ybGQK +-----END FOO----- diff --git a/internal/gatewayapi/testdata/tls/malformed-cert.pem b/internal/gatewayapi/testdata/tls/malformed-cert.pem new file mode 100644 index 00000000000..0c19932b1a4 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/malformed-cert.pem @@ -0,0 +1,3 @@ +-----BEGIN CERTIFICATE----- +SGVsbG8gd29ybGQK +-----END CERTIFICATE----- diff --git a/internal/gatewayapi/testdata/tls/malformed-ecdsa.key b/internal/gatewayapi/testdata/tls/malformed-ecdsa.key new file mode 100644 index 00000000000..e6cc48732f5 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/malformed-ecdsa.key @@ -0,0 +1,3 @@ +-----BEGIN EC PRIVATE KEY----- +SGVsbG8gd29ybGQK +-----END EC PRIVATE KEY----- diff --git a/internal/gatewayapi/testdata/tls/malformed-encoding.pem b/internal/gatewayapi/testdata/tls/malformed-encoding.pem new file mode 100644 index 00000000000..9a02198b438 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/malformed-encoding.pem @@ -0,0 +1 @@ +SGVsbG8gd29ybGQK diff --git a/internal/gatewayapi/testdata/tls/malformed-pkcs1.key b/internal/gatewayapi/testdata/tls/malformed-pkcs1.key new file mode 100644 index 00000000000..02ef0ad96f3 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/malformed-pkcs1.key @@ -0,0 +1,3 @@ +-----BEGIN RSA PRIVATE KEY----- +SGVsbG8gd29ybGQK +-----END RSA PRIVATE KEY----- diff --git a/internal/gatewayapi/testdata/tls/malformed-pkcs8.key b/internal/gatewayapi/testdata/tls/malformed-pkcs8.key new file mode 100644 index 00000000000..18d998a6e9f --- /dev/null +++ b/internal/gatewayapi/testdata/tls/malformed-pkcs8.key @@ -0,0 +1,3 @@ +-----BEGIN PRIVATE KEY----- +SGVsbG8gd29ybGQK +-----END PRIVATE KEY----- diff --git a/internal/gatewayapi/testdata/tls/rsa-cert.pem b/internal/gatewayapi/testdata/tls/rsa-cert.pem new file mode 100644 index 00000000000..3d50bf11d76 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/rsa-cert.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICqDCCAZACCQDEMgYYnQrCoDANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtm +b28uYmFyLmNvbTAeFw0yMzAxMDUxMzQzMjRaFw0yNDAxMDUxMzQzMjRaMBYxFDAS +BgNVBAMMC2Zvby5iYXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAndHzwmpKcTIEbjhFgdWwTRN75cp8oulZxL1GrvR6Iw7z7ji0R4W/No9nGf9M +YP2CRjisz51mwxSxeBrocLeA+mkxi1+iDvNdC+rSLx13zELSCnqbusPs7mGfJZq8 +9Lhenlyo43h5ca6H5LjMwu/RGUiF31XrNriYFBPvE2rB+dwn/NEkQ4h8Rqqyprkn +F/qc9JMYAYFFWuVCpkIEndX1CyvQNOadfcvrgzt5vJl0Oi1AgriNaXbEPGnuf7I4 +qpBHGUXNe1Wl9WeVIqKX4OaEXDVC6FC7G8zmeeLW1AkYEVnipX6oSB+Bc/SHVVNh +sBLRmtnszfNtT2Qrd+mpkx80ZQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCUJ8IC +BoyEjOuwzpGaRhGN8B4jOPzhuCOEtd37S02lu07OHzyBvbsTGzKwBgLymWfGkH4B +j7CLsp8FzNHKZuaBgpnZ9J6DLONwfWe2AYp7LdfOKVBUdMXQiOm7jJ9HhoCmvMN7 +bsjchWJoMwrFf+wdAKatz0qAPyhLye/FqmiVxkORZaw+T9mDZ+H49uASguJuNMyQ +V6EyX6gtgWq376HvaXMS/3hamYoVWXI5MxiPOYxnABkJB4SCgIRejbJfVaQtoQ4a +z02iULenDIIeQOYobKcMBXf1B4PAQmsehqVIbzsQCGi54VDrs6bZd/7Js1zCppgs +JiD5IqMjKWDwq7aK +-----END CERTIFICATE----- diff --git a/internal/gatewayapi/testdata/tls/rsa-pkcs1.key b/internal/gatewayapi/testdata/tls/rsa-pkcs1.key new file mode 100644 index 00000000000..ae6bd93b605 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/rsa-pkcs1.key @@ -0,0 +1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MQx3njn0FUzB9Ee2OyYJtPbrfCno6fyLwKEMCgYAd2RIkEIaNVfmdEtmW/JyS +iXt/7NpSDKhtxXYv0CreMnmwJc/H/T2FKbBXwwPPYMfiDICZ5XmZrven7Vien720 +c8nu5sy57HjPTL55GBpWhWW0Gb55rO74RZLHMBhV8cJhdjyH3uYMzNOAMlnMtR4l +yioDPbO6ZNWBq3Y9IO2a3QKBgQCiuAhrPpw39BUtEV/Wg2EZBOwO/1z15h519g4E +l8uw/OeDooEjHIUZDudfpkiM9z52KDeTkFt4hlGLt1f24YLBEUt+VpXxTgLdLBA8 +p9ciFlqdcraMMKU+hKELp4HF39PRdykkPc9MLPFZPxIvx1FqjSvWlpjbq2mThY/3 +Q/lXfQKBgC10sLQO/jew+HexA9Q0RBjIGOVsPKqLekbgnuiU3AIEqbthzEq1HIFq +2Wwa2KDhEbjAdYdUa7za5jIwUuFKBF9nf/5YYvJqf3gyHMD90JI546SA0VdErspZ +ERGXgyX+WKLc8exLwWqNR5w/lx/MgVCn120obyVBmhYdTreXK4d2 +-----END RSA PRIVATE KEY----- diff --git a/internal/gatewayapi/testdata/tls/rsa-pkcs8.key b/internal/gatewayapi/testdata/tls/rsa-pkcs8.key new file mode 100644 index 00000000000..cb2c0aec206 --- /dev/null +++ b/internal/gatewayapi/testdata/tls/rsa-pkcs8.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCd0fPCakpxMgRu +OEWB1bBNE3vlynyi6VnEvUau9HojDvPuOLRHhb82j2cZ/0xg/YJGOKzPnWbDFLF4 +Guhwt4D6aTGLX6IO810L6tIvHXfMQtIKepu6w+zuYZ8lmrz0uF6eXKjjeHlxrofk +uMzC79EZSIXfVes2uJgUE+8TasH53Cf80SRDiHxGqrKmuScX+pz0kxgBgUVa5UKm +QgSd1fULK9A05p19y+uDO3m8mXQ6LUCCuI1pdsQ8ae5/sjiqkEcZRc17VaX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sEDyn1yIWWp1ytowwpT6EoQungcXf09F3 +KSQ9z0ws8Vk/Ei/HUWqNK9aWmNuraZOFj/dD+Vd9AoGALXSwtA7+N7D4d7ED1DRE +GMgY5Ww8qot6RuCe6JTcAgSpu2HMSrUcgWrZbBrYoOERuMB1h1RrvNrmMjBS4UoE +X2d//lhi8mp/eDIcwP3QkjnjpIDRV0SuylkREZeDJf5Yotzx7EvBao1HnD+XH8yB +UKfXbShvJUGaFh1Ot5crh3Y= +-----END PRIVATE KEY----- diff --git a/internal/gatewayapi/tls.go b/internal/gatewayapi/tls.go new file mode 100644 index 00000000000..82d47740123 --- /dev/null +++ b/internal/gatewayapi/tls.go @@ -0,0 +1,62 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +package gatewayapi + +import ( + "crypto/x509" + "encoding/pem" + "fmt" + + corev1 "k8s.io/api/core/v1" +) + +// validateTLSSecretData ensures the cert and key provided in a secret +// is not malformed and can be properly parsed. +func validateTLSSecretData(secret *corev1.Secret) error { + + certData := secret.Data[corev1.TLSCertKey] + + certBlock, _ := pem.Decode(certData) + if certBlock == nil { + return fmt.Errorf("unable to decode pem data in %s", corev1.TLSCertKey) + } + + _, err := x509.ParseCertificate(certBlock.Bytes) + if err != nil { + return fmt.Errorf("unable to parse certificate in %s: %w", corev1.TLSCertKey, err) + } + + keyData := secret.Data[corev1.TLSPrivateKeyKey] + + keyBlock, _ := pem.Decode(keyData) + if keyBlock == nil { + return fmt.Errorf("unable to decode pem data in %s", corev1.TLSPrivateKeyKey) + } + + var parseErr error + + switch keyBlock.Type { + case "PRIVATE KEY": + _, err := x509.ParsePKCS8PrivateKey(keyBlock.Bytes) + if err != nil { + parseErr = fmt.Errorf("unable to parse PKCS8 formatted private key in %s", corev1.TLSPrivateKeyKey) + } + case "RSA PRIVATE KEY": + _, err := x509.ParsePKCS1PrivateKey(keyBlock.Bytes) + if err != nil { + parseErr = fmt.Errorf("unable to parse PKCS1 formatted private key in %s", corev1.TLSPrivateKeyKey) + } + case "EC PRIVATE KEY": + _, err := x509.ParseECPrivateKey(keyBlock.Bytes) + if err != nil { + parseErr = fmt.Errorf("unable to parse EC formatted private key in %s", corev1.TLSPrivateKeyKey) + } + default: + return fmt.Errorf("%s key format found in %s, supported formats are PKCS1, PKCS8 or EC", keyBlock.Type, corev1.TLSPrivateKeyKey) + } + + return parseErr +} diff --git a/internal/gatewayapi/tls_test.go b/internal/gatewayapi/tls_test.go new file mode 100644 index 00000000000..2fa7df093ae --- /dev/null +++ b/internal/gatewayapi/tls_test.go @@ -0,0 +1,151 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +package gatewayapi + +import ( + "errors" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" + corev1 "k8s.io/api/core/v1" +) + +// createTestSecret creates a K8s tls secret using testdata +// see for more info +func createTestSecret(t *testing.T, certFile, keyFile string) *corev1.Secret { + t.Helper() + + certData, err := os.ReadFile(filepath.Join("testdata", "tls", certFile)) + require.NoError(t, err) + + keyData, err := os.ReadFile(filepath.Join("testdata", "tls", keyFile)) + require.NoError(t, err) + + return &corev1.Secret{ + Type: corev1.SecretTypeTLS, + Data: map[string][]byte{ + corev1.TLSCertKey: certData, + corev1.TLSPrivateKeyKey: keyData, + }, + } +} + +/* +TestValidateTLSSecretData ensures that we can properly validate the contents of a K8s tls secret. +The test assumes the secret is valid and was able to be applied to a cluster. + +The following commands were used to generate test key/cert pairs +using openssl (LibreSSL 3.3.6) + +# RSA + + openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout rsa-pkcs8.key -out rsa-cert.pem -subj "/CN=foo.bar.com"` + openssl rsa -in rsa-pkcs8.key -out rsa-pkcs1.key + +# ECDSA-p256 + + openssl ecparam -name prime256v1 -genkey -noout -out ecdsa-p256.key + openssl req -new -x509 -days 365 -key ecdsa-p256.key -out ecdsa-p256-cert.pem -subj "/CN=foo.bar.com" + +# ECDSA-p384 + + openssl ecparam -name secp384r1 -genkey -noout -out ecdsa-p384.key + openssl req -new -x509 -days 365 -key ecdsa-p384.key -out ecdsa-p384-cert.pem -subj "/CN=foo.bar.com" +*/ +func TestValidateTLSSecretData(t *testing.T) { + type testCase struct { + Name string + CertFile string + KeyFile string + ExpectedErr error + } + + testCases := []testCase{ + { + Name: "valid-rsa-pkcs1", + CertFile: "rsa-cert.pem", + KeyFile: "rsa-pkcs1.key", + ExpectedErr: nil, + }, + { + Name: "valid-rsa-pkcs8", + CertFile: "rsa-cert.pem", + KeyFile: "rsa-pkcs8.key", + ExpectedErr: nil, + }, + { + Name: "valid-ecdsa-p256", + CertFile: "ecdsa-p256-cert.pem", + KeyFile: "ecdsa-p256.key", + ExpectedErr: nil, + }, + { + Name: "valid-ecdsa-p384", + CertFile: "ecdsa-p384-cert.pem", + KeyFile: "ecdsa-p384.key", + ExpectedErr: nil, + }, + { + Name: "malformed-cert-pem-encoding", + CertFile: "malformed-encoding.pem", + KeyFile: "rsa-pkcs8.key", + ExpectedErr: errors.New("unable to decode pem data in tls.crt"), + }, + { + Name: "malformed-key-pem-encoding", + CertFile: "rsa-cert.pem", + KeyFile: "malformed-encoding.pem", + ExpectedErr: errors.New("unable to decode pem data in tls.key"), + }, + { + Name: "malformed-cert", + CertFile: "malformed-cert.pem", + KeyFile: "rsa-pkcs8.key", + ExpectedErr: errors.New("unable to parse certificate in tls.crt: x509: malformed certificate"), + }, + { + Name: "malformed-pkcs8-key", + CertFile: "rsa-cert.pem", + KeyFile: "malformed-pkcs8.key", + ExpectedErr: errors.New("unable to parse PKCS8 formatted private key in tls.key"), + }, + { + Name: "malformed-pkcs1-key", + CertFile: "rsa-cert.pem", + KeyFile: "malformed-pkcs1.key", + ExpectedErr: errors.New("unable to parse PKCS1 formatted private key in tls.key"), + }, + { + Name: "malformed-ecdsa-key", + CertFile: "rsa-cert.pem", + KeyFile: "malformed-ecdsa.key", + ExpectedErr: errors.New("unable to parse EC formatted private key in tls.key"), + }, + { + Name: "invalid-key-type", + CertFile: "rsa-cert.pem", + KeyFile: "invalid-key-type.key", + ExpectedErr: errors.New("FOO key format found in tls.key, supported formats are PKCS1, PKCS8 or EC"), + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.Name, func(t *testing.T) { + secret := createTestSecret(t, tc.CertFile, tc.KeyFile) + require.NotNil(t, secret) + + err := validateTLSSecretData(secret) + if tc.ExpectedErr == nil { + require.NoError(t, err) + } else { + require.EqualError(t, err, tc.ExpectedErr.Error()) + } + }) + } +} diff --git a/internal/gatewayapi/validate.go b/internal/gatewayapi/validate.go index 0bfabb51fa8..8d9da7804a3 100644 --- a/internal/gatewayapi/validate.go +++ b/internal/gatewayapi/validate.go @@ -331,6 +331,17 @@ func (t *Translator) validateTLSConfiguration(listener *ListenerContext, resourc break } + err := validateTLSSecretData(secret) + if err != nil { + listener.SetCondition( + v1beta1.ListenerConditionResolvedRefs, + metav1.ConditionFalse, + v1beta1.ListenerReasonInvalidCertificateRef, + fmt.Sprintf("Secret %s/%s must contain valid %s and %s, %s.", listener.gateway.Namespace, certificateRef.Name, v1.TLSCertKey, v1.TLSPrivateKeyKey, err.Error()), + ) + break + } + listener.SetTLSSecret(secret) case v1beta1.TLSProtocolType: if listener.TLS == nil { diff --git a/test/conformance/conformance_test.go b/test/conformance/conformance_test.go index 8c572c1faca..23e45c23224 100644 --- a/test/conformance/conformance_test.go +++ b/test/conformance/conformance_test.go @@ -79,6 +79,7 @@ func TestGatewayAPIConformance(t *testing.T) { tests.GatewaySecretReferenceGrantSpecific, tests.GatewaySecretMissingReferenceGrant, tests.GatewaySecretInvalidReferenceGrant, + tests.GatewayInvalidTLSConfiguration, tests.HTTPRouteReferenceGrant, tests.HTTPRoutePartiallyInvalidViaInvalidReferenceGrant, }