Skip to content

Add CIS related kola tests - acl.security.cis.modprobe acl.security.cis.logperms acl.security.cis.sshd - #33

Open
mayankfz wants to merge 4 commits into
aclmainfrom
mayansingh/cis_kola_tests
Open

Add CIS related kola tests - acl.security.cis.modprobe acl.security.cis.logperms acl.security.cis.sshd#33
mayankfz wants to merge 4 commits into
aclmainfrom
mayansingh/cis_kola_tests

Conversation

@mayankfz

@mayankfz mayankfz commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Add CIS related kola tests - acl.security.cis.modprobe acl.security.cis.logperms acl.security.cis.sshd

Change Log

  • Add CIS related kola tests - acl.security.cis.modprobe acl.security.cis.logperms acl.security.cis.sshd

Type of Change

  • New kola test
  • Kola test fix/update
  • Platform integration change (Azure, QEMU, etc.)
  • CLI/command change
  • CI/automation change
  • Bug fix
  • Documentation update

Associated Issues

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

Test Methodology

Merge Checklist

All applicable boxes should be checked before merging

  • go build ./... passes (basic validation)
  • docker build -t mantle . succeeds (full multi-arch build; required for build-affecting changes)
  • go test ./... passes
  • go vet ./... reports no issues
  • Relevant kola tests pass against a test image
  • Documentation has been updated to match any changes
  • Ready to merge

@mayankfz
mayankfz requested a review from a team as a code owner August 4, 2026 13:20
Copilot AI lite review requested due to automatic review settings August 4, 2026 13:20

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.

Pull request overview

Adds new Azure Container Linux (ACL) CIS-focused kola tests under kola/tests/misc to validate CIS hardening settings on supported platforms (qemu/qemu-unpriv/azure).

Changes:

  • Register three new ACL-only kola tests: acl.security.cis.sshd, acl.security.cis.modprobe, acl.security.cis.logperms.
  • Implement SSHD hardening validation via sshd -T and permissions checks on SSH config/drop-in files.
  • Implement checks for CIS modprobe blacklist entries and Azure log/waagent-related permission settings.

Comment thread kola/tests/misc/cis.go Outdated
Copilot AI review requested due to automatic review settings August 4, 2026 13:31
@mayankfz
mayankfz force-pushed the mayansingh/cis_kola_tests branch from ac0e54c to d993856 Compare August 4, 2026 13:31

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.

Pull request overview

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

Comment thread kola/tests/misc/cis.go Outdated
Copilot AI review requested due to automatic review settings August 8, 2026 08:43
@mayankfz
mayankfz force-pushed the mayansingh/cis_kola_tests branch from d993856 to c6f0c09 Compare August 8, 2026 08:43

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.

Pull request overview

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

Suppressed comments (1)

kola/tests/misc/cis.go:92

  • modprobe is invoked without sudo. On most distros modprobe lives in an sbin directory and/or requires elevated privileges; this can cause the test to fail with command not found or permission errors even when the CIS config is correct. Run it via sudo (or use an absolute path) to make the check platform/PATH-independent.
	// sctp should be a silent no-op (exit 0), not a hard error
	c.MustSSH(m, "modprobe -n sctp")

@SeanDougherty
SeanDougherty self-requested a review August 13, 2026 19:45
SeanDougherty
SeanDougherty previously approved these changes Aug 13, 2026
Mayank Singh added 3 commits September 7, 2026 06:30
…is.logperms acl.security.cis.sshd

Signed-off-by: Mayank Singh <mayansingh@microsoft.com>
…is.logperms acl.security.cis.sshd

Signed-off-by: Mayank Singh <mayansingh@microsoft.com>
Signed-off-by: Mayank Singh <mayansingh@microsoft.com>
Copilot AI review requested due to automatic review settings September 7, 2026 06:52
@mayankfz
mayankfz force-pushed the mayansingh/cis_kola_tests branch from c6f0c09 to 7b62757 Compare September 7, 2026 06:52

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

The new CISLogPerms test uses stat without sudo on paths expected to be 0750, which can cause permission-denied failures and make the test incorrect/flaky.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

kola/tests/misc/cis.go:129

  • The per-file permission checks under /var/log/azure use stat without sudo. Since the parent dir is expected to be 0750, these stat calls can fail due to lack of traverse permission, making the test flaky/incorrect.
		mode := strings.TrimSpace(string(c.MustSSH(m, fmt.Sprintf("stat -c '%%a' %s", path))))
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread kola/tests/misc/cis.go Outdated
Signed-off-by: Mayank Singh <mayansingh@microsoft.com>
Copilot AI review requested due to automatic review settings September 7, 2026 07:18

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.

🔵 Needs a closer look

One of the new tests runs modprobe without sudo, which can fail under the default unprivileged SSH user and make the test flaky or incorrect.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

kola/tests/misc/cis.go:97

  • modprobe typically requires root privileges even in dry-run mode on some distros; running it without sudo can cause the test to fail with EPERM and never validate the CIS install sctp /bin/true behavior. Since this test suite already assumes passwordless sudo on ACL, run the dry-run via sudo to make the assertion platform/user-independent.
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

3 participants