Skip to content

[v0.1.x-branch] Backport #998: waved: allow notls/no-macaroons on mainnet behind an opt-in flag - #999

Merged
Roasbeef merged 1 commit into
v0.1.x-branchfrom
backport-998-to-v0.1.x-branch
Jul 20, 2026
Merged

[v0.1.x-branch] Backport #998: waved: allow notls/no-macaroons on mainnet behind an opt-in flag#999
Roasbeef merged 1 commit into
v0.1.x-branchfrom
backport-998-to-v0.1.x-branch

Conversation

@github-actions

Copy link
Copy Markdown

Backport of #998


Motivation

The mainnet instance currently can't start with --rpc.notls and
--rpc.no-macaroons. validateRPCSecurity refuses both on mainnet TCP
listeners so that a stray flag can't silently expose an unauthenticated,
plaintext RPC surface on real funds.

That guard assumes the daemon terminates its own transport security. It
isn't true for our release deployment, where waved sits behind a proxy
that terminates TLS and enforces authentication before any traffic
reaches the listener. For that topology the guard is a false positive
that blocks startup outright. The rationale for external TLS termination
is tracked in the lightning-infra issue.

This PR

Adds an --allow-insecure-mainnet opt-in that lifts the mainnet-TCP
refusal for both rpc.notls and rpc.no-macaroons:

  • Off by default — the guard still stands for anyone who hasn't
    deliberately opted out. This mirrors the existing --allow-mainnet
    safety-flag pattern.
  • When set — both options are permitted on mainnet TCP listeners,
    and the refusal error now names the flag so an operator who hits it
    knows the escape hatch exists.

Testing

TestConfigValidateMainnetInsecureRPC covers the matrix: each option
refused by default, and each (plus both together) accepted once the
override is set.

Companion

Paired with the server-side change in lumos, which adds the same
--allow-insecure-mainnet opt-in for its client and admin RPC guards.

The daemon refuses rpc.notls and rpc.no-macaroons on mainnet TCP
listeners so a stray flag can't silently stand up an unauthenticated,
plaintext RPC surface on real funds. That guard assumes the daemon
terminates its own transport security, which isn't true for deployments
that front waved with a proxy that terminates TLS and enforces auth
before traffic ever reaches the listener. For those operators the guard
is a false positive that blocks startup outright.

In this commit, we add an allow-insecure-mainnet escape hatch. The flag
is off by default, so the guard still stands for everyone who hasn't
deliberately opted out; when set, it lifts the mainnet-TCP refusal for
both options. The lightning-infra tracking issue carries the rationale
for why external TLS termination is the deployment model here.

(cherry picked from commit 6b4cf14)
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.

1 participant