Skip to content

Unroot docker examples and fix stdout permissions in container#11523

Merged
mattklein123 merged 18 commits intoenvoyproxy:masterfrom
phlax:unroot-docker-examples
Jun 28, 2020
Merged

Unroot docker examples and fix stdout permissions in container#11523
mattklein123 merged 18 commits intoenvoyproxy:masterfrom
phlax:unroot-docker-examples

Conversation

@phlax
Copy link
Copy Markdown
Member

@phlax phlax commented Jun 9, 2020

Commit Message: Update examples to use non-well known ports and not the root user
Additional Description:
I have updated 80 -> 8000 for any ports I could see that were exposed by an envoy container.

I left one example (load-reporting-service) using port 80 and instead added the ENVOY_UID env var

Some docs (eg docs/root/start/sandboxes) that have port 80 coded in relation to these examples, have been updated

Also adds fix for envoy permissions on /dev/stdout and /dev/stderr

Risk Level: Low
Testing: Manual testing
Docs Changes:

  • Sandbox examples updated to reflect port changes
  • Note added about uid/gid of container user

Release Notes: N/A
Fix #11506
Fix #11551

Copy link
Copy Markdown
Member

@junr03 junr03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, do you mind updating any stale docs? Thanks!

/wait

@phlax
Copy link
Copy Markdown
Member Author

phlax commented Jun 13, 2020

@junr03 i have updated the relevant docs - not sure if there are others - but these seem to be the ones that directly referenced the port 80 settings.

I have again committed separately - but will happily squash

@phlax
Copy link
Copy Markdown
Member Author

phlax commented Jun 13, 2020

also, im wondering if i should add a doc about the ENVOY_UID setting. Adding to the existing load_reporting_service example seems a bit arbitrary

@junr03
Copy link
Copy Markdown
Member

junr03 commented Jun 17, 2020

also, im wondering if i should add a doc about the ENVOY_UID setting.

Yes, please.

/wait

@phlax
Copy link
Copy Markdown
Member Author

phlax commented Jun 18, 2020

documentation added

@lu4t
Copy link
Copy Markdown

lu4t commented Jun 22, 2020

Adding a comment and link to this issue:

#11679

as @dio requested....

@phlax phlax force-pushed the unroot-docker-examples branch from 1b1bee7 to d5ae3f3 Compare June 22, 2020 09:40
@phlax
Copy link
Copy Markdown
Member Author

phlax commented Jun 22, 2020

@lu4t @dio - i updated the docs to use py3-pip - but then i saw #11680 so i can remove this commit in favour of that pr if required

commit removed

@junr03
Copy link
Copy Markdown
Member

junr03 commented Jun 26, 2020

@lu4t @dio does this look good to both of you?

@dio
Copy link
Copy Markdown
Member

dio commented Jun 27, 2020

Looks good, just a question: @phlax, do you want to tackle the access issue to /dev/stdout here as well (since it is related to privileged access too)? Thank you!

phlax added 10 commits June 27, 2020 07:34
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
phlax added 5 commits June 27, 2020 07:34
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax force-pushed the unroot-docker-examples branch from d5ae3f3 to ee2d267 Compare June 27, 2020 07:02
@phlax
Copy link
Copy Markdown
Member Author

phlax commented Jun 27, 2020

@dio i added a fix for permissions on /dev/stdout.

I also added it for /dev/stderr on the basis that a config may well use that pipe too.

I have tested the built image with the fault-injection example and this seems to work ok.

I wasn't entirely clear where the envoy-dev image is built - but im assuming its based on the recipe in ci/Dockerfile-envoy

@phlax phlax changed the title Unroot docker examples Unroot docker examples and fix stdout permissions in container Jun 27, 2020
@dio
Copy link
Copy Markdown
Member

dio commented Jun 27, 2020

I wasn't entirely clear where the envoy-dev image is built - but im assuming its based on the recipe in ci/Dockerfile-envoy

Yes, you're right.

Copy link
Copy Markdown
Member

@dio dio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM. Just an ask to add a comment on the decision of making the envoy user owns stdout and stderr (probably since it is a common use case when we have access logging) and a tiny nit to make sure the doc is rendered as intended.

Comment on lines 151 to 161
Copy link
Copy Markdown
Member

@dio dio Jun 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. To use double backticks instead of the single one, e.g. for uid and gid, and other words that need to be rendered inside <span class="pre"></span> tag. For example:

``docker``

gives:

image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

phlax added 3 commits June 27, 2020 08:59
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax force-pushed the unroot-docker-examples branch from ee2d267 to 6d80371 Compare June 27, 2020 08:01
Copy link
Copy Markdown
Member

@dio dio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mattklein123 mattklein123 merged commit 504d78b into envoyproxy:master Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting permission denied on latest dev image for access logs examples/front-proxy tutorial is broken

5 participants