Securelevel
   HOME

TheInfoList



OR:

securelevel is a security mechanism in *
BSD The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
kernels 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 ...
, which can optionally restrict certain capabilities. Securelevel is controlled by the
sysctl sysctl is a software mechanism in 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 compile ...
variable kern.securelevel. This value is an
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
, 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 the ...
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 operating system. Init is a daemon process that continues running until the system is shut down. It is the direc ...
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 Regression testing (rarely, ''non-regression testing'') is re-running functional and non-functional tests to ensure that previously developed and tested software still performs as expected after a change. If not, that would be called a '' regr ...
.


Definitions

On
OpenBSD OpenBSD is a security-focused operating system, security-focused, free software, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by fork (software development), forking NetBSD ...
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 In computing, booting is the process of starting a computer as initiated via Computer hardware, hardware such as a physical button on the computer or by a software command. After it is switched on, a computer's central processing unit (CPU) h ...
, 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 leavi ...
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 that can be used as an input or output, or both, and is controllable by software. GPIOs have no p ...
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 the ...
account is compromised.


References


External links


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