FLINK-37881: Drop gosu in favour of Dockerfile USER #225
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a minor improvement from security standpoint on flink's docker image.
In the dockerfile of flink's docker image, we are adding gosu:
flink-docker/1.20/scala_2.12-java17-ubuntu/Dockerfile
Lines 27 to 44 in 6e22650
This is later used to switch to the user flink in the entrypoint script:
flink-docker/1.20/scala_2.12-java17-ubuntu/docker-entrypoint.sh
Line 37 in 6e22650
Gosu itself is tagged by popular scanners as being vulnerable due to outdated golang usage (though gosu itself is not).
Instead of using gosu/su-exec, it may be preferrable to switch to flink user using USER flink or something similar in Dockerfile. This way we could avoid depending on gosu, and present a cleaner scan result.
While this does not really solve any vulnerabilties in the system, it can help satisfy auditors against false positive reports provided by heuristical scanners.