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=-3.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS 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 395A6C43387 for ; Sat, 5 Jan 2019 19:39:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A2E4222FE for ; Sat, 5 Jan 2019 19:39:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="PrA+4P7X" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726332AbfAETjd (ORCPT ); Sat, 5 Jan 2019 14:39:33 -0500 Received: from mail-qk1-f177.google.com ([209.85.222.177]:39169 "EHLO mail-qk1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfAETjd (ORCPT ); Sat, 5 Jan 2019 14:39:33 -0500 Received: by mail-qk1-f177.google.com with SMTP id c21so7426673qkl.6 for ; Sat, 05 Jan 2019 11:39:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=NoYe+TR3vCfFcbI3uZEcshcRTJOkVD/7JrgvWdq8Odo=; b=PrA+4P7X5XerXQMRKgJ1EfBmNkCrghqqNOF7uoM1VdrIGl8UZJkZaEgS2HQOR1vkIt ahyFpyuVi8ZGkZsFGSNHOuE0xH4umhGkh2HE9gI3V1ILWrP5LyiRg605StgYmn1ni6SZ mGxYjVDo4kXBtH4BPQ9dv+oUqKCbBblzSmW5k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NoYe+TR3vCfFcbI3uZEcshcRTJOkVD/7JrgvWdq8Odo=; b=sCaeMaVG3HbQcRtGGkBsrRsmSb18txA14/IduH4tBvmuP9OIUZ/Zr8qL7ZBwBdJHPC 2j6Fll5D7TF8xYVMZeqJnnTRMrVen4Bu1bcbU7C2OkzcNTfrbwIOdgrqz7oyZvwlM10W Kt+G5HZdJZFyG6yKNYmWU3yojeQY2f2Q+41esoOGOOj9PAeRzxLQtoKicUnEe6hSTFoE bLBl+po2kMptOkd1+MDviA2/luXgcG1EEW9zsK9HXrsjKns+a7Okpwu/Mbn3TmLw+ysq 9c3Hdlom1z+XKXkJcL1RDUsxzv8h82nb+MCYqDmQ6+RiiHPK+xdVws7h0EjP6bTKafth 4jEw== X-Gm-Message-State: AJcUukfqpDtoud4YzN6Hael6HBB0WVJ19Q59CSbUsvcH+ohwqcWy1vWu rIryv916QBUiDfsCIxRBsu40z3kwu8M= X-Google-Smtp-Source: ALg8bN4bv4tHMc9YmwLDs5xRimycCYt9/cCVdCEhxwfh5lMnUgGI8Te1kJHuDkGNwKImMf95u+1xXg== X-Received: by 2002:a37:6005:: with SMTP id u5mr49327017qkb.219.1546717171942; Sat, 05 Jan 2019 11:39:31 -0800 (PST) Received: from [192.168.1.190] (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id n92sm26564809qtd.85.2019.01.05.11.39.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Jan 2019 11:39:31 -0800 (PST) Subject: Re: net_admin To: Russell Coker , selinux-refpolicy@vger.kernel.org References: <3956956.VbaQatea7V@liv> From: Chris PeBenito Message-ID: <241cb8eb-6c7b-4f6f-3a8b-dc3ff4af07b3@ieee.org> Date: Sat, 5 Jan 2019 14:33:14 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <3956956.VbaQatea7V@liv> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 1/4/19 8:31 PM, Russell Coker wrote: > allow crond_t self:capability net_admin; > allow policykit_t self:capability net_admin; > allow postfix_cleanup_t self:capability net_admin; > allow postfix_master_t self:capability net_admin; > allow postfix_pickup_t self:capability net_admin; > allow postfix_qmgr_t self:capability net_admin; > allow postfix_smtp_t self:capability net_admin; > allow system_dbusd_t self:capability net_admin; > > Above are some of the output from audit2allow on my laptop running the latest > Debian/Unstable. > > Seems that some recent library changes have made lots of programs try to > change socket buffer sizes in a way that requires net_admin. This isn't a > sudden thing, it's been slowly increasing over time. > > /* Allow interface configuration */ > /* Allow administration of IP firewall, masquerading and accounting */ > /* Allow setting debug option on sockets */ > /* Allow modification of routing tables */ > /* Allow setting arbitrary process / process group ownership on > sockets */ > /* Allow binding to any address for transparent proxying (also via NET_RAW) */ > /* Allow setting TOS (type of service) */ > /* Allow setting promiscuous mode */ > /* Allow clearing driver statistics */ > /* Allow multicasting */ > /* Allow read/write of device-specific registers */ > /* Allow activation of ATM control sockets */ > > #define CAP_NET_ADMIN 12 > > Above from capability.h has the list of things that net_admin might be for. I > don't know what the debug option on sockets is or the process/process group > ownership. Setting TOS and multicast are things that many root owned > processes might want to do. I've been hesitant to put in dontaudit rules > because there are many programs like the Postfix master process which might > have a legitimate need for debug mode, process ownership, or TOS. > > Below are some of the audit log analysis of denials for setting buffer size. > Those programs work ok without it. > > Should we have a tunable for dontauditing this? I'm not a fan of a tunable, as it seems like unnecessary overhead. If anything I'd put it under the hide_broken_symptoms build option. -- Chris PeBenito