public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: enable the root user to log in via SSH
@ 2026-09-11 13:18 Milos Malik
  0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:18 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 12ca54c4097a0af40236ac9d2930376a635a4680
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2020-12-14T11:14:32+00:00
            Stats  : +7/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/12ca54c4097a0af40236ac9d2930376a635a4680?branch=pr775-checkpolicy-revdeps

            Log:
            enable the root user to log in via SSH

If the scenario, where confined root user tries to run the perf tool,
should work, the root user must be able to log in via SSH. This
access is disabled by default. The TC will temporarily enable it.

---
diff --git a/selinux-policy/perf_event-and-related/Makefile b/selinux-policy/perf_event-and-related/Makefile
index 33b31e1..8dd8ac1 100644
--- a/selinux-policy/perf_event-and-related/Makefile
+++ b/selinux-policy/perf_event-and-related/Makefile
@@ -54,7 +54,7 @@ $(METADATA): Makefile
 	@echo "Type:            Regression" >> $(METADATA)
 	@echo "TestTime:        10m" >> $(METADATA)
 	@echo "RunFor:          selinux-policy" >> $(METADATA)
-	@echo "Requires:        audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools-console perf expect openssh-clients" >> $(METADATA)
+	@echo "Requires:        audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted setools-console perf expect openssh-clients initscripts" >> $(METADATA)
 	@echo "RhtsRequires:    library(selinux-policy/common)" >> $(METADATA)
 	@echo "Environment:     AVC_ERROR=+no_avc_check" >> $(METADATA)
 	@echo "Priority:        Normal" >> $(METADATA)

diff --git a/selinux-policy/perf_event-and-related/runtest.sh b/selinux-policy/perf_event-and-related/runtest.sh
index 7a9577a..3578e39 100755
--- a/selinux-policy/perf_event-and-related/runtest.sh
+++ b/selinux-policy/perf_event-and-related/runtest.sh
@@ -70,6 +70,10 @@ rlJournalStart
     rlPhaseEnd
 
     rlPhaseStartTest "real scenario -- confined root sysadm_u"
+        rlRun "grep -i permit /etc/ssh/sshd_config"
+        rlFileBackup /etc/ssh/sshd_config
+        rlRun "sed -i 's/^.*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config"
+        rlRun "service sshd restart"
         rlRun "setsebool ssh_sysadm_login on"
         USER_NAME="toor"
         USER_SECRET="S3kr3t${RANDOM}"
@@ -78,6 +82,8 @@ rlJournalStart
         rlRun "./ssh.exp ${USER_NAME}/sysadm_r ${USER_SECRET} localhost perf record -o /dev/null echo test"
         rlRun "userdel -Z ${USER_NAME}"
         rlRun "setsebool ssh_sysadm_login off"
+        rlFileRestore
+        rlRun "service sshd restart"
     rlPhaseEnd
 
     rlPhaseStartCleanup

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-11 13:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 13:18 [tests/selinux] pr775-checkpolicy-revdeps: enable the root user to log in via SSH Milos Malik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox