rsadecrypt-template-v2-external-secret.yaml 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. {% raw %}
  2. apiVersion: external-secrets.io/v1
  3. kind: ExternalSecret
  4. metadata:
  5. name: rsa-decrypt-template-v2
  6. spec:
  7. # ...
  8. target:
  9. template:
  10. engineVersion: v2
  11. data:
  12. # Decrypt a binary ciphertext using a private key stored in a Kubernetes Secret.
  13. # rsaDecrypt("SCHEME", "HASH", ciphertext, privateKeyPEM) decrypts the ciphertext (binary).
  14. password: '{{ rsaDecrypt "RSA-OAEP" "SHA1" .password_encrypted_binary .privatekey }}'
  15. data:
  16. - secretKey: privatekey
  17. remoteRef:
  18. key: a-secretname-in-cluster
  19. property: privatekey
  20. sourceRef:
  21. storeRef:
  22. kind: SecretStore # or ClusterSecretStore
  23. name: kubernetes # name of the k8s provider
  24. - secretKey: password_encrypted_binary
  25. remoteRef:
  26. key: /credentials/password_encrypted_binary
  27. # If ciphertext is Base64 encoded, either decode in-template (b64dec) or use decodingStrategy: Base64
  28. # Example (decode here -> template receives binary):
  29. # - secretKey: password_encrypted_base64
  30. # remoteRef:
  31. # key: /credentials/password_encrypted_base64
  32. # decodingStrategy: Base64
  33. # ...
  34. {% endraw %}