Skip to content

fix(ssh): run the Rocky SSH firewall check only when the port changes #104

Closed

Description

@entelecheia

Context

Found while reviewing the #89 PR on 2026-11-09 (epic #98). verified on main 949d449: on Rocky, SSHModule.Check and Apply (internal/module/ssh.go, cfg.Port > 0 branch) call rockyFirewallAllowsSSH whenever ssh.port is set, not only when the port changes. The check refuses on any UFW DENY/REJECT rule, any SSH allow that is not unrestricted in both address families, and any firewalld rich rule in an active zone. A Rocky host that sets ssh.port, already runs sshd on it and keeps a source-limited SSH policy therefore fails every check/apply.

AGENTS.md scopes the guard to "before changing SSH ports". #89 limits the Ubuntu path to real port changes; this issue aligns Rocky.

Implementation starts only on the owner's go-ahead.

Decisions

Design

Changes

  • internal/module/ssh.go, internal/module/rocky_test.go, docs/rocky-support.md.

Acceptance criteria

  • AC1: Rocky stub with ssh.port equal to the current drop-in Port and a source-limited firewalld/UFW policy: Check reports no firewall error and Apply changes nothing.
  • AC2: same stub with a different ssh.port: refused before any sshd write, as today.
  • AC3: rocky CI jobs pass.

Tasks

Out of scope

  • Changing what counts as an allowed policy for a real port change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions