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

Emissary fails to validate a private secret key #4134

Closed
alexgervais opened this issue Feb 23, 2022 · 1 comment
Closed

Emissary fails to validate a private secret key #4134

alexgervais opened this issue Feb 23, 2022 · 1 comment

Comments

@alexgervais
Copy link
Contributor

alexgervais commented Feb 23, 2022

Describe the bug
In an mTLS scenario, Emissary fails to validate (and discards) an otherwise valid TLS Secret Key:

2022-02-23 16:08:13 diagd 2.2.1 [P27TAEW] INFO: demo-prod-f72afbf7-ed13-4b17-b021-0c8999367e43-client.kubeception.1: <RichStatus BAD error='K8sSecret secret demo-prod-f72afbf7-ed13-4b17-b021-0c8999367e43-client.kubeception tls.key cannot be parsed as PKCS1 or PKCS8: x509: failed to parse private key (use ParseECPrivateKey instead for this key format)

To Reproduce
TBD

Expected behavior
Emissary should use the provided private TLS Key and pass it to Envoy to configure mTLS.

Versions (please complete the following information):

  • Emissary-ingress: 2.2.0, 2.2.1
  • Edge Stack: 2.2.0, 2.2.1

Additional context
Users of Emissary-ingress and Edge Stack 2.2.0+ using Hosts and TLSContexts with EC (Elliptic Curve) Private Keys are affected. TLS private keys PKCS1 and PKCS8 are supported.

Example rejected secret (the sample public key was deleted):

apiVersion: v1
data:
  tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJrRENDQVRlZ0F3SUJBZ0lJWEVoem4rSlJMd2t3Q2dZSUtvWkl6ajBFQXdJd0l6RWhNQjhHQTFVRUF3d1kKYXpOekxXTnNhV1Z1ZEMxallVQXhOalExTmpRek5URTVNQjRYRFRJeU1ESXlNekU1TVRFMU9Wb1hEVEl6TURJeQpNekU1TVRFMU9Wb3dNREVYTUJVR0ExVUVDaE1PYzNsemRHVnRPbTFoYzNSbGNuTXhGVEFUQmdOVkJBTVRESE41CmMzUmxiVHBoWkc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2dZSUtvWkl6ajBFQXdJRFNRQXdSZ0loQUt3Skd4cjFsOFdwaC80UitRazZGTkRNSmV4OUFFdHEKbGY2L3QreXpDYW01QWlFQWtKSnA0dEpnV0xIT3pyeklxVmxsd1AxWUQvcCt3K3N3YkZ4b0R6ZU4xRDg9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
  tls.key: LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSURackt5SExTZXlMUXJUWUswOXNFcm5HRTNhMkhRVEpqeEU3QUxrOXFISERvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFcFJHa2dycjY0TmlPSlR3bnFrYVBwMmlmcnkwK3hCeWhJQTJWV3JVTG9FbGoxNmQ3aE9JVwpRcnMyQXIrYWpXSStXK0tRUHEycFMySlFpa2k4aUQvOFB3PT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo=
kind: Secret
metadata:
  name: test-cluster-client
type: kubernetes.io/tls
@khussey
Copy link
Contributor

khussey commented Feb 25, 2022

This is fixed in Emissary-ingress 2.2.2, which is now available.

@khussey khussey closed this as completed Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants