Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp710280ybg; Tue, 9 Jun 2020 10:50:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPN5OdGpMo3+SsAE2WzihcV/Q1n5rOhpoONu1qQMhYOfIzlePmNMKSwHdWMLxuPeSlEMWM X-Received: by 2002:a17:906:200a:: with SMTP id 10mr26138051ejo.294.1591725033980; Tue, 09 Jun 2020 10:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591725033; cv=none; d=google.com; s=arc-20160816; b=n2cOHx0E5S8IBgqBvJSYi/ymt75+v6J42AGdT+5noimlDy4mpN5OSSYC0Bz2DAk1g6 e18/y8dgcoaD6QmFB5KeIUZt5JbFivNkFMYILlFtcjMGZ4HwDnefks2oTBONutRlcl/R /f9ca6xdKvxd7qTRpXExLy/m/owKYkkTk3ZYjWH0ja2y81MoA7SgNfAFPg4I/vFz3gF3 w4RWkSRP5n99vSskONXfXuHMO/1BI02hAa5If6sFjjsa2jRtMbHYiseQJkryyMHwsfNm m15HlgPn1B/JmkAqepIlQxKk/7xJ9+ANHEC1neD/Iqr0zXHAxePK3xB1wJvZLxcEBdx5 4pew== 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=WkMSWOBEMcZxCr/lBlsLlRkLTBokiJBDduFX5I7V3BE=; b=CxQw7wNZfN7TTiC5x+aze0X/TlNuqvu26UDXXkPhw3vfDC6TWfRjkuqBl37WJwN88F Uai54xLkDQsR5sJc9RVSmAo5O8cHTGEONht3nWYVg9OkKYfGLYKcwcWMahAY2Fxe26Zd JGNvvpDstyxV0c7HEDRy8t0JneEf1IJQbqZkefq/JWRQ3QvwsGNp1Kx52BMIEs+mmx55 je7YECgd9j5VWVrQhxFs5FmKWtAnsOUfEgs1bOaKA6Q1b0hK+a6f0CouT0+NNK5ahYg+ A+eF1aKgQLYBlGpZFD8xPXs+LyigK93z6POlLbbsLL3QWv9a2mywkTzKdja7MYB+QMw3 1GPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=FCzHnhd2; 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 c11si12804341edn.383.2020.06.09.10.50.11; Tue, 09 Jun 2020 10:50:33 -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=FCzHnhd2; 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 S1731029AbgFIP6E (ORCPT + 99 others); Tue, 9 Jun 2020 11:58:04 -0400 Received: from linux.microsoft.com ([13.77.154.182]:53034 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730640AbgFIP6D (ORCPT ); Tue, 9 Jun 2020 11:58:03 -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 B053620B717B; Tue, 9 Jun 2020 08:58:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B053620B717B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1591718282; bh=WkMSWOBEMcZxCr/lBlsLlRkLTBokiJBDduFX5I7V3BE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=FCzHnhd2K9TkZSTHvhIULaVL/CIXp/M9Cz+mcJlcIDvHz1yKNqHML4uG+5BsQVbMo 9tEEprfz663FYe5ivH9HowLfjACAJEkC0vyZfj0lZYoPoqb/PMUQHdq0InTZhUbN5c hE1nDELVH9dr+dHBRBElhv8WfzJbWlCe/Rxa8Rfc= Subject: Re: [PATCH v3] IMA: Add audit log for failure conditions To: Steve Grubb , linux-audit@redhat.com Cc: 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> From: Lakshmi Ramasubramanian Message-ID: Date: Tue, 9 Jun 2020 08:58:02 -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: <27448076.Og45N0Lxmj@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 8:40 AM, Steve Grubb wrote: > On Monday, June 8, 2020 5:53:43 PM EDT Lakshmi Ramasubramanian wrote: >> The final log statement in process_buffer_measurement() for failure >> condition is at debug level. This does not log the message unless >> the system log level is raised which would significantly increase >> the messages in the system log. Change this log message to an audit >> message for better triaging failures in the function. >> >> ima_alloc_key_entry() does not log a message for failure condition. >> Add an audit message for failure condition in this function. >> >> Sample audit messages: > > Wouldn't it be better to have an IMA_ERROR record type? type "1804" is AUDIT_INTEGRITY_PCR which is used for failures to add to the measurement list. > >> [ 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(-22) > > The audit system uses a name=value scheme to express information. This last > field has something in parenthesis that may need to be interpreted. In its > current form, we can't do this. It would require writing code to special case > this event, go to this field, find the first parenthesis, find the second, > extract what's between, and look it up. > > It would be better if that number in parenthesis was normalized to the > expected way we do audit events so nothing special has to be made. 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 thanks, -lakshmi