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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS 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 E0B30C43381 for ; Wed, 27 Feb 2019 03:22:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0297218D0 for ; Wed, 27 Feb 2019 03:22:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="S1Yx+iIe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729291AbfB0DWl (ORCPT ); Tue, 26 Feb 2019 22:22:41 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37959 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729128AbfB0DWl (ORCPT ); Tue, 26 Feb 2019 22:22:41 -0500 Received: by mail-pf1-f196.google.com with SMTP id n125so7280515pfn.5 for ; Tue, 26 Feb 2019 19:22:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=NM6DwaixWLGUA3NkMwDgWRo0YF4/iEPtMDrD7IuR0I4=; b=S1Yx+iIeY2XrItxYPMc79eDkMmKiG2gGQFjU+Ffyc1D4cmTllD7Gj9ef0dQzpYSCOC AKHpSIh4J7ZWRzdxpAQn2jIQ0Hn5tdJvpanTnH63hNMZDF7M4pGdDBQwc3jpVe6gVGM+ TbF5JhBQ6p2u0bkpX05WO3FpU5Y3mx5rREXUE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=NM6DwaixWLGUA3NkMwDgWRo0YF4/iEPtMDrD7IuR0I4=; b=TQLZ0IOR60+XK2K1noq/imQCUISKhXJ1RR/d4a8HE+2ZaiM31HTC6xxrhftucR1MsY 6MeQltE0K0PEzOgfkDPJkIYnMoadLLVVs7Z8I7tmk4ddGpVecb8oE6u+1zkKtHR9hiMm k+bM3LoC/zUiS78ZGr2kBeaP5BovLaqVTeT4fq5yIeGg2mLG6EGGP/URP59kcAoTY8xp 2qRM3lheTZcgZPFlvJrj2+8CdXrdiswsanY6jou9dLWKsfKxB6NaD+i6IOBOhVF1/mPZ Bu6rQLKlIHXG9VybcrVte9G+/GnlDk3JmFRVwKoVANKVxZrDGc95XGJx0Hgkr1Bd/OZv Ql7g== X-Gm-Message-State: AHQUAuZon9aj87zZJCGnJDNk9XVhtL4QgJj/+/sNXl3psSz5hexVNGzV dVE14vIDG7/TUrxtntwLGVwaiQ== X-Google-Smtp-Source: AHgI3IZBMMpXm5QJu2mDvxWOpsdyxL8AdHEKmUte37tWAPtBq2ctIPUmG0N/7ySudQUEkgid4Ob4xA== X-Received: by 2002:a62:ea10:: with SMTP id t16mr22987290pfh.3.1551237760471; Tue, 26 Feb 2019 19:22:40 -0800 (PST) Received: from lenovo.pebenito.net ([173.239.195.110]) by smtp.gmail.com with ESMTPSA id b138sm24923770pfb.48.2019.02.26.19.22.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 19:22:39 -0800 (PST) Message-ID: <610ce5825c5871d06207b6d505f63dffe8c163d7.camel@ieee.org> Subject: Re: [PATCH] Add interfaces to run freshclam From: Chris PeBenito To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" Date: Tue, 26 Feb 2019 19:22:38 -0800 In-Reply-To: <20190225233708.15319-2-dsugar@tresys.com> References: <20190225233708.15319-1-dsugar@tresys.com> <20190225233708.15319-2-dsugar@tresys.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On Mon, 2019-02-25 at 23:37 +0000, Sugar, David wrote: > Currently freshclam can only be started from cron or init. This adds > the option of starting from a different process and optionally > transitioning or staying in the callers domain. > > Signed-off-by: Dave Sugar > --- > policy/modules/services/clamav.if | 64 > +++++++++++++++++++++++++++++++ > 1 file changed, 64 insertions(+) > > diff --git a/policy/modules/services/clamav.if > b/policy/modules/services/clamav.if > index 0dc1e23c..30d0b814 100644 > --- a/policy/modules/services/clamav.if > +++ b/policy/modules/services/clamav.if > @@ -251,6 +251,70 @@ interface(`clamav_scannable_files',` > typeattribute $1 clam_scannable_type; > ') > > +######################################## > +## > +## Execute a domain transition to run freshclam. > +## > +## > +## > +## Domain allowed to transition. > +## > +## > +# > +interface(`clamav_domtrans_freshclam',` > + gen_require(` > + type freshclam_t, freshclam_exec_t; > + ') > + > + corecmd_search_bin($1) > + domtrans_pattern($1, freshclam_exec_t, freshclam_t) > +') > + > +######################################## > +## > +## Execute freshclam in the freshclam domain, and > +## allow the specified role the freshclam domain. > +## > +## > +## > +## Domain allowed to transition. > +## > +## > +## > +## > +## Role allowed access. > +## > +## > +## > +# > +interface(`clamav_run_freshclam',` > + gen_require(` > + type freshclam_t; > + ') > + > + clamav_domtrans_freshclam($1) > + role $2 types freshclam_t; > +') > + > +######################################## > +## > +## Execute freshclam in the caller domain. > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`clamav_exec_freshclam',` > + gen_require(` > + type freshclam_exec_t; > + ') > + > + corecmd_search_bin($1) > + can_exec($1, freshclam_exec_t) > +') > + > ######################################## > ## > ## Allow specified domain to enable clamd units Merged. -- Chris PeBenito