Skip to content

Removing a PostgreSQL Service leaves its pg_hba.conf block and listener on the host #146

Open

Description

@shipmill-romamo

Split from #144 (part 2), found in the review of #141 (PostgreSQL remoteAccess, spec S-006).

The problem

Removing a PostgreSQL Service resource removes its firewall rule on the next cloudfall converge baseline, but leaves on the host:

  • the Cloudfall block in pg_hba.conf (its hostssl lines)
  • listen_addresses = '127.0.0.1,<listenAddress>' in the Cloudfall conf file

The nftables default-drop still closes the port, so nothing is reachable from outside; the second layer stays open.

Why it isn't a small fix

Cloudfall has no decommission path for any Service today: converge only renders the services the config declares, and nothing records which services a host ran before. Closing what a removed Service left behind needs that path (or a record of the previous services per host) first. S-006-10 covers removing remoteAccess from a Service that stays, which works.

Expected

Whatever the Service decommission path turns out to be, it closes the pg_hba.conf block and resets the listener too, or config validate/converge reports what was left behind.

Related: #81, #141, #144, docs/specs/006-standalone-postgresql.md.

Activity

  1. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    Triage: postponed to after 0.8.0. Cloudfall has no decommission path for any Service yet, so there is nothing for this fix to hook into; building one is new behaviour that needs a spec of its own. The firewall rule does go away with the Service, and nftables' default drop keeps the port closed, so this is a gap in the second layer, not an opening.

    The plan:

    • A Service decommission path (a spec): how converge learns which services a host ran before, and what it removes for each kind
    • For PostgreSQL it removes the Cloudfall block in pg_hba.conf, resets listen_addresses, and reloads or restarts as S-006-10 does for a removed remoteAccess
    • Until then, the manual workaround is to drop remoteAccess from the Service, converge services, and only then remove the Service
  2. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    @romamo Decided without waiting: this is postponed until Cloudfall has a Service decommission path, which needs its own spec.

    Why: nothing records which services a host ran before, so no fix can tell a removed Service from one that was never there; the nftables default drop still closes the port.
    Not taken: specify Service decommission now, which pulls a new capability into 0.8.0 while S-006 and S-007 are still finishing.

    Reply with a comment starting with veto before 2026-10-28 11:15 UTC to reverse it, adding what you want instead if you like. A later veto still counts and gets a follow-up.

  3. added
    postponedTriage decided not now; revisited after the next stable release
    decidedAn agent decided at notify; the maintainer may veto
    on Oct 27, 2026
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

    bugSomething isn't workingdecidedAn agent decided at notify; the maintainer may vetopostponedTriage decided not now; revisited after the next stable release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions