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=-1.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 6C8ABC43381 for ; Wed, 20 Feb 2019 03:33:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 362B72146F for ; Wed, 20 Feb 2019 03:33:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="fje/Y/Xa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726312AbfBTDdY (ORCPT ); Tue, 19 Feb 2019 22:33:24 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36840 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726208AbfBTDdX (ORCPT ); Tue, 19 Feb 2019 22:33:23 -0500 Received: by mail-pg1-f193.google.com with SMTP id r124so11143945pgr.3 for ; Tue, 19 Feb 2019 19:33:23 -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=zyIECeCeoetwM3e9Udn0xgzvaeJywxg8l+6KsIMMR/c=; b=fje/Y/XaG7fm+79lN8n2L+pcjwvEilkcpNeIvb+di+WVC4SBZTiB7ik9NhFdzZx9gs lCwQoZNmDGqWXC0FEw8VSUt+QGb1uhsYaj/a4yeOiMyoFsk8lJMzxgg+y0piMK7VrFaw PbkX1Z3jXiHhvKTmTZviNd0sEGlMDt8W2f7dg= 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=zyIECeCeoetwM3e9Udn0xgzvaeJywxg8l+6KsIMMR/c=; b=esXLXeC+Txs9G2ImXX6Wol4X9v2FHJpcwQBeny4Vvpbs4Ef08SLIlIhPKEvBHil1BW aVNIEyr2zdbn0Pm4oKxhGaW33oPWVzwFm4DrVeW8QAcMhQWbseR7zet+LrR4FnY6ML7N Hvu3lt7KItyjhAkn7iYj+RZfrEvD9yy1QSBRL03IU5pT/xHUccRKNkt7vumoZAYkxpxP VGDkMZ/W+dSiQ78Bz/J7p6k07JLuFlt+2rHE0VPjgBr0Ie4DbaD7XS+t5ombtuXKUsKf O29aCfg4LjeK3adrOfNNy4MhfO8PycMljJWDLsBNO3QYlzmAtQ1gPGo5/oyKe4BMoMbr pJWA== X-Gm-Message-State: AHQUAua1m8APgKgh2Wwe/s10vR45ahfG4OX52BKUddRMLcbhX4i4p3Vi l6U0WOH2JWl3REjNjlrAYmbZ6L+ARXTbQsr9 X-Google-Smtp-Source: AHgI3IZZKb3emG1YuozCOPR0/+nmDC20ZEBqJ2Ed93nAx6jh1XJfeyZHbva3Xzdkpnan4r/HjinJIg== X-Received: by 2002:a63:554b:: with SMTP id f11mr27834438pgm.37.1550633602579; Tue, 19 Feb 2019 19:33:22 -0800 (PST) Received: from lenovo.pebenito.net ([173.239.195.26]) by smtp.gmail.com with ESMTPSA id 62sm21395809pgc.61.2019.02.19.19.33.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Feb 2019 19:33:21 -0800 (PST) Message-ID: <2e6ab3f9266037e311f91fbd42d96970e1904eec.camel@ieee.org> Subject: Re: [PATCH] New interface to dontaudit access to cert_t From: Chris PeBenito To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" Date: Tue, 19 Feb 2019 19:33:21 -0800 In-Reply-To: <2e4ccece-4ca3-37fa-f76c-97d37e2f5534@tresys.com> References: <20190212130456.11572-1-dsugar@tresys.com> <8982046d-990a-29f5-6d76-d202ce647845@ieee.org> <4563f4e3-7525-f19c-55a6-45caca5786f7@ieee.org> <2e4ccece-4ca3-37fa-f76c-97d37e2f5534@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 Sun, 2019-02-17 at 16:34 +0000, Sugar, David wrote: > > On 2/16/19 2:40 PM, Chris PeBenito wrote: > > On 2/14/19 8:56 AM, Sugar, David wrote: > > > > > > On 2/13/19 6:42 PM, Chris PeBenito wrote: > > > > On 2/12/19 8:05 AM, Sugar, David wrote: > > > > > I'm seeing a bunch of denials for various processes (some > > > > > refpolicy > > > > > domains, some my own application domains) attempting to > > > > > access > > > > > /etc/pki. They seem to be working OK even with the denial. > > > > > Adding > > > > > interface to dontaudit this stuff and calling the interface. > > > > > > > > > > type=AVC msg=audit(1549932300.668:266): avc: denied { > > > > > search } for > > > > > pid=7077 comm="X" name="pki" dev="dm-1" ino=138 > > > > > scontext=system_u:system_r:xserver_t:s0-s0:c0.c1023 > > > > > tcontext=system_u:object_r:cert_t:s0 tclass=dir permissive=0 > > > > > type=AVC msg=audit(1549932306.553:430): avc: denied { > > > > > search } for > > > > > pid=7345 comm="clamd" name="pki" dev="dm-1" ino=138 > > > > > scontext=system_u:system_r:clamd_t:s0:c1 > > > > > tcontext=system_u:object_r:cert_t:s0 tclass=dir permissive=0 > > > > > > > > My guess is there is some common library between them (maybe > > > > glibc) > > > > which is triggering this. It seems like this might potentially > > > > cover up > > > > legitimate access. It's just hard to tell by just dir > > > > searches. > > > > > > > > > > Digging into this I have found a few things, and please note that > > > I am > > > not seeing this denial in permissive. > > > > > > Looking at strace for clamd I see an attempt to open the (non- > > > existent) > > > file /etc/pki/tls/legacy-settings. I think this would explain > > > the > > > denial on dir search. > > > > > > If I create that file (even empty) labeled cert_t I see denials > > > (in > > > permissive) for clamd_t cert_t:file { getattr open read }. > > > > > > audit2allow suggests the boolean 'authlogin_nsswitch_use_ldap' > > > should > > > resolve the issue (for clamd_t). This makes sense as clamd uses > > > the > > > interface auth_use_nsswitch(clamd_t). > > > > > > So, assuming that I don't want to enable > > > 'authlogin_nsswitch_use_ldap' > > > is there a way to quiet this denial? > > > > The dontaudit could go in the else block for that tunable. > > > That works for me. In this case though, should I leave the interface > as > proposed before or would it be more preferable to don't audit access > to > cert_t files along with directories? The latter is preferable. -- Chris PeBenito