Debian Codegraph @

security/Kconfig

raw ◀ ▶
1 Debian patch touch this file
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # Security configuration
4 #
5
6 menu "Security options"
7
8 source "security/keys/Kconfig"
9
10 config SECURITY_DMESG_RESTRICT
11 bool "Restrict unprivileged access to the kernel syslog"
12 default n
13 help
14 This enforces restrictions on unprivileged users reading the kernel
15 syslog via dmesg(8).
16
17 If this option is not selected, no restrictions will be enforced
18 unless the dmesg_restrict sysctl is explicitly set to (1).
19
20 If you are unsure how to answer this question, answer N.
21
22 choice
23 prompt "Allow /proc/pid/mem access override"
24 default PROC_MEM_FORCE_PTRACE
25 help
26 Traditionally /proc/pid/mem allows users to override memory
27 permissions for users like ptrace, assuming they have ptrace
28 capability.
29
30 This allows people to limit that - either never override, or
31 require actual active ptrace attachment (default).
32
33 config PROC_MEM_ALWAYS_FORCE
34 bool "Traditional /proc/pid/mem behavior"
35 help
36 This allows /proc/pid/mem accesses to override memory mapping
37 permissions if you have ptrace access rights.
38
39 config PROC_MEM_FORCE_PTRACE
40 bool "Require active ptrace() use for access override"
41 help
42 This allows /proc/pid/mem accesses to override memory mapping
43 permissions for active ptracers like gdb.
44
45 config PROC_MEM_NO_FORCE
46 bool "Never"
47 help
48 Never override memory mapping permissions
49
50 endchoice
51
52 config MSEAL_SYSTEM_MAPPINGS
53 bool "mseal system mappings"
54 depends on 64BIT
55 depends on ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
56 depends on !CHECKPOINT_RESTORE
57 help
58 Apply mseal on system mappings.
59 The system mappings includes vdso, vvar, vvar_vclock,
60 vectors (arm compat-mode), sigpage (arm compat-mode), uprobes.
61
62 A 64-bit kernel is required for the memory sealing feature.
63 No specific hardware features from the CPU are needed.
64
65 WARNING: This feature breaks programs which rely on relocating
66 or unmapping system mappings. Known broken software at the time
67 of writing includes CHECKPOINT_RESTORE, UML, gVisor, rr. Therefore
68 this config can't be enabled universally.
69
70 For complete descriptions of memory sealing, please see
71 Documentation/userspace-api/mseal.rst
72
73 config SECURITY_PERF_EVENTS_RESTRICT
74 bool "Restrict unprivileged use of performance events"
75 depends on PERF_EVENTS
76 help
77 If you say Y here, the kernel.perf_event_paranoid sysctl
78 will be set to 3 by default, and no unprivileged use of the
79 perf_event_open syscall will be permitted unless it is
80 changed.
81
82 config SECURITY
83 bool "Enable different security models"
•84 depends on SYSFS
85 depends on MULTIUSER
86 help
87 This allows you to choose different security modules to be
88 configured into your kernel.
89
90 If this option is not selected, the default Linux security
91 model will be used.
92
93 If you are unsure how to answer this question, answer N.
94
95 config HAS_SECURITY_AUDIT
96 def_bool y
97 depends on AUDIT
98 depends on SECURITY
99
100 config SECURITYFS
101 bool "Enable the securityfs filesystem"
102 help
103 This will build the securityfs filesystem. It is currently used by
104 various security modules (AppArmor, IMA, SafeSetID, TOMOYO, TPM).
105
106 If you are unsure how to answer this question, answer N.
107
108 config SECURITY_NETWORK
109 bool "Socket and Networking Security Hooks"
110 depends on SECURITY
111 help
112 This enables the socket and networking security hooks.
113 If enabled, a security module can use these hooks to
114 implement socket and networking access controls.
115 If you are unsure how to answer this question, answer N.
116
117 config SECURITY_INFINIBAND
118 bool "Infiniband Security Hooks"
119 depends on SECURITY && INFINIBAND
120 help
121 This enables the Infiniband security hooks.
122 If enabled, a security module can use these hooks to
123 implement Infiniband access controls.
124 If you are unsure how to answer this question, answer N.
125
126 config SECURITY_NETWORK_XFRM
127 bool "XFRM (IPSec) Networking Security Hooks"
128 depends on XFRM && SECURITY_NETWORK
129 help
130 This enables the XFRM (IPSec) networking security hooks.
131 If enabled, a security module can use these hooks to
132 implement per-packet access controls based on labels
133 derived from IPSec policy. Non-IPSec communications are
134 designated as unlabelled, and only sockets authorized
135 to communicate unlabelled data can send without using
136 IPSec.
137 If you are unsure how to answer this question, answer N.
138
139 config SECURITY_PATH
140 bool "Security hooks for pathname based access control"
141 depends on SECURITY
142 help
143 This enables the security hooks for pathname based access control.
144 If enabled, a security module can use these hooks to
145 implement pathname based access controls.
146 If you are unsure how to answer this question, answer N.
147
148 config INTEL_TXT
149 bool "Enable Intel(R) Trusted Execution Technology (Intel(R) TXT)"
150 depends on HAVE_INTEL_TXT
151 help
152 This option enables support for booting the kernel with the
153 Trusted Boot (tboot) module. This will utilize
154 Intel(R) Trusted Execution Technology to perform a measured launch
155 of the kernel. If the system does not support Intel(R) TXT, this
156 will have no effect.
157
158 Intel TXT will provide higher assurance of system configuration and
159 initial state as well as data reset protection. This is used to
160 create a robust initial kernel measurement and verification, which
161 helps to ensure that kernel security mechanisms are functioning
162 correctly. This level of protection requires a root of trust outside
163 of the kernel itself.
164
165 Intel TXT also helps solve real end user concerns about having
166 confidence that their hardware is running the VMM or kernel that
167 it was configured with, especially since they may be responsible for
168 providing such assurances to VMs and services running on it.
169
170 See <https://www.intel.com/technology/security/> for more information
171 about Intel(R) TXT.
172 See <http://tboot.sourceforge.net> for more information about tboot.
173 See Documentation/arch/x86/intel_txt.rst for a description of how to enable
174 Intel TXT support in a kernel boot.
175
176 If you are unsure as to whether this is required, answer N.
177
178 config LSM_MMAP_MIN_ADDR
179 int "Low address space for LSM to protect from user allocation"
180 depends on SECURITY && SECURITY_SELINUX
181 default 32768 if ARM || (ARM64 && COMPAT)
182 default 65536
183 help
184 This is the portion of low virtual memory which should be protected
185 from userspace allocation. Keeping a user from writing to low pages
186 can help reduce the impact of kernel NULL pointer bugs.
187
188 For most ia64, ppc64 and x86 users with lots of address space
189 a value of 65536 is reasonable and should cause no problems.
190 On arm and other archs it should not be higher than 32768.
191 Programs which use vm86 functionality or have some need to map
192 this low address space will need the permission specific to the
193 systems running LSM.
194
195 config STATIC_USERMODEHELPER
196 bool "Force all usermode helper calls through a single binary"
197 help
198 By default, the kernel can call many different userspace
199 binary programs through the "usermode helper" kernel
200 interface. Some of these binaries are statically defined
201 either in the kernel code itself, or as a kernel configuration
202 option. However, some of these are dynamically created at
203 runtime, or can be modified after the kernel has started up.
204 To provide an additional layer of security, route all of these
205 calls through a single executable that can not have its name
206 changed.
207
208 Note, it is up to this single binary to then call the relevant
209 "real" usermode helper binary, based on the first argument
210 passed to it. If desired, this program can filter and pick
211 and choose what real programs are called.
212
213 If you wish for all usermode helper programs are to be
214 disabled, choose this option and then set
215 STATIC_USERMODEHELPER_PATH to an empty string.
216
217 config STATIC_USERMODEHELPER_PATH
218 string "Path to the static usermode helper binary"
219 depends on STATIC_USERMODEHELPER
220 default "/sbin/usermode-helper"
221 help
222 The binary called by the kernel when any usermode helper
223 program is wish to be run. The "real" application's name will
224 be in the first argument passed to this program on the command
225 line.
226
227 If you wish for all usermode helper programs to be disabled,
228 specify an empty string here (i.e. "").
229
230 source "security/selinux/Kconfig"
231 source "security/smack/Kconfig"
232 source "security/tomoyo/Kconfig"
233 source "security/apparmor/Kconfig"
234 source "security/loadpin/Kconfig"
235 source "security/yama/Kconfig"
236 source "security/safesetid/Kconfig"
237 source "security/lockdown/Kconfig"
238 source "security/landlock/Kconfig"
239 source "security/ipe/Kconfig"
240
241 source "security/integrity/Kconfig"
242
243 choice
244 prompt "First legacy 'major LSM' to be initialized"
245 default DEFAULT_SECURITY_SELINUX if SECURITY_SELINUX
246 default DEFAULT_SECURITY_SMACK if SECURITY_SMACK
247 default DEFAULT_SECURITY_TOMOYO if SECURITY_TOMOYO
248 default DEFAULT_SECURITY_APPARMOR if SECURITY_APPARMOR
249 default DEFAULT_SECURITY_DAC
250
251 help
252 This choice is there only for converting CONFIG_DEFAULT_SECURITY
253 in old kernel configs to CONFIG_LSM in new kernel configs. Don't
254 change this choice unless you are creating a fresh kernel config,
255 for this choice will be ignored after CONFIG_LSM has been set.
256
257 Selects the legacy "major security module" that will be
258 initialized first. Overridden by non-default CONFIG_LSM.
259
260 config DEFAULT_SECURITY_SELINUX
261 bool "SELinux" if SECURITY_SELINUX=y
262
263 config DEFAULT_SECURITY_SMACK
264 bool "Simplified Mandatory Access Control" if SECURITY_SMACK=y
265
266 config DEFAULT_SECURITY_TOMOYO
267 bool "TOMOYO" if SECURITY_TOMOYO=y
268
269 config DEFAULT_SECURITY_APPARMOR
270 bool "AppArmor" if SECURITY_APPARMOR=y
271
272 config DEFAULT_SECURITY_DAC
273 bool "Unix Discretionary Access Controls"
274
275 endchoice
276
277 config LSM
278 string "Ordered list of enabled LSMs"
279 depends on SECURITY
280 default "landlock,lockdown,yama,loadpin,safesetid,smack,selinux,tomoyo,apparmor,ipe,bpf" if DEFAULT_SECURITY_SMACK
281 default "landlock,lockdown,yama,loadpin,safesetid,apparmor,selinux,smack,tomoyo,ipe,bpf" if DEFAULT_SECURITY_APPARMOR
282 default "landlock,lockdown,yama,loadpin,safesetid,tomoyo,ipe,bpf" if DEFAULT_SECURITY_TOMOYO
283 default "landlock,lockdown,yama,loadpin,safesetid,ipe,bpf" if DEFAULT_SECURITY_DAC
284 default "landlock,lockdown,yama,loadpin,safesetid,selinux,smack,tomoyo,apparmor,ipe,bpf"
285 help
286 A comma-separated list of LSMs, in initialization order.
287 Any LSMs left off this list, except for those with order
288 LSM_ORDER_FIRST and LSM_ORDER_LAST, which are always enabled
289 if selected in the kernel configuration, will be ignored.
290 This can be controlled at boot with the "lsm=" parameter.
291
292 If unsure, leave this as the default.
293
294 config SECURITY_COMMONCAP_KUNIT_TEST
295 bool "Build KUnit tests for commoncap" if !KUNIT_ALL_TESTS
296 depends on KUNIT=y && USER_NS
297 default KUNIT_ALL_TESTS
298 help
299 This builds the commoncap KUnit tests.
300
301 KUnit tests run during boot and output the results to the debug log
302 in TAP format (https://testanything.org/). Only useful for kernel devs
303 running KUnit test harness and are not for inclusion into a
304 production build.
305
306 For more information on KUnit and unit tests in general please refer
307 to the KUnit documentation in Documentation/dev-tools/kunit/.
308
309 If unsure, say N.
310
311 source "security/Kconfig.hardening"
312
313 endmenu
314