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=-8.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 DBCD7C43613 for ; Thu, 20 Jun 2019 14:42:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A789E2083B for ; Thu, 20 Jun 2019 14:42:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=millerson.name header.i=@millerson.name header.b="qWkT5nY4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726796AbfFTOmz (ORCPT ); Thu, 20 Jun 2019 10:42:55 -0400 Received: from host89-222-249-147.netorn.net ([89.222.249.147]:48072 "EHLO mail.millerson.name" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1726428AbfFTOmz (ORCPT ); Thu, 20 Jun 2019 10:42:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=millerson.name; s=mail; h=MIME-Version:In-Reply-To:Message-Id:Date:Subject: To:From:user-agent; bh=xyPlsLPbf4Xi5QbzkQpWvarFRPE+K2OI0FcI1nmRhQk=; b=qWkT5n Y40GXLpDwmB769FPxL4UUIJnC3CX132dh+R9NpJYqfuBziAjwHfvDOh1ab9sqn+mHnTY/HutXAbpf aysP9QaMUS35E8tTiwqm/+VqC10rdLhwPQtkEK5zxWSqeIdW4LzeW/6Kslbc8wctA14KK/sLF+TZc fHFtm9DIug4=; Received: from localhost ([127.0.0.1] helo=mail.millerson.name) by mail.millerson.name with esmtpsa id 1hdyH7-00067L-C0 (envelope-from ); Thu, 20 Jun 2019 17:42:53 +0300 Received: from alex-office-laptop.msad.rbkmoney.com ([2a04:4a00:5:966:a55:5884:e3f8:8906]) by mail.millerson.name with ESMTPSA id +I38MWybC13cWwAAXPwaFA (envelope-from ); Thu, 20 Jun 2019 17:42:52 +0300 From: Alexander Miroshnichenko To: selinux-refpolicy@vger.kernel.org Cc: Alexander Miroshnichenko Subject: [PATCH v2 1/2] ssh: Add ssh_exec_keygen interface Date: Thu, 20 Jun 2019 17:41:37 +0300 Message-Id: <20190620144138.15172-2-alex@millerson.name> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190620144138.15172-1-alex@millerson.name> References: <20190620144138.15172-1-alex@millerson.name> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-GIT-Signature: 87d3ff1db9a643b7f0b1b55f4fb6bee2 Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org Signed-off-by: Alexander Miroshnichenko --- policy/modules/services/ssh.if | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/policy/modules/services/ssh.if b/policy/modules/services/ssh.if index b5bd2762ef96..0941f133711e 100644 --- a/policy/modules/services/ssh.if +++ b/policy/modules/services/ssh.if @@ -701,6 +701,25 @@ interface(`ssh_read_user_home_files',` userdom_search_user_home_dirs($1) ') +######################################## +## +## Execute the ssh key generator in the caller domain. +## +## +## +## Domain allowed to transition. +## +## +# +interface(`ssh_exec_keygen',` + gen_require(` + type ssh_keygen_exec_t; + ') + + corecmd_search_bin($1) + can_exec($1, ssh_keygen_exec_t) +') + ######################################## ## ## Execute the ssh key generator in the ssh keygen domain. -- 2.21.0