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=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_PASS,URIBL_BLOCKED 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 646A7C43381 for ; Tue, 26 Feb 2019 12:32:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33630217F5 for ; Tue, 26 Feb 2019 12:32:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pmnhljyk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726245AbfBZMc6 (ORCPT ); Tue, 26 Feb 2019 07:32:58 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:39327 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726350AbfBZMc6 (ORCPT ); Tue, 26 Feb 2019 07:32:58 -0500 Received: by mail-ed1-f68.google.com with SMTP id p27so10572862edc.6 for ; Tue, 26 Feb 2019 04:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+we1XGHK0QLpAhP5YR+4XtcT4J6cP9emJxS44xZ8WSU=; b=pmnhljykQS3GnE0DPcx+dQODZtH/XYEgpUE7KcwysDYq1eipumorMR+FMRLqFKTiCz IcVqB8zyh8bLhVwf3JtdY8O9CsVXkk0/w8q9kAMNdbeuqRStSbkrMHK8Ogl0VBa/oyB4 LLE4cAsyNukftG5hdpMpqeykTwAjUaPmo3Z1KYI2t864gTK2Kgx7vNuaVL9pwZLkqsHc J8br1KJFjpUOh/2651/zY200fmpsa9SAr8aFQDJ1QT9TDqSaeg00YOdESzzdJmH8ogKR llUJca32yRli2GV07lOJ8UMldKeTNEc3qfqYC/YzkTmrWpt9BlYGc9wI+RnyNQ9mPReW /xyA== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+we1XGHK0QLpAhP5YR+4XtcT4J6cP9emJxS44xZ8WSU=; b=Zm+uqOXBhGMKgViygyKadlKxu9ma58OxLCLIkfr5kpFCZBLe/A6QIrZUsToMCncOm6 lbhD3mdkPtljRdzt8PVzxCOmoCVCzaiROlVu9kXXbNTsPC/l+iDRGP+yoZrAFrAk4FIr gJ7GiJXs3Sc7IRYRcopSM/UvcszEjxEYmGzQasAAFoW1yawU2iRqW+mILzJduaix3WbZ lzq60PoqrvwfIZ6z3PCxHTE3KY1yRlI5mhZ+5K7FcGYYsQJQeb7wbkxYBsM4vq2vsgfq MrAiIzlhkC8HR6k720q7eaQJ3Yf9eRizAXSga6cvHqZucqw5j1MinnJvaqfwCaZ5qGkQ iiGQ== X-Gm-Message-State: AHQUAuZVqTnsyll6sWG90RseITwEdlR0LiARRZ5YHBaqZLcO2yd8Yvwx 9UqwHeuf3VxDxstp3WJ+kJ8age4o X-Google-Smtp-Source: AHgI3IYLrhkerVtCTULH9YDDGXrF7Sz6dO/UlNOPMq2rH8XqeM0fQSjtEAEw7P0lGjT0xQKAaFDq0w== X-Received: by 2002:a05:6402:184f:: with SMTP id v15mr18896282edy.133.1551184376600; Tue, 26 Feb 2019 04:32:56 -0800 (PST) Received: from brutus (brutus.defensec.nl. [2001:985:d55d::438]) by smtp.gmail.com with ESMTPSA id m10sm3445355edd.2.2019.02.26.04.32.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 04:32:55 -0800 (PST) From: Dominick Grift To: "Sugar\, David" Cc: "selinux-refpolicy\@vger.kernel.org" Subject: Re: [PATCH] Allow AIDE to sendto kernel datagram socket References: <20190225233708.15319-1-dsugar@tresys.com> <20190225233708.15319-4-dsugar@tresys.com> <87pnrf9h34.fsf@gmail.com> Date: Tue, 26 Feb 2019 13:32:55 +0100 In-Reply-To: (David Sugar's message of "Tue, 26 Feb 2019 12:28:10 +0000") Message-ID: <87lg22afwo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org "Sugar, David" writes: > On 2/26/19 1:52 AM, Dominick Grift wrote: >> "Sugar, David" writes: >> >>> type=AVC msg=audit(1550799594.394:205): avc: denied { sendto } for >>> pid=7182 comm="aide" path="/dev/log" >>> scontext=system_u:system_r:aide_t:s0 >>> tcontext=system_u:system_r:kernel_t:s0 tclass=unix_dgram_socket >>> permissive=1 >> >> Is this not part of logging_send_syslog_msg()? It should be AFAIK. >> > Looking at logging.if I don't see any kernel interfaces used. So, no it > isn't in there currently. Based on how logging seems to now work with > journald it might be a good idea to move these individual uses and just > rely on the loggin_send_syslog_msg interface to take care of it. > I see. I will let other decides on how to deal with this. In dssp2 i have: (call sys.unix_dgram_socket_sendto (client_subj_type_attribute)) (call sys.unix_stream_socket_connectto (client_subj_type_attribute)) Not sure why i also added the "unix_stream_socket connectto;", but i suppose there was a need for it at some point at least. > I'm happy to make this change if that is desired. > >>> >>> Signed-off-by: Dave Sugar >>> --- >>> policy/modules/admin/aide.te | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/policy/modules/admin/aide.te b/policy/modules/admin/aide.te >>> index 9d3c19ce..6297b60e 100644 >>> --- a/policy/modules/admin/aide.te >>> +++ b/policy/modules/admin/aide.te >>> @@ -35,6 +35,8 @@ logging_log_filetrans(aide_t, aide_log_t, file) >>> files_read_all_files(aide_t) >>> files_read_all_symlinks(aide_t) >>> >>> +kernel_dgram_send(aide_t) >>> + >>> logging_send_audit_msgs(aide_t) >>> logging_send_syslog_msg(aide_t) >> -- Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift