Skip to content

fix: remove leading newline from login banner files for CIS 1.6.2/1.6.3#8297

Closed
djsly wants to merge 1 commit intomainfrom
djsly/37518794
Closed

fix: remove leading newline from login banner files for CIS 1.6.2/1.6.3#8297
djsly wants to merge 1 commit intomainfrom
djsly/37518794

Conversation

@djsly
Copy link
Copy Markdown
Collaborator

@djsly djsly commented Apr 13, 2026

Summary

Fixes CIS benchmark regressions for rules 1.6.2 (local login warning banner) and 1.6.3 (remote login warning banner).

Root Cause

The files parts/linux/cloud-init/artifacts/etc-issue and parts/linux/cloud-init/artifacts/etc-issue.net had a leading newline character before the banner text:

↵
Authorized uses only. All activity may be monitored and reported.

The CIS checks expect the file to start directly with the banner text — no leading whitespace or newlines. This caused both rules to flip from pass to fail in VHD CIS scanning (vhdbuilder/packer/vhd-scanning.sh).

Evidence

Regression confirmed across 4 independent builds spanning March 27 – April 13:

Fix

Removed the leading empty line from both files so content starts immediately with the banner text. The banner content itself is unchanged.

Note on CIS 6.1.4.1

ADO #37518794 also tracks an intermittent regression for rule 6.1.4.1 (logfile permissions). That issue is timing-dependent during VHD build and will be investigated separately.

AB#37518794

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes CIS benchmark regressions for 1.6.2 (/etc/issue) and 1.6.3 (/etc/issue.net) by ensuring the login banner files do not start with a leading newline, so the banner text begins immediately at byte/line 1.

Changes:

  • Removed the leading empty first line from parts/linux/cloud-init/artifacts/etc-issue.
  • Removed the leading empty first line from parts/linux/cloud-init/artifacts/etc-issue.net.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
parts/linux/cloud-init/artifacts/etc-issue Removes leading blank line so the local login banner starts immediately.
parts/linux/cloud-init/artifacts/etc-issue.net Removes leading blank line so the remote login banner starts immediately.

The etc-issue and etc-issue.net files had a leading empty line before
the banner text. CIS benchmark rules 1.6.2 (local login warning banner)
and 1.6.3 (remote login warning banner) expect the file to begin with
the banner content directly, causing these checks to regress to fail.

AB#37518794

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 14, 2026 20:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@djsly
Copy link
Copy Markdown
Collaborator Author

djsly commented Apr 15, 2026

Closing — the CIS 1.6.2/1.6.3 regression root cause was apt_get_dist_upgrade --force-confnew overwriting /etc/issue, not the leading newline. The real fix is in PR #8317 (re-copy banners after all apt operations).

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