-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add metal
user and SSH Keypair during Discovery
boot
#219
base: main
Are you sure you want to change the base?
Conversation
This PR introduces a feature to create a `metal` user with corresponding SSH keypairs which are stored as a `Secret` alongside the discovery `ServerBootConfiguration`. The `Secret` is named `<serverbootconfig.name-ssh>`. This allows an administrator to use the private key in this `Secret` to SSH into the `Server` in case something went wrong when running the `metalprobe` agent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Should the secret be deleted when transitioning away from the Discovery
phase?
Image: r.ProbeImage, | ||
Flags: flags, | ||
func generateSSHKeyPairs() ([]byte, []byte, error) { | ||
privateKey, err := rsa.GenerateKey(rand.Reader, 2048) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we consider ed25519
or 4096-bit keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make this configurable later. RSA was easier because there helper method to validate the correctness of the key.
5d9e762
to
8173057
Compare
8173057
to
4d4f041
Compare
Proposed Changes
This PR introduces a feature to create a
metal
user with a corresponding SSH keypair which is stored as aSecret
alongside the discoveryServerBootConfiguration
. TheSecret
is named<serverbootconfig.name-ssh>
. This allows an administrator to use the private key in thisSecret
to SSH into theServer
in case something went wrong when running themetalprobe
agent.The
Secret
is being removed again once theServerBootConfiguration
for the discovery boot has been removed after a successfulServer
onboarding.Fixes #217