Skip to content

Comments

Fix register a key using secret creationTimestamp instead of certificate validity timestamp#1681

Merged
alvneiayu merged 4 commits intobitnami-labs:mainfrom
sybernatus:patch-1
Mar 13, 2025
Merged

Fix register a key using secret creationTimestamp instead of certificate validity timestamp#1681
alvneiayu merged 4 commits intobitnami-labs:mainfrom
sybernatus:patch-1

Conversation

@sybernatus
Copy link
Contributor

Description of the change

Register a key and order it based on its secret creation timestamp instead of its cert starting validity (NotBefore attribute)

Benefits

In case we are bringing our own certificate, if the certificate is created before sealed secret installation but applied after the installation, still the latest certificate used will be the certificate installed by sealed secret during its initialization instead of the latest secret certificate created.

Possible drawbacks

Applicable issues

Additional information

…ate validity timestamp

Signed-off-by: Jérôme GARCIA <[email protected]>
@alvneiayu
Copy link
Collaborator

hi @sybernatus

First of all, thanks a lot for your PR.

This PR will change the way to order the certificates for all the people with Sealed Secrets deployed. This impact is really high if we include it as default.

I suggest to include it with a flag to configure what is the way that the users want to order the certificates. If we see in the future that everybody is using the flag, we can deprecated it and set it by default but I think that we need to be conservative here.
I though something like --order-by-creation-timestamp.

For this case, we need to include a test and documentation.

Thanks a lot

Álvaro

@github-actions
Copy link
Contributor

This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution.

@github-actions github-actions bot added the Stale label Feb 15, 2025
@sybernatus
Copy link
Contributor Author

I will try to include this flag in this pr

@sybernatus sybernatus marked this pull request as draft February 15, 2025 08:10
@sybernatus sybernatus marked this pull request as ready for review February 15, 2025 08:13
@github-actions github-actions bot removed the Stale label Feb 16, 2025
A flag has been added to be able to choose which key will be fetched for encrypting secret

Test add key order priority param to initKeyRegistry function

Signed-off-by: Sybernatus <[email protected]>
@sybernatus
Copy link
Contributor Author

sybernatus commented Mar 7, 2025

Up please 🙂
@alvneiayu @agarcia-oss

Copy link
Member

@agarcia-oss agarcia-oss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@alvneiayu alvneiayu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot for your incredible work @sybernatus

@alvneiayu alvneiayu merged commit 30c1d2d into bitnami-labs:main Mar 13, 2025
15 checks passed
@sybernatus sybernatus deleted the patch-1 branch March 14, 2025 07:43
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 31, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [bitnami-labs/sealed-secrets](https://github.com/bitnami-labs/sealed-secrets) | minor | `v0.28.0` -> `v0.29.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>bitnami-labs/sealed-secrets (bitnami-labs/sealed-secrets)</summary>

### [`v0.29.0`](https://github.com/bitnami-labs/sealed-secrets/blob/HEAD/RELEASE-NOTES.md#v0290)

[Compare Source](bitnami-labs/sealed-secrets@v0.28.0...v0.29.0)

-   Fix register a key using secret creationTimestamp instead of certificate validity timestamp ([#&#8203;1681](bitnami-labs/sealed-secrets#1681))
-   Bump to go1.23.7 ([#&#8203;1714](bitnami-labs/sealed-secrets#1714))
-   Update environment k8s version on CI ([#&#8203;1688](bitnami-labs/sealed-secrets#1688))
-   Update go tooling to 1.23.6 ([#&#8203;1686](bitnami-labs/sealed-secrets#1686))
-   Bump github.com/onsi/gomega from 1.36.2 to 1.36.3 ([#&#8203;1712](bitnami-labs/sealed-secrets#1712))
-   Bump github.com/onsi/ginkgo/v2 from 2.23.0 to 2.23.3 ([#&#8203;1711](bitnami-labs/sealed-secrets#1711))
-   Bump k8s.io/code-generator from 0.32.2 to 0.32.3 ([#&#8203;1708](bitnami-labs/sealed-secrets#1708))
-   Bump k8s.io/client-go from 0.32.2 to 0.32.3 ([#&#8203;1705](bitnami-labs/sealed-secrets#1705))
-   Bump golang.org/x/net from 0.35.0 to 0.36.0 in the go_modules group ([#&#8203;1702](bitnami-labs/sealed-secrets#1702))
-   Bump golang.org/x/crypto from 0.35.0 to 0.36.0 ([#&#8203;1699](bitnami-labs/sealed-secrets#1699))
-   Bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1 ([#&#8203;1699](bitnami-labs/sealed-secrets#1699))
-   Bump github.com/onsi/ginkgo/v2 from 2.22.2 to 2.23.0 ([#&#8203;1701](bitnami-labs/sealed-secrets#1701))
-   Bump github.com/prometheus/client_golang from 1.20.5 to 1.21.0 ([#&#8203;1695](bitnami-labs/sealed-secrets#1695))
-   Bump github.com/google/go-cmp from 0.6.0 to 0.7.0 ([#&#8203;1696](bitnami-labs/sealed-secrets#1696))
-   Bump golang.org/x/crypto from 0.33.0 to 0.35.0 ([#&#8203;1697](bitnami-labs/sealed-secrets#1697))
-   Bump k8s.io/client-go from 0.32.1 to 0.32.2 ([#&#8203;1691](bitnami-labs/sealed-secrets#1691))
-   Bump k8s.io/code-generator from 0.32.1 to 0.32.2 ([#&#8203;1693](bitnami-labs/sealed-secrets#1693))
-   Bump golang.org/x/crypto from 0.32.0 to 0.33.0 ([#&#8203;1685](bitnami-labs/sealed-secrets#1685))
-   Bump github.com/spf13/pflag from 1.0.5 to 1.0.6 ([#&#8203;1683](bitnami-labs/sealed-secrets#1683))
-   Bump k8s.io/client-go from 0.32.0 to 0.32.1 ([#&#8203;1678](bitnami-labs/sealed-secrets#1678))
-   Bump k8s.io/code-generator from 0.32.0 to 0.32.1 ([#&#8203;1677](bitnami-labs/sealed-secrets#1677))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMTguMSIsInVwZGF0ZWRJblZlciI6IjM5LjIxOC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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.

3 participants