feat(compose-spec): Add content property for secrets in compose-spec.json#669
feat(compose-spec): Add content property for secrets in compose-spec.json#669glours merged 2 commits intocompose-spec:mainfrom
Conversation
This is by design: we don't want sensible data to be exposed as plain text in a compose file |
ndeloof
left a comment
There was a problem hiding this comment.
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
|
|
||
| // 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.
@ndeloof here is an equivalent ) at least tmp solution
There was a problem hiding this comment.
but we loose value doing so
There was a problem hiding this comment.
we can copy for validation
There was a problem hiding this comment.
pushed changes. now it clones the map and validate
774b32d to
37c46f9
Compare
37c46f9 to
ed0f49f
Compare
ndeloof
left a comment
There was a problem hiding this comment.
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. |
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
contenttosecretproperty, because in case of environment value, we add "content" property but it wasn't defined in the spec