Commit 371e27ed authored by Thong Kuah's avatar Thong Kuah

Merge branch 'patch-109' into 'master'

Update kubernetes.rb to read entire file

See merge request gitlab-org/gitlab!31254
parents 00ff4143 ad82eae2
......@@ -159,7 +159,16 @@ module Clusters
if ca_pem.present?
opts[:cert_store] = OpenSSL::X509::Store.new
opts[:cert_store].add_cert(OpenSSL::X509::Certificate.new(ca_pem))
file = Tempfile.new('cluster_ca_pem_temp')
begin
file.write(ca_pem)
file.rewind
opts[:cert_store].add_file(file.path)
ensure
file.close
file.unlink # deletes the temp file
end
end
opts
......
---
title: Fixed issue (#198424) that prevented k8s authentication with intermediate certificates
merge_request: 31254
author: Abdelrahman Mohamed
type: fixed
-----BEGIN CERTIFICATE-----
MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0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AEYwRAIgQ7gh393PInhYfPOhg/lF9yZNRdvjBeufFoG8
VnBuPNMCIBP8YGC83ig5ttw3ipSRjH0bKj4Ak5O4rynoql9Dy8x3AHYAVhQGmi/X
wuzT9eG9RLI+x0Z2ubyZEVzA75SYVdaJ0N0AAAFu0uQ7VgAABAMARzBFAiEAhzE7
1c48wn3s/30IB4WgxfpLburH0Ku8cchv8QeqcgACIBrWpUlDD18AOfkPCOcB2kWU
vRXsdptVm3jPeU5TtDSoAHUAu9nfvB+KcbWTlCOXqpJ7RzhXlQqrUugakJZkNo4e
0YUAAAFu0uQ60gAABAMARjBEAiBBpH5m7ntGKFTOFgSLcFXRDg66xJqerMy0gOHj
4TIBYAIgfFABPNy6P61hjiOWwjq73lvoEdAyh18GeFHIp0BgsWEwDQYJKoZIhvcN
AQELBQADggEBAInaSEqteyQA1zUKiXVqgffhHKZsUq9UnMows6X+UoFPoby9xqm6
IaY/77zaFZYwXJlP/SvrlbgTLHAdir3y38uhAlfPX4iRuwggOpFFF5hqDckzCm91
ocGnoG6sUY5mOqKu2vIcZkUQDe+K5gOxI6ME/4YwzWCIcTmBPQ6NQmqiFLPoQty1
gdbGCcLQNFCuNq4n5OK2NmBjcbtyT4gglat7C4+KV8RkEubZ+MkXzyDkpEXjjzsK
7iuNB0hRgyyhGzHrlZ/l0OLoT0Cb4I5PzzRSseFEyPKCC1WSF7aE9rFfUqhpqSAT
7NV7SEijYyFFtuZfz9RGglcqnRlAfgTy+tU=
-----END CERTIFICATE-----
......@@ -204,6 +204,52 @@ RSpec.describe Clusters::Platforms::Kubernetes do
end
it { is_expected.to be_an_instance_of(Gitlab::Kubernetes::KubeClient) }
context 'ca_pem is a single certificate' do
let(:ca_pem) { File.read(Rails.root.join('spec/fixtures/clusters/ca_certificate.pem')) }
let(:kubernetes) do
build(:cluster_platform_kubernetes,
:configured,
namespace: 'a-namespace',
cluster: cluster,
ca_pem: ca_pem)
end
it 'adds it to cert_store' do
cert = OpenSSL::X509::Certificate.new(ca_pem)
cert_store = kubernetes.kubeclient.kubeclient_options[:ssl_options][:cert_store]
expect(cert_store.verify(cert)).to be true
end
end
context 'ca_pem is a chain' do
let(:cert_chain) { File.read(Rails.root.join('spec/fixtures/clusters/chain_certificates.pem')) }
let(:kubernetes) do
build(:cluster_platform_kubernetes,
:configured,
namespace: 'a-namespace',
cluster: cluster,
ca_pem: cert_chain)
end
it 'includes chain of certificates' do
cert1_file = File.read(Rails.root.join('spec/fixtures/clusters/root_certificate.pem'))
cert1 = OpenSSL::X509::Certificate.new(cert1_file)
cert2_file = File.read(Rails.root.join('spec/fixtures/clusters/intermediate_certificate.pem'))
cert2 = OpenSSL::X509::Certificate.new(cert2_file)
cert3_file = File.read(Rails.root.join('spec/fixtures/clusters/ca_certificate.pem'))
cert3 = OpenSSL::X509::Certificate.new(cert3_file)
cert_store = kubernetes.kubeclient.kubeclient_options[:ssl_options][:cert_store]
expect(cert_store.verify(cert1)).to be true
expect(cert_store.verify(cert2)).to be true
expect(cert_store.verify(cert3)).to be true
end
end
end
describe '#rbac?' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment