From nobody Fri Aug 18 16:13:07 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RS6Ng52XDz4qkXW for ; Fri, 18 Aug 2023 16:13:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RS6Ng1NSzz3N07 for ; Fri, 18 Aug 2023 16:13:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692375187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TnCQnfH/4YGXME715eSiOSLFNTwQf2uMfTZ+NT1XQWc=; b=KsnZn2r+0FFoxctvInuChzwNyWzLsafEBi5qlZQJwVQODbRBgVj4nvQonu9Vgl4ZGbZPmW Tc0cE/ivKJ8xh37z8Tnr4LgtuF0F03K5Pwwmr1pHdlf8FwvgqjgxuTYiFSUoVZOmAD+7AP WAc4ii/M7ZsHoAOHyZxSkOl9KvlsN/RkxM4TzKA6kl7e6XwvWO95kO197aFmOjw0Lr5bsI AxWZN4rEfhalbkQ5k77MKa/dLgS7kxSYHVFzvykVns9Qa18T6p95hHtJu9qHfHDmUsrHVy fkrlT+YhsNXjTUDpyNL4Mbnq/cTWpkE1aEivvdWvjM9B4S8FZ0Ht+4Urk33O7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692375187; a=rsa-sha256; cv=none; b=hm7nW9D0wDHgXf8j/feXZziY7JDKVcF5yEAgXngIaW4P9MQ7MHS7GSNLW59IREbdJgOhyK sHUxuvdWe0XG82luD4MJj1YYHX198Q0XmpDbv0+2UvyQI1ApEqqekZCk63QbkQNBjeY0so t1UH0C1lnRgdW2pKZ1oGtDdCFrv9sG3RB3wE0G0v8wiWxoiQaul3DqdCihrkN2/8fKGphn uef6Lfi96uTeEUzgGKSLJaEOYMf3B1lx9sH49Pg3QZXMS0CbDHAaaq043T//VepSBLsZU/ TLy+Gnas6Yx5JzlUIJY4JDY5N/d+e1uARmW2fNKsvQ7J8bBI36iowMWIFYq3Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RS6Ng0SZKz7d2 for ; Fri, 18 Aug 2023 16:13:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 37IGD7u0083739 for ; Fri, 18 Aug 2023 16:13:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 37IGD7BI083738 for bugs@FreeBSD.org; Fri, 18 Aug 2023 16:13:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 273208] An rc script for mac_portacl(4) Date: Fri, 18 Aug 2023 16:13:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: tom@hur.st X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273208 Bug ID: 273208 Summary: An rc script for mac_portacl(4) Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: conf Assignee: bugs@FreeBSD.org Reporter: tom@hur.st Created attachment 244195 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D244195&action= =3Dedit Dreaming of being /etc/rc.d/portacl mac_portacl(4) is a kernel module providing access control policy for netwo= rk service port binding, allowing for specified users and groups to bind to otherwise root-privileged ports. Currently to make use of this, the module must be loaded, the rules set in a sysctl in a single line with only numeric ID's allowed, and the stock reser= ved ports sysctl needs to be set to disable enforcement. For example, allowing user www, uid 80 to bind to ports http and https: net.inet.ip.portrange.reservedhigh=3D0 security.mac.portacl.rules=3D"uid:80:tcp:80,uid:80:tcp:443" Attached is the first-cut of an rc script which allows for configuration us= ing only rc.conf variables, including mapping user and service names to their numeric equivalents. For example the above configuration would be achieved with: portacl_enable=3D"YES" portacl_users=3D"www" portacl_user_www_tcp=3D"http https" This uses dynamic variables of the form portacl_{user,group}_${name}_{tcp,u= dp} to configure each portion of the ruleset. Existing raw rules can be combined: portacl_additional_rules=3D"uid:143:tcp:993" Existing rules and other relevant oids set in /etc/sysctl.conf{,.local} are overridden, but a warning is issued if any are found. Development is currently taking place here: https://github.com/Freaky/porta= cl --=20 You are receiving this mail because: You are the assignee for the bug.=