-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add key generator container image #296
Conversation
v0lkan
commented
Oct 8, 2023
- adds key generator container image
- replace Volkan’s email with a generic maintainer’s email in the LABELs of the container images.
* adds key generator container image * replace Volkan’s email with a generic maintainer’s email in the LABELs of the container images. Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>
@@ -17,6 +17,9 @@ DEPLOYMENT_NAME=vsecm | |||
include ./makefiles/VSecMMacOs.mk | |||
include ./makefiles/VSecMDeploy.mk | |||
|
|||
## Keygen | |||
include ./makefiles/VSecMKeyGen.mk |
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.
The entry point to build the "keygen" container image.
We’ll use the keygen to manually create the root key if the user does not want to use auto-generated VSecM keys.
} | ||
|
||
data := make(map[string][]byte) | ||
keysCombined := crypto.CombineKeys(privateKey, publicKey, aesSeed) |
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.
moved some of the private methods into the crypto
module for reuse.
@@ -22,7 +22,7 @@ RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o example \ | |||
# generate clean, final image for end users | |||
FROM gcr.io/distroless/static-debian11 | |||
|
|||
LABEL "maintainers"="Volkan Özçelik <volkan@vsecm.com>" | |||
LABEL "maintainers"="VSecM Maintainers <maintainers@vsecm.com>" |
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.
Adding a catch-all email instead of my company email.
RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -o vsecm-keygen ./app/keygen/cmd/main.go | ||
|
||
# generate clean, final image for end users | ||
FROM gcr.io/distroless/static-debian11 |
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.
Since this is a utility module, we don’t need to create the usual, photon, fips, etc variants. — A distroless base is just fine.
app/keygen/cmd/main.go
Outdated
privateKey, publicKey, aesSeed, err := crypto.GenerateKeys() | ||
|
||
if err != nil { | ||
fmt.Println(err) |
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.
Just a minor (to make it consistent), other than this, everything looks good to me.
if err != nil {
fmt.Println("Failed to generate keys:")
fmt.Println(err.Error())
return
}
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.
Noted… will update.
Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>
@v0lkan, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|