Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C915C3A5A4 for ; Sun, 1 Sep 2019 12:46:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E04E323711 for ; Sun, 1 Sep 2019 12:46:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ocqZwTlE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728722AbfIAMqv (ORCPT ); Sun, 1 Sep 2019 08:46:51 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:46429 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728639AbfIAMqv (ORCPT ); Sun, 1 Sep 2019 08:46:51 -0400 Received: by mail-ed1-f68.google.com with SMTP id z51so13272120edz.13 for ; Sun, 01 Sep 2019 05:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9ufGOGNkk1BpPppTORtm72OsHW7l+T7RVAnYeWd1CNg=; b=ocqZwTlE2y/nNCGRKp/Qy2tpyczeKQvQtWkn+SdRGncfT0LK0xxuHQKSdrZW++p82D 70ny+7rzy999gSJXN58mSa+XwKZrHaKE9/CCCGkhWVmXIbYWOdzMBsQ3rWHzT0aeaZrX oNuRH0/HOhmWAFD+EEN4E+iNxDJID1cS6aTaTx967rtGEeF8KdKEbM4/VvTjWw2G/hMW AixcVA/llO/syB+YS8iCgQMRgsPs49w6F7v3o2aUdMleip0E9+KrIdKNG/Cmb4lYjkSh 8ZgqeNY90F1E0PI2J9c1ns/donwJC/Wog0coOHNzvsNVFHp8ZTrbFEqwdvFZqB4SXPrn 0W+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9ufGOGNkk1BpPppTORtm72OsHW7l+T7RVAnYeWd1CNg=; b=glOCHOE/JM2zaIjqruPrVLaBqN9qTXOvkBlGJhLdlEmeCrkNRJaMAGJRWG6WSrBd9n /AiKULWaGqsUTlp9bwMJlV5DhuQMKOIaXnEMB0rYyn7MKi5NdFqhkwp4TwPvifKS9vAC QvbTMnelU1vcH0I94XW+xjYEJIjiP0fDX/tcfTq84tCEc9IkD7vFZwvc0x1yAtphGZao FiYIhuFDUaCop5BCcEqI3TmALUpC+xtTk3FFoJEzICRlzs4Pc4HphghVcOpWnTQHmP8w 3arkCaqDfM/Cs+k9g2TZ7NS8uWzNO+clcGULGZOb4I6DGb3W4dzxniGOxD7W72GoRjiR u6xw== X-Gm-Message-State: APjAAAX4OUPTQu2KU+O3Jxhw7fZuhVC3vVGUQFns1LBZ+6FuQas5rIT8 6IcSfx7mf2LDihVmYsUtrO46G03k X-Google-Smtp-Source: APXvYqwe+3a/+avKc3C7CeS6P58ctDKZ46HR9fOUO0DkcATlb0nEW5cAjQ5Q4NyyKaU7t8K/a/EtrQ== X-Received: by 2002:a17:906:11d6:: with SMTP id o22mr20635181eja.60.1567342009548; Sun, 01 Sep 2019 05:46:49 -0700 (PDT) Received: from brutus.lan (brutus.defensec.nl. [2001:985:d55d::438]) by smtp.gmail.com with ESMTPSA id gs21sm1577128ejb.40.2019.09.01.05.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Sep 2019 05:46:48 -0700 (PDT) From: Dominick Grift To: selinux-refpolicy@vger.kernel.org Cc: Dominick Grift Subject: [PATCH] Remove shell automatic domain transitions to unconfined_t from various pam login programs Date: Sun, 1 Sep 2019 14:46:20 +0200 Message-Id: <20190901124620.375409-1-dac.override@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org I think these may have been adopted from the old Red Hat targeted policy (that model only had unconfined users) Some aspect to note: 1. The ssh_sysadm_login boolean now applies to unconfined_t as well 2. remotelogin only allows unpriv logins The rshd module also calls unconfined_shell_domtrans() but I ignored that one because that policy currently does not have support for manual transitions with pam_selinux. Signed-off-by: Dominick Grift --- policy/modules/services/remotelogin.te | 4 ---- policy/modules/services/ssh.te | 4 ---- policy/modules/system/locallogin.te | 4 ---- 3 files changed, 12 deletions(-) diff --git a/policy/modules/services/remotelogin.te b/policy/modules/services/remotelogin.te index bc2292e3..c7c9c564 100644 --- a/policy/modules/services/remotelogin.te +++ b/policy/modules/services/remotelogin.te @@ -91,10 +91,6 @@ optional_policy(` telnet_use_ptys(remote_login_t) ') -optional_policy(` - unconfined_shell_domtrans(remote_login_t) -') - optional_policy(` usermanage_read_crack_db(remote_login_t) ') diff --git a/policy/modules/services/ssh.te b/policy/modules/services/ssh.te index 4e75b6e1..a99ad912 100644 --- a/policy/modules/services/ssh.te +++ b/policy/modules/services/ssh.te @@ -328,10 +328,6 @@ optional_policy(` systemd_dbus_chat_logind(sshd_t) ') -optional_policy(` - unconfined_shell_domtrans(sshd_t) -') - optional_policy(` xserver_domtrans_xauth(sshd_t) xserver_link_xdm_keys(sshd_t) diff --git a/policy/modules/system/locallogin.te b/policy/modules/system/locallogin.te index a56f3d1f..632d2542 100644 --- a/policy/modules/system/locallogin.te +++ b/policy/modules/system/locallogin.te @@ -200,10 +200,6 @@ optional_policy(` systemd_write_inherited_logind_sessions_pipes(local_login_t) ') -optional_policy(` - unconfined_shell_domtrans(local_login_t) -') - optional_policy(` usermanage_read_crack_db(local_login_t) ') -- 2.23.0