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

Stop secrets payload from ending in the MR and resolve it when used instead #253

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mad01
Copy link

@mad01 mad01 commented May 23, 2024

Description of your changes

Change Observer loop not resolve secret in start of loop but rather resolve the secret in the create/update/delete funcs
to not leak the secrets data in the the k8s MR object.
Fixes #223

Description of your changes

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

manual test locally to see that the secret is not leaking in to the MR using this manifests.
provider for testing have been started with --sanitize-secrets

---
apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
  name: secretpatch
spec:
  references:
  - patchesFrom:
      apiVersion: v1
      kind: Secret
      name: secretpatch
      namespace: crossplane-system
      fieldPath: data.sensitive
    toFieldPath: data.key-from-secret
  forProvider:
    manifest:
      apiVersion: v1
      kind: Secret
      metadata:
        namespace: default
      data: {}
  providerConfigRef:
    name: kubernetes-provider
---
apiVersion: v1
kind: Secret
metadata:
  name: secretpatch
  namespace: crossplane-system
type: Opaque
data:
  sensitive: cGFzc3dvcmQ=

and instead resolve one moretime for the secret just before use in
Create/Update/Delete funcs

Signed-off-by: Alexander Brandstedt <alexander.brandstedt@volvocars.com>
@mad01 mad01 marked this pull request as ready for review May 23, 2024 09:49
@mad01
Copy link
Author

mad01 commented May 23, 2024

I have looked at the test but could not see any clear way to add testing to confirm the new secrets logic

Signed-off-by: Alexander Brandstedt <alexander.brandstedt@volvocars.com>
@mad01 mad01 changed the title observer loop. This to stop secrets payload from ending in the MR Stop secrets payload from ending in the MR and resolve it when used instead May 24, 2024
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

Successfully merging this pull request may close these issues.

Enable Secret References to hide sensitive data
1 participant