Add CIS related kola tests - acl.security.cis.modprobe acl.security.cis.logperms acl.security.cis.sshd - #33
Add CIS related kola tests - acl.security.cis.modprobe acl.security.cis.logperms acl.security.cis.sshd#33mayankfz wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
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 -Tand permissions checks on SSH config/drop-in files. - Implement checks for CIS modprobe blacklist entries and Azure log/waagent-related permission settings.
ac0e54c to
d993856
Compare
d993856 to
c6f0c09
Compare
There was a problem hiding this comment.
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
modprobeis invoked withoutsudo. On most distrosmodprobelives in an sbin directory and/or requires elevated privileges; this can cause the test to fail withcommand not foundor 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")
…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>
c6f0c09 to
7b62757
Compare
There was a problem hiding this comment.
🟡 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/azureusestatwithoutsudo. Since the parent dir is expected to be 0750, thesestatcalls 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
Signed-off-by: Mayank Singh <mayansingh@microsoft.com>
There was a problem hiding this comment.
🔵 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
modprobetypically requires root privileges even in dry-run mode on some distros; running it withoutsudocan cause the test to fail with EPERM and never validate the CISinstall sctp /bin/truebehavior. Since this test suite already assumes passwordless sudo on ACL, run the dry-run viasudoto make the assertion platform/user-independent.
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Lite
Summary
Add CIS related kola tests - acl.security.cis.modprobe acl.security.cis.logperms acl.security.cis.sshd
Change Log
Type of Change
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 ./...passesgo vet ./...reports no issues