Securelevel
   HOME

TheInfoList



OR:

securelevel is a security mechanism in *
BSD The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
kernel Kernel may refer to: Computing * Kernel (operating system), the central component of most operating systems * Kernel (image processing), a matrix used for image convolution * Compute kernel, in GPGPU programming * Kernel method, in machine learnin ...
s, which can optionally restrict certain capabilities. Securelevel is controlled by the
sysctl sysctl is a software utility of some Unix-like operating systems that reads and modifies the attributes of the system kernel such as its version number, maximum limits, and security settings. It is available both as a system call for compiled ...
variable kern.securelevel. This value is an
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign (−1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the language ...
, which when set to a value > 0 enables certain classes of restrictions. Any
superuser In computing, the superuser is a special user account used for system administration. Depending on the operating system (OS), the actual name of this account might be root, administrator, admin or supervisor. In some cases, the actual name of t ...
process can raise securelevel, but only the
init In Unix-based computer operating systems, init (short for ''initialization'') is the first process started during booting of the computer system. Init is a daemon process that continues running until the system is shut down. It is the direct ...
process can lower it. When used with
FreeBSD jail The jail mechanism is an implementation of FreeBSD's OS-level virtualisation that allows system administrators to partition a FreeBSD-derived computer system into several independent mini-systems called ''jails'', all sharing the same kernel, with ...
s, each jail maintains its own securelevel in addition to the global securelevel. When evaluated, the higher of the two securelevels will be used. This allows the host environment to run at a lower securelevel than jails, so that it can manipulate file flags that the jails may not be able to manipulate. When compiled with the option REGRESSION, a new sysctl is added to the FreeBSD kernel that allows the securelevel to be lowered for the purposes of automated regression testing.


Definitions

On OpenBSD the securelevels are defined as follows: * -1 ''(Permanently insecure mode)'' is functionally identical to securelevel 0 except the
Kernel Kernel may refer to: Computing * Kernel (operating system), the central component of most operating systems * Kernel (image processing), a matrix used for image convolution * Compute kernel, in GPGPU programming * Kernel method, in machine learnin ...
will never attempt to increase the level as it would in level 0. This effectively disables the securelevel protections. * 0 ''(Insecure mode)'' all devices can be read or written to (if they have the appropriate permissions) and system file flags can be cleared using the chflags command. This mode is typically used while the system is booting, and once the boot is completed and the system enters multi-user mode, it is elevated to level 1. * 1 ''(Secure mode)'' is the default mode when the system is booted into
multi-user Multi-user software is computer software that allows access by multiple users of a computer. Time-sharing systems are multi-user systems. Most batch processing systems for mainframe computers may also be considered "multi-user", to avoid leaving t ...
mode. In this mode the securelevel cannot be lowered, the raw memory devices cannot be written to, the raw devices of mounted file systems cannot be written to, important kernel variables (such as fs.posix.setuid, hw.allowpowerdown, net.inet.ip.sourceroute, machdep.kbdreset, ddb.console, ddb.panic and machdep.allowaperture) are locked down and only
GPIO A general-purpose input/output (GPIO) is an uncommitted digital signal pin on an integrated circuit or electronic circuit (e.g. MCUs/ MPUs ) board which may be used as an input or output, or both, and is controllable by software. GPIOs have no ...
pins that were present during boot may be accessed. * 2 ''(Highly secure mode)'' has the same effects as securelevel 1, with the additions of raw disk devices cannot be written to even if unmounted, certain time related functions are locked down so the time cannot be set in the past (to help ensure the times of actions recorded in the logs are accurate) and pf rules may not be altered. This mode is designed to provide some semblance of defense in the event that the
root user In computing, the superuser is a special user account used for system administration. Depending on the operating system (OS), the actual name of this account might be root, administrator, admin or supervisor. In some cases, the actual name of th ...
account is compromised.


References


External links


Securelevel in FreeBSD Handbook
Berkeley Software Distribution {{Unix-stub