Skip to content

fix: Stop waagent from pulling in sshd.service on ACL - #73

Merged
mayankfz merged 2 commits into
aclmainfrom
mayansingh/fix_ssh_disable
Oct 9, 2026
Merged

mayankfz merged 2 commits into
aclmainfrom
mayansingh/fix_ssh_disable

Conversation

@mayankfz

@mayankfz mayankfz commented Sep 15, 2026 •

Copy link
Copy Markdown

Summary

fix: Stop waagent from pulling in sshd.service on ACL

Change Log

In ACL nodes where AgentBaker turns SSH off, SSH came back after a reboot.

ACL uses socket-activated SSH, but waagent.service still listed the old-style daemon as a dependency:

Normally that line is inert, sshd.socket is enabled and declares Conflicts=sshd.service, and since the socket is pulled in strongly by sockets.target while waagent only wants the service, systemd drops the service job. But once AgentBaker disables sshd.socket, the conflict is gone, so on the next boot waagent starts sshd.service and SSH is back on a node that's meant to have it off.

This adds walinuxagent-acl-config as a local override package with sshd.service removed from Wants=.
Nothing else changes: waagent doesn't otherwise touch SSH on ACL (AclOSUtil.restart_ssh_service() and conf_sshd() are both no-ops), and normal nodes are unaffected since sshd.socket serves SSH on its own.

Type of Change

  • Image build change (base image, sysexts, OEM images)
  • Package/SPEC update
  • CI/automation change
  • SDK/toolchain update
  • Configuration change
  • Documentation update
  • Bug fix

Does this affect the image build?

  • Yes
  • No

Associated Issues

https://dev.azure.com/mariner-org/ACL/_workitems/edit/22659

Test Methodology

Merge Checklist

All applicable boxes should be checked before merging

  • Image builds successfully with this change (or image build is not affected)
  • Any updated packages/SPECs build successfully
  • Relevant kola tests pass
  • All package sources are available
  • Source files have up-to-date hashes/manifests
  • Documentation has been updated to match any changes
  • Ready to merge

Copilot AI lite review requested due to automatic review settings September 15, 2026 05:39
@mayankfz
mayankfz requested a review from a team as a code owner September 15, 2026 05:39
@mayankfz
mayankfz deployed to development September 15, 2026 05:39 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved service executable, package ownership, sysext installation, and package integration issues remain.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds an ACL-specific WALinuxAgent package overlay to prevent sshd.service from being activated when SSH is disabled.

Changes:

  • Adds ACL WALinuxAgent configuration and systemd overrides.
  • Registers the package and source signatures.
  • Removes the SSH daemon dependency from the custom unit.
File summaries
File Description
acl/SPECS/walinuxagent-acl-config/walinuxagent-acl-config.spec Defines the ACL configuration RPM.
acl/SPECS/walinuxagent-acl-config/walinuxagent-acl-config.signatures.json Provides source signatures.
acl/SPECS/walinuxagent-acl-config/waagent.service Provides the modified WALinuxAgent systemd unit.
acl/SPECS/walinuxagent-acl-config/waagent.conf Supplies ACL-specific agent settings.
acl/SPECS/walinuxagent-acl-config/10-waagent-sysext.conf Configures WALinuxAgent startup ordering.
acl/packages.yaml Includes the package in ACL builds.
Review details

Suppressed comments (1)

acl/SPECS/walinuxagent-acl-config/walinuxagent-acl-config.spec:36

  • oem-azure is built as a sysext, and the sysext builder removes every directory except /usr before creating the image. Installing this drop-in under %{_sysconfdir} means it is discarded, so this package does not actually ship the Upholds= edge it documents; the currently bundled WALinuxAgent copy happens to mask that omission. Install it under %{_unitdir}/multi-user.target.d (as the upstream WALinuxAgent unit does) or arrange for this file to be installed in the base layer.
install -Dm 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/systemd/system/multi-user.target.d/10-waagent-sysext.conf
  • Files reviewed: 6/6 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread acl/SPECS/walinuxagent-acl-config/waagent.service Outdated
Comment thread acl/packages.yaml Outdated
Comment thread acl/SPECS/walinuxagent-acl-config/walinuxagent-acl-config.spec Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread acl/SPECS/walinuxagent-acl-config/walinuxagent-acl-config.spec Outdated
@jiria

Copy link
Copy Markdown
Member

Could the SSH dependency removal use the existing OEM RPM mangle step, which already edits waagent.service, rather than copying the entire vendor unit into a local package? Copying the unit can obscure future upstream changes. A targeted edit could check for the expected Wants= entry, remove only sshd.service, and preserve sshd-keygen.service. I realize this package also supplies ACL configuration and sysext ordering, so it cannot simply be dropped; if the unit copy must remain, documenting how it will track upstream changes would help address the maintenance risk.

@jiria

Copy link
Copy Markdown
Member

Could we add a regression check for the disabled-SSH reboot case? Checking that the final post-mangle waagent.service does not want sshd.service would catch packaging drift. An Azure VM test could also disable sshd.socket, reboot, and verify that waagent starts while sshd.service and sshd.socket remain inactive. This is a coverage suggestion, not a claim that the current image fails.

@mayankfz mayankfz closed this Oct 8, 2026
@mayankfz mayankfz reopened this Oct 8, 2026
@mayankfz
mayankfz deployed to development October 8, 2026 07:14 — with GitHub Actions Active
@mayankfz

mayankfz commented Oct 8, 2026

Copy link
Copy Markdown
Author

Could we add a regression check for the disabled-SSH reboot case? Checking that the final post-mangle waagent.service does not want sshd.service would catch packaging drift. An Azure VM test could also disable sshd.socket, reboot, and verify that waagent starts while sshd.service and sshd.socket remain inactive. This is a coverage suggestion, not a claim that the current image fails.

The guard is that packaging-drift check, the build fails if post-mangle waagent.service still wants sshd.service or lost sshd-keygen.service. Will add the reboot-on-Azure test too, would put it in the kola suite. Will take it later.

@mayankfz

mayankfz commented Oct 8, 2026

Copy link
Copy Markdown
Author

Could the SSH dependency removal use the existing OEM RPM mangle step, which already edits waagent.service, rather than copying the entire vendor unit into a local package? Copying the unit can obscure future upstream changes. A targeted edit could check for the expected Wants= entry, remove only sshd.service, and preserve sshd-keygen.service. I realize this package also supplies ACL configuration and sysext ordering, so it cannot simply be dropped; if the unit copy must remain, documenting how it will track upstream changes would help address the maintenance risk.

moved it to the OEM mangle step as a targeted with guards. Removed the package, but eventually will it be better to push it upstream, since its only config package with our control on it.

Copilot AI lite review requested due to automatic review settings October 8, 2026 07:42
@mayankfz
mayankfz force-pushed the mayansingh/fix_ssh_disable branch from 48347ec to 4e98812 Compare October 8, 2026 07:42
@mayankfz
mayankfz deployed to development October 8, 2026 07:42 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified.

0 open findings

1 resolved since last review

🧠 Review effort: Lite


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@mayankfz
mayankfz merged commit 25ad97c into aclmain Oct 9, 2026
30 of 32 checks passed

This branch was successfully deployed

1 active deployment
development — 4e988121 Deployed Oct 8, 2026 by mayankfz via Check if we need to update the SDK #105
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.

4 participants