Skip to content

ops(runtime): harden bundled MQTT and opt-in pprof defaults #372

Closed

Description

@dborup

Problem

The repository defaults on dborup/CoreScope master 1f423e0627976c961fb7a40f45016e817e582cc3 still set DISABLE_MOSQUITTO=false and publish ${PROD_MQTT_PORT:-1883}:1883 in docker-compose.yml. That can expose the bundled plaintext broker if an operator uses this Compose path without overriding it. Server and ingestor pprof are already opt-in here, but when enabled their listeners use ":"+port, binding to all interfaces; the default ports differ (6060/6061).

Reference: nashmesh/CoreScope PR 21 (reference only). Our production and staging broker topologies include existing Mosquitto and MQTT device-auth sources; confirm their actual configuration before any default or deployment change. This issue does not assert which Compose path the live hosts currently run.

Requested change

  • Make bundled Mosquitto an explicit opt-in. In external-broker mode, validate that a usable external MQTT source is present before starting or replacing the service. Keep credentials out of diagnostics.
  • When bundled mode is explicitly selected, bind any host port to loopback unless a separately reviewed exposure is required.
  • Keep pprof opt-in and bind enabled listeners to loopback by default, preserving distinct server/ingestor ports.
  • Review setup, update, restore, staging and documentation paths together so environment/config precedence cannot silently select the wrong broker.

Acceptance

  • Tests cover both broker modes, malformed/localhost-only external configuration, missing source, environment precedence and all relevant Compose variants.
  • Tests confirm pprof is absent by default, local-only when enabled and uses distinct ports.
  • A staging-like rollout verifies live MQTT ingestion and restart/rollback behavior before any production change. Existing observers and the device-auth source must continue receiving data.

Opening this issue authorizes no host or deployment changes.

Activity

  1. added a commit that references this issue on Oct 13, 2026
  2. dborup commented on Oct 13, 2026

    @dborup
    OwnerAuthor

    Fixed by #431 (merged as cbab7380d3934e8078da488290fcad27986b70e4). Default flips (loopback binds, Mosquitto opt-in, strict broker errors, DISABLE_MOSQUITTO parsing) are listed under 'Left for the owner' in #431 and are NOT applied; defaults are unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions