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

Secret stringData Encoding #424

Closed
lb4368 opened this issue Dec 1, 2020 · 3 comments
Closed

Secret stringData Encoding #424

lb4368 opened this issue Dec 1, 2020 · 3 comments
Assignees
Labels
3-Container Relates to plugin related issues enhancement New feature or request priority/medium Default priority for items size m
Milestone

Comments

@lb4368
Copy link

lb4368 commented Dec 1, 2020

Problem description
We are using stringData as a human-friendly way to author Secret data, with the understanding that Kubernetes will change it into a b64-enc data (which it does).

However the kubectl library also adds a kubectl.kubernetes.io/last-applied-configuration annotation, which unfortunately includes the clear text secretData, which kind of defeats the point.

Is there some trick we can employ to change this behavior, or do we need to switch from stringData to data? The ReplacementTransformer has b64-enc capabilities that should make this easier to deal with than it was.

Some discussion here : kubernetes/kubernetes#23564 (comment)

Design Discussion here: https://hackmd.io/QiEksO4fRk-MnBjwBFaAkQ#Secret-stringData-amp-last-applied-configuration

Proposed change
Update/enhance/use the replacement transformer or another encoding transformer plugin to encode the data from stringData to data field prior to applying against kubernetes.

Potential impacts
Potential security or performance related impacts.

@lb4368 lb4368 added enhancement New feature or request triage Needs evaluation by project members labels Dec 1, 2020
@jezogwza jezogwza added this to the v2.0 milestone Dec 2, 2020
@jezogwza jezogwza added priority/medium Default priority for items and removed triage Needs evaluation by project members labels Dec 2, 2020
@eak13 eak13 added the 3-Container Relates to plugin related issues label Dec 8, 2020
@gtsteffaniak
Copy link

I'll take this one

@gtsteffaniak
Copy link

This has been a limitation of the stringData, which is intended for non-encoded data, per their website:

"The values for all keys in the data field have to be base64-encoded strings. If the conversion to base64 string is not desirable, you can choose to specify the stringData field instead" https://kubernetes.io/docs/concepts/configuration/secret/

So, the solution should be to start using data rather than stringData

@eak13 eak13 added the size m label Mar 3, 2021
@lb4368
Copy link
Author

lb4368 commented Mar 22, 2021

@gtsteffaniak Patchset here: https://review.opendev.org/c/airship/airshipctl/+/780317. Did you see comments in patchset?

@lb4368 lb4368 modified the milestones: v2.0, v2.1 Mar 29, 2021
@eak13 eak13 modified the milestones: v2.1, Future May 12, 2021
@lb4368 lb4368 modified the milestones: Future, v2.1 Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3-Container Relates to plugin related issues enhancement New feature or request priority/medium Default priority for items size m
Projects
None yet
Development

No branches or pull requests

4 participants