Skip to content

fix(security): bind publish port 8000 to loopback only#120

Merged
JanZachmann merged 1 commit intoomnect:mainfrom
JanZachmann:fix/publish-port-loopback
Apr 22, 2026
Merged

fix(security): bind publish port 8000 to loopback only#120
JanZachmann merged 1 commit intoomnect:mainfrom
JanZachmann:fix/publish-port-loopback

Conversation

@JanZachmann
Copy link
Copy Markdown
Contributor

@JanZachmann JanZachmann commented Apr 22, 2026

Summary

Restrict the internal publish endpoint (port 8000) to host loopback in the local Docker dev script and bump the workspace version to 1.2.3.

Reason

The internal publish endpoint carries ods → omnect-ui event publications over plain HTTP, protected only by a per-instance X-API-Key. It is meant to be reached via http://localhost:8000/... from omnect-device-service on the host — never from the LAN.

scripts/build-and-run-image.sh previously mapped the port as -p 8000:8000, which Docker publishes on 0.0.0.0. The README already stated that the endpoint "must not be exposed outside the device network namespace", but the dev script contradicted that.

Adding an explicit 127.0.0.1 host-IP to the port mapping limits reachability to host loopback without changing the ods → omnect-ui code path (ods uses localhost, which resolves to 127.0.0.1).

Paired with the matching change in the edge deployment template (omnect/concourse-pipelines#304) that applies the same restriction to production devices.

The internal publish endpoint (port 8000) is plain HTTP and must not be
reachable from outside the device. The local dev script previously
published it on 0.0.0.0, exposing it to the LAN.

Add an explicit 127.0.0.1 host-IP to the port mapping. ods on the host
continues to reach the endpoint via localhost; external clients no
longer can.

Bump version 1.2.2 -> 1.2.3.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann JanZachmann requested a review from mlilien April 22, 2026 10:41
@JanZachmann JanZachmann merged commit 24a2480 into omnect:main Apr 22, 2026
2 checks passed
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.

2 participants