-
Notifications
You must be signed in to change notification settings - Fork 704
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
Missing annotations & labels #92
Comments
is this intended behaviour? |
No, it's another thing that got lost in the 0.6.0 change to per-key encryption. If you use 0.5.x kubeseal (perhaps even with a 0.6 controller), then you should have annotations+labels preserved. I think the desired semantics with per-key encryption, is that the labels+annotations will end up in plaintext (no encryption), and in a new |
@anguslees yes, that will be perfect, labels/annotations should not keep any sensible data. In other hand, "another thing that got lost in the 0.6.0 change" I am worried to use kubeseal in production if there is risk of accidentally loosing features like this from one stable version to the next. |
@anguslees we'd be happy to fix this. I can't see much difference between combined encryption and per-key in the PR for that. I went through and didn't spot much about the labels/annotations from the original import so probably missed something. If you could point us in the right direction we can submit a PR. |
(Fwiw, the "other thing" was the Secret.Type value - ie: secrets of types other than "Opaque") I'm afraid I can't give a useful response to non-specific future concerns. As with everything else, a conservative deployment involves qualifying new releases of your infrastructure against your requirements. If you can't/don't want to do that, then you can also just stick with a fixed (unchanging) version. Again, as with everything else, the safest option for continuing upgrades is to become actively involved in upstream development and ensure that your particular use case is well represented in tests and design discussions. In this case, any existing SealedSecrets created using older versions of sealed-secrets continue to work just fine (with metadata labels, etc) on the new 0.6.0 sealed-secrets controller. It's "just" SealedSecrets created with the 0.6.0 |
@c-knowles thanks for the offer. I think I've got most of this implemented already, however (see below).
The following line in the "backwards compatibility" branch means we initialise the full v1.Secret object from the encrypted blob, potentially including metadata and secret.type. In the "per-key" branch, we start with an uninitialised (default) v1.Secret, and just set specific values. That's the cause. For the fix, we need somewhere to put the labels/metadata for the per-key case - and we don't want to just blindly copy them from the SealedSecret (since some annotations might be misinterpreted on the "wrong" object). I'm currently thinking of adding a "template" that encompasses everything except the actual secret.data: ie: // SecretTemplateSpec describes the structure a Secret should have when created
// from a template
type SecretTemplateSpec struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Used to facilitate programmatic handling of secret data.
// +optional
Type apiv1.SecretType `json:"type,omitempty" protobuf:"bytes,3,opt,name=type,casttype=SecretType"`
}
// SealedSecretSpec is the specification of a SealedSecret
type SealedSecretSpec struct {
// Template defines the structure of the Secret that will be
// created from this sealed secret.
// +optional
Template SecretTemplateSpec `json:"template,omitempty"`
// Data is deprecated and will be removed eventually. Use per-value EncryptedData instead.
Data []byte `json:"data,omitempty"`
EncryptedData map[string][]byte `json:"encryptedData"`
} Note I've also moved the @c-knowles (or others) does that look reasonable? Can you see a better / more-obvious way to encode the extra "non-secret" parts of the Secret? |
@anguslees That makes sense and yes we should add more tests, if you want some help with adding more let us know. The template way seems good, a bit like the CC @sullerandras. |
thanks for the work! |
None yet. It will take a few weeks, since I haven't finished writing the code referred to above (then tests, etc). Note again that in the meantime you can use |
Is this the same issue as "when I create a new sealed secret with labels, the resulting secret does not contain any labels" ? Basically our sealedsecrets template looks like this in helm:
I am trying to search with I'll create a new issue if not related to this issue (#92). |
@mrballcb yes, same issue with same solution (use older |
What do you mean by annotations being misinterpreted on the "wrong" object? Can you give an example? |
One (poor) implementation might be to just copy the annotations from SealedSecret to the Secret we're creating. The downsides of this are that the annotations might mean something on the SealedSecret that doesn't make sense on the Secret, eg: the kubectl.kubernetes.io/last-applied-configuration used by This is why all the core resources have a "template.metadata" that gets used to create the derived object's metadata - and not just copying the top-level metadata over. |
This change adds a `spec.template` to the SealedSecrets schema, which includes `metadata` and `type` used when constructing the new Secret. (All the Secret fields _other_ than `data`/`encryptedData`) Also this change adds: - Events to the SealedSecret describing progress/errors while unsealing. - A SealedSecret `status` structure that exposes overall success/failure. Fixes bitnami-labs#92 Fixes bitnami-labs#72
This change adds a `spec.template` to the SealedSecrets schema, which includes `metadata` and `type` used when constructing the new Secret. (All the Secret fields _other_ than `data`/`encryptedData`) Also this change adds: - Events to the SealedSecret describing progress/errors while unsealing. - A SealedSecret `status` structure that exposes overall success/failure. Fixes bitnami-labs#92 Fixes bitnami-labs#72
This change adds a `spec.template` to the SealedSecrets schema, which includes `metadata` and `type` used when constructing the new Secret. (All the Secret fields _other_ than `data`/`encryptedData`) Also this change adds: - Events to the SealedSecret describing progress/errors while unsealing. - A SealedSecret `status` structure that exposes overall success/failure. Fixes bitnami-labs#92 Fixes bitnami-labs#72
135: Add a note about the secret type bug r=anguslees a=johnraz I just got bitten by the bug in #86 and #92 and lost quite a bit of time finding out what was happening. This will hopefully help other people figure it out faster until the proper fix is released. Co-authored-by: Jonathan Liuti <[email protected]>
This change adds a `spec.template` to the SealedSecrets schema, which includes `metadata` and `type` used when constructing the new Secret. (All the Secret fields _other_ than `data`/`encryptedData`) Also this change adds: - Events to the SealedSecret describing progress/errors while unsealing. - A SealedSecret `status` structure that exposes overall success/failure. Fixes bitnami-labs#92 Fixes bitnami-labs#72
any progress? |
This would be really good to fix please.. its a blocker to stop using a tool like |
Our team is also facing issues because of this bug. Do you need any help with this fix @anguslees? |
@DewaldDeJager, @chrisharm made some progress in #170; it's right next in my review queue |
This change adds a `spec.template` to the SealedSecrets schema, which includes `metadata` and `type` used when constructing the new Secret. (All the Secret fields _other_ than `data`/`encryptedData`) Also this change adds: - Events to the SealedSecret describing progress/errors while unsealing. - A SealedSecret `status` structure that exposes overall success/failure. Fixes #92 Fixes #72
This change adds a `spec.template` to the SealedSecrets schema, which includes `metadata` and `type` used when constructing the new Secret. (All the Secret fields _other_ than `data`/`encryptedData`) Also this change adds: - Events to the SealedSecret describing progress/errors while unsealing. - A SealedSecret `status` structure that exposes overall success/failure. Fixes #92 Fixes #72
This change adds a `spec.template` to the SealedSecrets schema, which includes `metadata` and `type` used when constructing the new Secret. (All the Secret fields _other_ than `data`/`encryptedData`) Also this change adds: - Events to the SealedSecret describing progress/errors while unsealing. - A SealedSecret `status` structure that exposes overall success/failure. Fixes #92 Fixes #72
This change adds a `spec.template` to the SealedSecrets schema, which includes `metadata` and `type` used when constructing the new Secret. (All the Secret fields _other_ than `data`/`encryptedData`) Also this change adds: - Events to the SealedSecret describing progress/errors while unsealing. - A SealedSecret `status` structure that exposes overall success/failure. Fixes #92 Fixes #72
This change adds a `spec.template` to the SealedSecrets schema, which includes `metadata` and `type` used when constructing the new Secret. (All the Secret fields _other_ than `data`/`encryptedData`) Also this change adds: - Events to the SealedSecret describing progress/errors while unsealing. - A SealedSecret `status` structure that exposes overall success/failure. Fixes #92 Fixes #72
180: Add SealedSecret 'template' to use when constructing Secret r=atomatt a=mkmik Merge #129 into current codebase (which as diverged in the meantime) ``` This change adds a spec.template to the SealedSecrets schema, which includes metadata and type used when constructing the new Secret. (All the Secret fields other than data/encryptedData) Also this change adds: Events to the SealedSecret describing progress/errors while unsealing. A SealedSecret status structure that exposes overall success/failure. ``` Fixes #92 Fixes #72 Co-authored-by: Angus Lees <[email protected]> Co-authored-by: Marko Mikulicic <[email protected]> Co-authored-by: Christopher Harm <[email protected]>
When creating a new sealed-secret based on a existing secret.yaml labels and annotations are lost.
This is very important, as some labels and annotations are related to helm lifecycle.
The text was updated successfully, but these errors were encountered: