Determine the system's security level

Author: KevinDKinsey

Reviewer: Sean Swayze swayze@pcsage.biz FreeBSD/OpenBSD

Reviewer: name contact BSD flavour


Concept

BSD systems provide security (((security))) profiles known as securelevels(((securelevel))).

(((security levels)))

Introduction

The BSD kernels can limit -- even from the superuser (((superuser))) -- a great number of common operations in order to make a system extremely secure. A system secured in this way is said to be running in a high securelevel.

The five kernel securelevels are given in the init(8) manpage:

TODO: check each BSD

TODO: maybe put descriptor as bold here:

The securelevel is set when init (((init))) brings the system up to multi-user mode, and can also be viewed and adjusted "on the fly" via the kern.securelevel sysctl. Note that the securelevel can only be adjusted by the super-user, and can only be adjusted upward, that is, to a more secure level. No one can downgrade a system's securelevel while the system is running (it can be set to change at the next reboot, see below for details).

In addition, on NetBSD the verified exec in-kernel fingerprint table can't be modified.

Examples

You can look at current secure level via sysctl(((sysctl))):

""# sysctl kern.securelevel ""kern.securelevel: -1

Adding the following lines to rc.conf will cause the system to set a securelevel of 2 on the next boot:

""kern_securelevel_enable="YES" ""kern_securelevel="2"

Note that setting securelevel to 0 will result in the system booting with securelevel set to 1, as init(8) will raise the level when rc(8) completes.

Practice Exercises

More information

File flags are covered in View and modify file flags.

init(8), sysctl(8), rc.conf(5)