Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp778799ybg; Tue, 9 Jun 2020 12:35:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKpQ6Yo8o1qqZQxsps6JPkPCQvMu4PWSRQXBvboQKbz9DhifF9EaXIim27/luhGHkdRIEW X-Received: by 2002:a17:906:c952:: with SMTP id fw18mr26448694ejb.505.1591731313932; Tue, 09 Jun 2020 12:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591731313; cv=none; d=google.com; s=arc-20160816; b=QmWSkAUrO1EK/B0qXJjD9/zwGa96fpuB8Snjx82lrVPBJ7MPwjRn0egwp1mDu8/W0i oZxAIQLqQA2lSq9KbYky/tdwzQDcNkcHBy0ObWSY2ZIvE8rguZQsqN0DC7Lu41jH28RU WHPpCHMHbO+mkXMWPoII5eqEcz5H/l8dSb+OwOhRm00O5dejckrErVICom1sGZJ/+9dj rCm5iboYBScxUBX2LSf0osk0Jw+SdmPCGRsS97oK9tl25A4kzjuLBOoO+k4bo4xUFE/e UMQ7ZAxFqI+SqgtKf/2Edx5kV6aWz7p7D5RdXYDjmVBaYlGD57KvIT3CDcFfGJbY8yyi t7zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=eHqftMUsYLvGMdmTnyPr8237agaQbFw3GmsqdWzzSEI=; b=mzsqL4dANPpSN7/wOmMfjIc6pTMESoRGM6ttmAJqdwW+WTpsDzgltidfEhXswQpSLl Ss8XwaT9fV5e//ojxi1Me0Pb825fmD40lJKuwk5wyShGFseMPOaKdCJLfBop2UyoVPgA V4egIA1f3nGXs1ANXwkbKHysB9Uqhll3NNOyGBChMy8uj2Pxfyq0+E1RUyKlsMr9NCa6 RsAIhY32UhraCzXQyDHMaZmi85mesoaBiYc2ORbtjK/FRIOoBaZLTf5bRsXqk8IgjMCs Ml9R+Y2FXeW5PV/j0Zw6jCDi4cUnDytKo5jBHm5XRT5lS/CFID+q4IKF5Zn79knlQMdP 3ArQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=QFNe6S3s; 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=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si11775848ejr.561.2020.06.09.12.34.50; Tue, 09 Jun 2020 12:35:13 -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=@linux.microsoft.com header.s=default header.b=QFNe6S3s; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731304AbgFIRAy (ORCPT + 99 others); Tue, 9 Jun 2020 13:00:54 -0400 Received: from linux.microsoft.com ([13.77.154.182]:45178 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731252AbgFIRAy (ORCPT ); Tue, 9 Jun 2020 13:00:54 -0400 Received: from [192.168.0.104] (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id 8740B20B717B; Tue, 9 Jun 2020 10:00:53 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8740B20B717B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1591722053; bh=eHqftMUsYLvGMdmTnyPr8237agaQbFw3GmsqdWzzSEI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=QFNe6S3sAJRGrAyO/dmtBvFD5IVr/ErIwOycCD37C77Bcyy7Ke8pVwuMbfDVs9hIc qREtSaDGXeXQZr0PSrMIFQIUlyuBqEJY0VNGXIml0CkioWd7Dnq9OttoCW12c/X+RM C4hj9MsS9FZ1B0BOp3FcvoX07Cs36QrygHqkJjso= Subject: Re: [PATCH v3] IMA: Add audit log for failure conditions To: Steve Grubb Cc: linux-audit@redhat.com, zohar@linux.ibm.com, paul@paul-moore.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200608215343.4491-1-nramas@linux.microsoft.com> <27448076.Og45N0Lxmj@x2> <3776526.Vj75JV9fuy@x2> From: Lakshmi Ramasubramanian Message-ID: <518a51b7-6c8d-f55f-c73a-b15abae8e0af@linux.microsoft.com> Date: Tue, 9 Jun 2020 10:00:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <3776526.Vj75JV9fuy@x2> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). 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