Received: by 10.223.176.5 with SMTP id f5csp19347wra; Fri, 2 Feb 2018 15:40:24 -0800 (PST) X-Google-Smtp-Source: AH8x2252yZ1Gku/rwRBAbemVPDW1o9R6m/37eq0pcla80b1pIDquh1D43fPLMdpst/EvZQyR0oJ0 X-Received: by 10.98.69.82 with SMTP id s79mr41376928pfa.214.1517614824840; Fri, 02 Feb 2018 15:40:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517614824; cv=none; d=google.com; s=arc-20160816; b=THh3yoEooZayIiUSm7M6kFl+oq20BUhSSvzCBt7+M/kEimRmCDgyR5JPHv4wXOVrfR eH7euYmBRhtJ+ANxxAgY55fJqp7xw4u7PjHWAK6hqnncOKoQXrouOzrW79wvSkGhE79s EN5U3xUHuBrg8GzNwoRKhw73ELl/iN+YJ9slr2aTS2CyLwQq93LcPz6e9E+8sIhpOdZj H6eLWdHzG82WB/l6k44tpYBipCNSNbJoHfS7cgBREREpuYvNncfcKhMShQbJRPRS5zqK iH2gOT0IELVrbdwypPL5yGn72n0bjdIububnceCDJuETd9BZ1+77hU6Br1qJA/PNvLPc RXVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=CgU1xJeHCDp3vl3H8Z/vTnDcE10aw1fHK/kfjykxZbk=; b=CtR3w1TmPChL32OTEuE01lTRTJVlYSOlMamUNvJO38DFbt1PNVP/1r7qfTLFAhdKpp dHzhQXOaAzv3sIVWKCOf3z0cRquxxnwHGY1nmtk2m3UURdI0tgi+6mw+rzpu/Odq7R8i dUcb8WQVWcu1plV2GCwxKzcCCzaXpd5DCoq+KaNJpuX6hZz+ihA662VAMzC0Zt+8RK7g fLpJhKxU21c2qYmKBA87AjGtrOPhShSZFgBaOqaZRMPQ9gQm3bAxzj76BqNkTCg+52Nl slmm5cXAp3Sgo4FxVgzAdYTKctzr+qMWRKRKhiIB9rtLQOLnX0tsK+Qo5VF5gt88qJXN nScA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=GWPL1a8J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6-v6si2655009plo.702.2018.02.02.15.40.09; Fri, 02 Feb 2018 15:40:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=GWPL1a8J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752293AbeBBXY4 (ORCPT + 99 others); Fri, 2 Feb 2018 18:24:56 -0500 Received: from mail-lf0-f48.google.com ([209.85.215.48]:45720 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752484AbeBBXYu (ORCPT ); Fri, 2 Feb 2018 18:24:50 -0500 Received: by mail-lf0-f48.google.com with SMTP id x196so33772349lfd.12 for ; Fri, 02 Feb 2018 15:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CgU1xJeHCDp3vl3H8Z/vTnDcE10aw1fHK/kfjykxZbk=; b=GWPL1a8JbzA+KOP18IRbwDwHLbNd7nxzc8USm+7Qt0It8Wrl7eagnRx5p/MZmjlUwl Jo6VD/ewjrai2R/GPTtHVz8mgcOIuCjjhRNqope+SrQLLYK/knng2N5AmpcMh8bQKvWJ st0tchrWzLO0dyil5sWe6p6W7pW8kGvpb4USl8kGaJbukyB2ixzUXf3h9nmQlWHmHBb3 thYQw4ugFL7L9HB61ORWjm8GZAbdYsigyHH4raYUtEJI5jzjDIvE0y4JZjZCk8k+rpBh DA5vzajFwr7RaB36QzaBO6WdxxXwNVicirE2FfV0keiSyTD8FFK/sSNmNzDLexUgwk0P r2mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CgU1xJeHCDp3vl3H8Z/vTnDcE10aw1fHK/kfjykxZbk=; b=L0hg/rrwKrdP2Y8twO1Y0m5T/PkKKnuB7f7Zd5FXLpVDJQYVaAHJweC3usbbWUQLQP vizsGdT6yQBd7W4A9Cz6k9D9a6lx3nps4eiEi33NGBB7Mr21yl2NPMKdC1Hn6BQ6+FsB 9YYtoDFWtGnO5HgQg0HcOGKxiRDXHFNyvyPYFhkeCRF/DBLBPmcilR26kxUFZWk/d8JE oC/4rI8XOwowNyKFl185+3wtPcO908DyAqYKeQulJIQfS1qH10/ZBfp4D+A1BLYQEY4H h6fd9ZG0OSERk3voJl7fR5D0Xbr9xXQ8OsiNkdFyJu5v46Qruo5perSQgzVLuIK1u3pw /5dg== X-Gm-Message-State: AKwxytcI27pmSyUo/z5QHpo1VbDnwtlwiHKSyebidfb+Kz0ulrwZ7U1d hpy9Nn6dNVWdLe2kB070Kpej0gn3q5VeVN81/BfC X-Received: by 10.46.87.20 with SMTP id l20mr2752592ljb.71.1517613888643; Fri, 02 Feb 2018 15:24:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.216.145 with HTTP; Fri, 2 Feb 2018 15:24:47 -0800 (PST) X-Originating-IP: [108.20.156.165] In-Reply-To: <1517609946.13097.161.camel@redhat.com> References: <20180109121620.wi7dq2423ugsraqv@madcap2.tricolour.ca> <1515514736.3239.10.camel@redhat.com> <20180110070011.l4rcdcwb27witfem@madcap2.tricolour.ca> <1517609946.13097.161.camel@redhat.com> From: Paul Moore Date: Fri, 2 Feb 2018 18:24:47 -0500 Message-ID: Subject: Re: RFC(V3): Audit Kernel Container IDs To: Simo Sorce Cc: Richard Guy Briggs , David Howells , cgroups@vger.kernel.org, jlayton@redhat.com, trondmy@primarydata.com, "Serge E. Hallyn" , mszeredi@redhat.com, Al Viro , Andy Lutomirski , Eric Paris , "Carlos O'Donell" , Linux API , Linux Containers , Linux Kernel , Linux Audit , "Eric W. Biederman" , Linux Network Development , Linux FS Devel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 2, 2018 at 5:19 PM, Simo Sorce wrote: > On Fri, 2018-02-02 at 16:24 -0500, Paul Moore wrote: >> On Wed, Jan 10, 2018 at 2:00 AM, Richard Guy Briggs wrote: >> > On 2018-01-09 11:18, Simo Sorce wrote: >> > > On Tue, 2018-01-09 at 07:16 -0500, Richard Guy Briggs wrote: ... >> > Paul, can you justify this somewhat larger inconvenience for some >> > relatively minor convenience on our part? >> >> Done in direct response to Simo. > > Sorry but your response sounds more like waving away then addressing > them, the excuse being: we can't please everyone, so we are going to > please no one. I obviously disagree with the take on my comments but you're free to your opinion. I believe saying we are pleasing no one isn't really fair now is it? Is there any type of audit container ID now? How would you go about associating audit events with containers now? (spoiler alert: it ain't pretty, and there are gaps I don't believe you can cover) This proposal provides a mechanism to do this in a way that isn't tied to any one particular concept of a container and is manageable inside the kernel. If you have a need to track audit events for containers, I find it extremely hard to believe that you are not at least partially pleased by the solutions presented here. It may not be everything on your wishlist, but when did you ever get *everything* on your wishlist? >> But to be clear Richard, we've talked about this a few times, it's not >> a "minor convenience" on our part, it's a pretty big convenience once >> we starting having to route audit events and make decisions based on >> the audit container ID information. Audit performance is less than >> awesome now, I'm working hard to not make it worse. > > Sounds like a security vs performance trade off to me. Welcome to software development. It's generally a pretty terrible hobby and/or occupation, but we make up for it with long hours and endless frustration. >> > u64 vs u128 is easy for us to >> > accomodate in terms of scalar comparisons. It doubles the information >> > in every container id field we print in audit records. >> >> ... and slows down audit container ID checks. > > Are you saying a cmp on a u128 is slower than a comparison on a u64 and > this is something that will be noticeable ? Do you have a 128 bit system? I don't. I've got a bunch of 64 bit systems, and a couple of 32 bit systems too. People that use audit have a tendency to really hammer on it, to the point that we get performance complaints on a not infrequent basis. I don't know the exact number of times we are going to need to check the audit container ID, but it's reasonable to think that we'll expose it as a filter-able field which adds a few checks, we'll use it for record routing so that's a few more, and if we're running multiple audit daemons we will probably want to include LSM checks which could result in a few more audit container ID checks. If it was one comparison I wouldn't be too worried about it, but the point I'm trying to make is that we don't know what the implementation is going to look like yet and I suspect this ID is going to be leveraged in several places in the audit subsystem and I would much rather start small to save headaches later. We can always expand the ID to a larger integer at a later date, but we can't make it smaller. >> > A c36 is a bigger step. >> >> Yeah, we're not doing that, no way. > > Ok, I can see your point though I do not agree with it. > > I can see why you do not want to have arbitrary length strings, but a > u128 sounded like a reasonable compromise to me as it has enough room > to be able to have unique cluster-wide IDs which a u64 definitely makes > a lot harder to provide w/o tight coordination. I originally wanted it to be a 32-bit integer, but Richard managed to talk me into 64-bits, that was my compromise :) As I said earlier, if you are doing container auditing you're going to need coordination with the orchestrator, regardless of the audit container ID size. -- paul moore www.paul-moore.com