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

Add decoding Strategies to PushSecret #2956

Open
pkr4711 opened this issue Dec 15, 2023 · 1 comment
Open

Add decoding Strategies to PushSecret #2956

pkr4711 opened this issue Dec 15, 2023 · 1 comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@pkr4711
Copy link

pkr4711 commented Dec 15, 2023

Problem

When I use a PushSecret, the existing K8 secret is always base64 decoded and written to the vault in plain text.
I have some binary secrets that I need to store in base64-encoded in vault.

Possible solution

add decodingStrategy like in ExternalSecret to a PushSecret

---
apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
  name: pushsecret-example-binary
  namespace: example
spec:
  refreshInterval: 10s
  secretStoreRefs:
    - name: vault
      kind: SecretStore
  selector:
    secret:
      name: example-binary-cert
  data:
    - match:
        secretKey: ca.password
        decodingStrategy: Base64        # decode the k8 secret and store the result as plain text in vault
        remoteRef:
          remoteKey: example/cert
          property: ca.password
    - match:
        secretKey: ca.p12
        decodingStrategy: None          # don't decode the k8 secret and store the result base64 encoded in vault
        remoteRef:
          remoteKey: example/cert
          property: ca.p12
    - match:
        secretKey:  ca.crt
        decodingStrategy: Base64        # decode the k8 secret and store the result as plain text in vault
        remoteRef:
          remoteKey: example/cert
          property: ca.crt
@pkr4711 pkr4711 added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 15, 2023
@Skarlso
Copy link
Contributor

Skarlso commented Dec 18, 2023

Once #2926 lands, you'll have the ability to do templating for push secret. As I understand it, templating provides b64dec. So you should be able to use that I think 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants