diff --git a/lib/selinux/selinux_linux.go b/lib/selinux/selinux_linux.go index 28663587156a3..14fcc66e94272 100644 --- a/lib/selinux/selinux_linux.go +++ b/lib/selinux/selinux_linux.go @@ -22,6 +22,7 @@ import ( "bytes" "context" _ "embed" + "errors" "log/slog" "os" "path/filepath" @@ -226,6 +227,9 @@ func diagnoseWrongDomain(procCtx *selinuxContext, logger *slog.Logger) error { // ModuleInstalled returns true if the SSH SELinux module is installed. func ModuleInstalled() (bool, error) { selinuxType, err := readConfig(selinuxTypeTag) + if errors.Is(err, os.ErrNotExist) { + return false, nil + } if err != nil { return false, trace.Wrap(err, "failed to find SELinux type") }