Skip to content
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

[SECURITY] Stop publishing ports #116

Closed
gander opened this issue Dec 6, 2023 · 1 comment
Closed

[SECURITY] Stop publishing ports #116

gander opened this issue Dec 6, 2023 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@gander
Copy link

gander commented Dec 6, 2023

Use the --publish or -p flag to make a port available to services outside of Docker. This creates a firewall rule in the host, mapping a container port to a port on the Docker host to the outside world.
Publishing container ports is insecure by default. Meaning, when you publish a container's ports it becomes available not only to the Docker host, but to the outside world as well.
If you include the localhost IP address (127.0.0.1) with the publish flag, only the Docker host can access the published container port.

services:
  # ...

  buggregator:
    image: ghcr.io/buggregator/server:dev
    ports:
      - 127.0.0.1:8000:8000
      - 127.0.0.1:1025:1025
      - 127.0.0.1:9912:9912
      - 127.0.0.1:9913:9913
@butschster butschster self-assigned this Dec 8, 2023
@butschster butschster added the documentation Improvements or additions to documentation label Dec 8, 2023
@butschster butschster added this to the 1.0 milestone Dec 8, 2023
@butschster
Copy link
Member

Thx for advice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Archived in project
Development

No branches or pull requests

2 participants