zavoloklom / docker-compose-linter

A command-line tool for validating and enforcing best practices in Docker Compose files.
MIT License
13 stars 1 forks source link

feat: require port bindings to include inferface ip #29

Open salzig opened 2 weeks ago

salzig commented 2 weeks ago

Intention: binding to a port often unintentionally exposes services to the local network. Often seen when developers start databases in a Container and expose it via port-exposing to the local application. Sadly this is done often without limiting the port binding to localhost. Gets even worse when no password for the database is set up.

So this will warn when no Interfaces/HostIP is specified.

zavoloklom commented 2 weeks ago

@salzig Hi! Thanks for suggestion and PR, I'll look for it and let you know if something needs to be adjust

zavoloklom commented 5 days ago

@salzig Hello again.

Sorry for the long review.

I'm trying to find articles with good workarounds for local development where you don't need to set up IP explicitly and it's only decreasing readability (for documentation). I suppose 'expose' would work for some cases, and maybe it should be validated then also.

Maybe you can help me with some good articles and examples?

It's not a blocker, but I want documentation to be clear and friendly for beginners.