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

Derive and pass workload secrets to initializer #788

Merged
merged 9 commits into from
Aug 19, 2024

Conversation

3u13r
Copy link
Member

@3u13r 3u13r commented Aug 5, 2024

  • create workload secret based on coodinator seed
  • pass to initializer and put in the shared mount (as with the tls-certs)

Previous work in the manifest: #785

Note: the openssl, service-mesh, and workload secret ci yaml seem repetitive.
Should we just combine the second to last the (the "just" step) with the last step (nix step) since we already have a just target for e2e tests? we'd only need to pass the undeploy flag.

@3u13r 3u13r added the breaking change A user-affecting breaking change label Aug 5, 2024
@3u13r 3u13r force-pushed the feat/coordinator/pass-workload-secret-to-initializer branch 2 times, most recently from e6340e7 to d2fec5b Compare August 5, 2024 14:08
Copy link

github-actions bot commented Aug 5, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-08-19 12:00 UTC

@3u13r 3u13r force-pushed the feat/coordinator/pass-workload-secret-to-initializer branch 3 times, most recently from 4341506 to 68662a9 Compare August 10, 2024 21:44
@3u13r 3u13r marked this pull request as ready for review August 10, 2024 21:52
@3u13r 3u13r requested a review from katexochen as a code owner August 10, 2024 21:52
@3u13r 3u13r requested a review from burgerdev August 11, 2024 13:17
.github/workflows/e2e_workloadsecret.yml Outdated Show resolved Hide resolved
Comment on lines 145 to 146
// SeedEngine is the seed engine used to derive secrets.
SeedEngine *seedengine.SeedEngine
Copy link
Contributor

Choose a reason for hiding this comment

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

The SeedEngine's lifecycle is simpler than the State's - from the consumer point of view, it is either present or absent, and if it's present it does not change again. So instead of tacking the seedengine to the channel, we could pass the getter to meshapi directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure but the meshapi (server) is created in the main.go and the seedengine is internal to the authority, since it's also initialized from there. So we need some form of channel either way, or is there something I'm missing?

Copy link
Contributor

Choose a reason for hiding this comment

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

we could pass the getter to meshapi directly

The meshapi needs to be configured with a seedengine getter, but that does not need to be part of the channel state is what I'm trying to say.

Copy link
Contributor

Choose a reason for hiding this comment

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

So, as stated above, I think I might be a bit more comfortable without the seedengine in the state, but also unsure whether it makes sense as a getter interface in the meshapi. If somebody else has more concrete opinions, shoot.

Copy link
Member Author

@3u13r 3u13r Aug 13, 2024

Choose a reason for hiding this comment

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

I tried to implement your suggestion in fee113c. I'll take any opinions on which one is better.

coordinator/internal/seedengine/seedengine.go Outdated Show resolved Hide resolved
coordinator/internal/seedengine/seedengine.go Outdated Show resolved Hide resolved
docs/docs/architecture/secrets.md Outdated Show resolved Hide resolved
docs/docs/architecture/secrets.md Show resolved Hide resolved
@@ -108,6 +108,7 @@ systemd
tardev
tarfs
Terraform
themself
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
themself

Copy link
Member

Choose a reason for hiding this comment

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

still there

initializer/main.go Outdated Show resolved Hide resolved
docs/docs/architecture/secrets.md Outdated Show resolved Hide resolved
docs/docs/deployment.md Outdated Show resolved Hide resolved
e2e/internal/kubeclient/deploy.go Outdated Show resolved Hide resolved
@3u13r 3u13r force-pushed the feat/coordinator/pass-workload-secret-to-initializer branch 2 times, most recently from 043687c to 2b800a5 Compare August 12, 2024 17:54
@3u13r 3u13r force-pushed the feat/coordinator/pass-workload-secret-to-initializer branch 3 times, most recently from f695e97 to 7ab7870 Compare August 12, 2024 21:30
initializer/main.go Outdated Show resolved Hide resolved
Comment on lines 145 to 146
// SeedEngine is the seed engine used to derive secrets.
SeedEngine *seedengine.SeedEngine
Copy link
Contributor

Choose a reason for hiding this comment

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

So, as stated above, I think I might be a bit more comfortable without the seedengine in the state, but also unsure whether it makes sense as a getter interface in the meshapi. If somebody else has more concrete opinions, shoot.

@3u13r 3u13r force-pushed the feat/coordinator/pass-workload-secret-to-initializer branch from 383c8a8 to fee113c Compare August 13, 2024 17:28
@3u13r
Copy link
Member Author

3u13r commented Aug 14, 2024

Note: I misclicked and re-requested Markus despite already having an approval.

coordinator/internal/seedengine/seedengine.go Show resolved Hide resolved
coordinator/internal/seedengine/seedengine.go Outdated Show resolved Hide resolved
@@ -108,6 +108,7 @@ systemd
tardev
tarfs
Terraform
themself
Copy link
Member

Choose a reason for hiding this comment

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

still there

e2e/workloadsecret/workloadsecret_test.go Show resolved Hide resolved
.github/workflows/e2e_kubernetes.yaml Show resolved Hide resolved
internal/constants/constants.go Show resolved Hide resolved
coordinator/meshapi.go Outdated Show resolved Hide resolved
3u13r added 2 commits August 16, 2024 14:06
DeriveWorkloadSecret takes a string an uses it as info parameter for a hkdf derivation using the seed
@3u13r 3u13r force-pushed the feat/coordinator/pass-workload-secret-to-initializer branch from fee113c to fb55114 Compare August 16, 2024 12:06
@3u13r 3u13r requested a review from katexochen August 16, 2024 12:08
@3u13r 3u13r merged commit a88660e into main Aug 19, 2024
12 checks passed
@3u13r 3u13r deleted the feat/coordinator/pass-workload-secret-to-initializer branch August 19, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change A user-affecting breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants