Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp712232ybg; Tue, 9 Jun 2020 10:53:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsA/LNYmU4bqZaLnDkcpP49tLlEQxV2pd6fh+/8YBnjHMbI/GRe6xIdCfbgNEN++lc/jST X-Received: by 2002:a17:907:20e5:: with SMTP id rh5mr27504134ejb.80.1591725232999; Tue, 09 Jun 2020 10:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591725232; cv=none; d=google.com; s=arc-20160816; b=hJZ7TikaRD+T0YcSUDVdGpu7KEIQ9HdiptvBDPSPkyNcLPW6znOfAs5qmr6307avp+ 4gM4YaP2svzEFZO7I8TlitG8OXsXXh56FDodUjV7ILbe0KBF6WuSWj2OP7++8Gg8xlK9 9uX2rjonj0PirGsqaw7YH5ibCrTvy4/+xse8n+0XMhrzGvjWSdUj2A365h/skcx5u016 EULxVAH17lr9ALWch2W7E72w6jDDx9IeJH1N1NPUAYfb4cP+H5wjGV7yIiU9O1DmJnC2 Tr9xzhf5pgJn5l8HJB4ULX+WvJYdVA85ftxPco2qomFiT1sv+Y1uYJdb3M5q2nELmod6 LGeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yXdiOQv7NKIBd+DVRCSCXdbaCUEn9kqsC6k0oYzgv1w=; b=BAtaVs8CGZ0Wy5vwz3b3WXznnOcZWhX0kDevbtxSCZjTQWP9s3L8D1DTyE5CSlgi1j mZJVFl/nZ+GyJmTJwk8z7U3EfbpC8TcdYwxCb/zRmMrrQ/G06PSaXdN2q5DT8dWQH8yH XV88UEkGjIFPtbJEpljbK30y/N64VAd20OcSDmALdfIweN2e73bmC9h7AxoSxNv8Vsfy ARJ5RvChHWgcbKsqsUgZ57d/UlsMSKzEbO9C1/LBp77G83ZCJpDrIiIXJXKXNZCXNb+V nqCNYXjOu0i6/rL6Mg8wYamXuLYOolU70ZCcuMsa66sukLn0HZLtcc3ea2GO9Ao3owq1 wtXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NUF5zRNz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si10231901eja.745.2020.06.09.10.53.29; Tue, 09 Jun 2020 10:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NUF5zRNz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731640AbgFIRQT (ORCPT + 99 others); Tue, 9 Jun 2020 13:16:19 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:56542 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729069AbgFIRQP (ORCPT ); Tue, 9 Jun 2020 13:16:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591722974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yXdiOQv7NKIBd+DVRCSCXdbaCUEn9kqsC6k0oYzgv1w=; b=NUF5zRNznQMQhhJfvHhkudLAi4CSKM0Pl16k/fNINUCs23kNZkLBKqXzR7UnlGCdCkfapx sVMHYind71xL7hemN2xQbgvcbIIyxnienxb17FE7ZUv+TNz4NWPVW6+SE5elqJYiF6Ku/6 OVykLBcfn4qd0hlNyN1wy+qwjpd3SYE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-wXJTdLcZNqyNdx8RFUaYTA-1; Tue, 09 Jun 2020 13:16:09 -0400 X-MC-Unique: wXJTdLcZNqyNdx8RFUaYTA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B2A2801504; Tue, 9 Jun 2020 17:16:08 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.10.110.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B39625D9E4; Tue, 9 Jun 2020 17:15:58 +0000 (UTC) Date: Tue, 9 Jun 2020 13:15:55 -0400 From: Richard Guy Briggs To: Lakshmi Ramasubramanian Cc: Steve Grubb , linux-integrity@vger.kernel.org, linux-audit@redhat.com, zohar@linux.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] IMA: Add audit log for failure conditions Message-ID: <20200609171555.itbllvtgjdanbbk7@madcap2.tricolour.ca> References: <20200608215343.4491-1-nramas@linux.microsoft.com> <27448076.Og45N0Lxmj@x2> <3776526.Vj75JV9fuy@x2> <518a51b7-6c8d-f55f-c73a-b15abae8e0af@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <518a51b7-6c8d-f55f-c73a-b15abae8e0af@linux.microsoft.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-09 10:00, Lakshmi Ramasubramanian wrote: > On 6/9/20 9:43 AM, Steve Grubb wrote: > > > > The number in parenthesis is the error code (such as ENOMEM, EINVAL, > > > etc.) IMA uses this format for reporting TPM errors in one of the audit > > > messages (In ima_add_template_entry()). I followed the same pattern. > > > > > > Would it be better if the value for "cause" is formatted as > > > > > > cause=hashing_error_-22 > > > > > > cause=alloc_entry_-12 > > > > Neither fit the name=value style that all other events follow. What would fit > > the style is something like this: > > > > cause=hashing_error errno=-22 > > cause=alloc_entry errno=-12 > > > > Would this be OK? Also, errno is only to illustrate. You can name it > > something else as long as there are no use case collisions with our > > dictionary of field names. > > > > https://github.com/linux-audit/audit-documentation/blob/master/specs/fields/ > > field-dictionary.csv > > I am fine with this. > > "errno" is currently not listed in the dictionary of audit message field > names (Thanks for the pointer to this one Steve) > > Mimi - please let me know if you have any concerns with adding the "result" > code in "errno" field in integrity_audit_msg(). If it is added, it should be appended to the end of the record since it is an existing record format, then in the case of res=1, errno= should still be present (not swing in and out) and just contain zero. (Or another value if there is a non-fatal warning?) > Sample message: > > [ 8.051937] audit: type=1804 audit(1591633422.365:8): pid=1 uid=0 > auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 > op=measuring_keys cause=hashing_error errno=-22 comm="systemd" > name=".builtin_trusted_keys" res=0 > > thanks, > -lakshmi - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635