-
Notifications
You must be signed in to change notification settings - Fork 113
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
feat(compose-spec): Add content property for secrets in compose-spec.json #669
Conversation
This is by design: we don't want sensible data to be exposed as plain text in a compose file |
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.
This introduces a major risk for users to put sensible data in a compose file and publish by mistake, we can't let them shoot into their own feet
@ndeloof good point, thank you! pushed fix. Added validation to prevent from specifying "content" for the secrets property |
|
schema/schema.go
Outdated
@@ -72,6 +73,19 @@ func Validate(config map[string]interface{}) error { | |||
return nil | |||
} | |||
|
|||
// removeSecretsContentProperty removes the content property from secrets | |||
// we add the content key here loader/environment.go:66 | |||
func removeSecretsContentProperty(config map[string]interface{}) map[string]interface{} { |
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.
@ndeloof here is an equivalent ) at least tmp solution
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.
but we loose value doing so
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 copy for validation
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.
pushed changes. now it clones the map and validate
774b32d
to
37c46f9
Compare
37c46f9
to
ed0f49f
Compare
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.
AFAICT this won't catch a compose file using invalid attribute content
to set secret, while value will be actually loaded.
Suggestion: to avoid letting |
@ndeloof , if you mean this changes:
then it won'r work:
|
oh indeed. |
A possible workaround is to use a fake extension key |
I'm not sure I get the idea if I rename
into
Then how do we map this key into the Secret struct's |
need to add a |
ed0f49f
to
3e869df
Compare
@ndeloof pushed changes. |
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.
LGTM
@idsulik can you sign-off your commits please?
bf5ee6e
to
b65f7c5
Compare
@glours done |
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
b65f7c5
to
e00c25f
Compare
Fixes docker/compose#12033
Add
content
tosecret
property, because in case of environment value, we add "content" property but it wasn't defined in the spec