1*4805589dSchristos.\" $NetBSD: secmodel_extensions.9,v 1.7 2022/03/27 16:36:11 christos Exp $ 2f3effc5eSjym.\" 3f3effc5eSjym.\" Copyright (c) 2011 The NetBSD Foundation, Inc. 4f3effc5eSjym.\" All rights reserved. 5f3effc5eSjym.\" 6f3effc5eSjym.\" This code is derived from software contributed to The NetBSD Foundation 7f3effc5eSjym.\" by Jean-Yves Migeon <jym@NetBSD.org> 8f3effc5eSjym.\" 9f3effc5eSjym.\" Redistribution and use in source and binary forms, with or without 10f3effc5eSjym.\" modification, are permitted provided that the following conditions 11f3effc5eSjym.\" are met: 12f3effc5eSjym.\" 1. Redistributions of source code must retain the above copyright 13f3effc5eSjym.\" notice, this list of conditions and the following disclaimer. 14f3effc5eSjym.\" 2. Redistributions in binary form must reproduce the above copyright 15f3effc5eSjym.\" notice, this list of conditions and the following disclaimer in the 16f3effc5eSjym.\" documentation and/or other materials provided with the distribution. 17f3effc5eSjym.\" 18f3effc5eSjym.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19f3effc5eSjym.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20f3effc5eSjym.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21f3effc5eSjym.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22f3effc5eSjym.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23f3effc5eSjym.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24f3effc5eSjym.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25f3effc5eSjym.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26f3effc5eSjym.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27f3effc5eSjym.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28f3effc5eSjym.\" POSSIBILITY OF SUCH DAMAGE. 29f3effc5eSjym.\" 30*4805589dSchristos.Dd March 27, 2022 31f3effc5eSjym.Dt SECMODEL_EXTENSIONS 9 32f3effc5eSjym.Os 33f3effc5eSjym.Sh NAME 34f3effc5eSjym.Nm secmodel_extensions 3525e68552Sabs.Nd extensions security model 36f3effc5eSjym.Sh DESCRIPTION 37f3effc5eSjym.Nm 38f3effc5eSjymimplements extensions to the traditional security model based on 39f3effc5eSjymthe original 40f3effc5eSjym.Bx 4.4 . 41f3effc5eSjymThey can be used to grant additional privileges to ordinary users, or 42f3effc5eSjymenable specific security measures like curtain mode. 43f3effc5eSjym.Pp 44f3effc5eSjymThe extensions are described below. 45f3effc5eSjym.Sh Curtain mode 46f3effc5eSjymWhen enabled, all returned objects will be filtered according to 47f3effc5eSjymthe user-id requesting information about them, preventing users from 48f3effc5eSjymaccessing objects they do not own. 49f3effc5eSjym.Pp 50f3effc5eSjymIt affects the output of many commands, including 51f3effc5eSjym.Xr fstat 1 , 52f3effc5eSjym.Xr netstat 1 , 53f3effc5eSjym.Xr ps 1 , 54f3effc5eSjym.Xr sockstat 1 , 55f3effc5eSjymand 56f3effc5eSjym.Xr w 1 . 57f3effc5eSjym.Pp 58f3effc5eSjymThis extension is enabled by setting 59f3effc5eSjym.Pa security.models.extensions.curtain 60f3effc5eSjymor 61f3effc5eSjym.Pa security.curtain 62f3effc5eSjym.Xr sysctl 7 63f3effc5eSjymto a non-zero value. 64f3effc5eSjym.Pp 65f3effc5eSjymIt can be enabled at any time, but cannot be disabled 66f3effc5eSjymanymore when the 67f3effc5eSjym.Em securelevel 68f3effc5eSjymof the system is above 0. 69f3effc5eSjym.Sh Non-superuser mounts 70f3effc5eSjymWhen enabled, it allows file-systems to be mounted by an ordinary user 71f3effc5eSjymwho owns the point 72f3effc5eSjym.Ar node 73f3effc5eSjymand has at least read access to the 74f3effc5eSjym.Ar special 75f3effc5eSjymdevice 76f3effc5eSjym.Xr mount 8 77f3effc5eSjymarguments. 78f3effc5eSjymNote that the 79f3effc5eSjym.Cm nosuid 80f3effc5eSjymand 81f3effc5eSjym.Cm nodev 82f3effc5eSjymflags must be given for non-superuser mounts. 83f3effc5eSjym.Pp 84f3effc5eSjymThis extension is enabled by setting 85f3effc5eSjym.Pa security.models.extensions.usermount 86f3effc5eSjymor 87f3effc5eSjym.Pa vfs.generic.usermount 88f3effc5eSjym.Xr sysctl 7 89f3effc5eSjymto a non-zero value. 90f3effc5eSjym.Pp 91f3effc5eSjymIt can be disabled at any time, but cannot be enabled 92f3effc5eSjymanymore when the 93f3effc5eSjym.Em securelevel 94f3effc5eSjymof the system is above 0. 95f3effc5eSjym.Sh Non-superuser control of CPU sets 96f3effc5eSjymWhen enabled, an ordinary user is allowed to control the CPU 97f3effc5eSjym.Xr affinity 3 98288b76eaSniaof the processes and threads they own. 99f3effc5eSjym.Pp 100f3effc5eSjymThis extension is enabled by setting 101f3effc5eSjym.Pa security.models.extensions.user_set_cpu_affinity 102f3effc5eSjym.Xr sysctl 7 103f3effc5eSjymto a non-zero value. 104f3effc5eSjym.Pp 105f3effc5eSjymIt can be disabled at any time, but cannot be enabled 106f3effc5eSjymanymore when the 107f3effc5eSjym.Em securelevel 108f3effc5eSjymof the system is above 0. 109*4805589dSchristos.Sh Hardlink restrictions 110*4805589dSchristosPrevent hardlinks to files that the user does not own or has group access 111*4805589dSchristosto. 112*4805589dSchristos.Pp 113*4805589dSchristosTo enable user ownership checks, set the 114*4805589dSchristos.Xr sysctl 7 115*4805589dSchristosvariable 116*4805589dSchristos.Pa security.models.extensions.hardlink_check_uid 117*4805589dSchristosto a non-zero value. 118*4805589dSchristos.Pp 119*4805589dSchristosTo enable group membership checks, set the 120*4805589dSchristos.Xr sysctl 7 121*4805589dSchristosvariable 122*4805589dSchristos.Pa security.models.extensions.hardlink_check_gid 123*4805589dSchristosto a non-zero value. 124*4805589dSchristos.Pp 125*4805589dSchristosThese variables can be enabled anytime, but cannot be disabled 126*4805589dSchristosanymore when the 127*4805589dSchristos.Em securelevel 128*4805589dSchristosof the system is above 0. 129f3effc5eSjym.Sh SEE ALSO 130f3effc5eSjym.Xr affinity 3 , 131f3effc5eSjym.Xr sched 3 , 132f3effc5eSjym.Xr sysctl 7 , 133f3effc5eSjym.Xr kauth 9 , 134f3effc5eSjym.Xr secmodel 9 , 135f3effc5eSjym.Xr secmodel_bsd44 9 , 136f3effc5eSjym.Xr secmodel_securelevel 9 , 137f3effc5eSjym.Xr secmodel_suser 9 138f3effc5eSjym.Sh AUTHORS 139a5684d07Swiz.An Elad Efrat Aq Mt elad@NetBSD.org 140