Specify the architecture in KSPP recommendations
[kconfig-hardened-check.git] / config_files / kspp-recommendations-arm64.config
1 # CONFIGs
2 # Linux/arm64 4.20 Kernel Configuration
3
4 # Report BUG() conditions and kill the offending process.
5 CONFIG_BUG=y
6
7 # Make sure kernel page tables have safe permissions.
8 CONFIG_STRICT_KERNEL_RWX=y
9
10 # Report any dangerous memory permissions (not available on all archs).
11 CONFIG_DEBUG_WX=y
12
13 # Use -fstack-protector-strong (gcc 4.9+) for best stack canary coverage.
14 CONFIG_STACKPROTECTOR=y
15 CONFIG_STACKPROTECTOR_STRONG=y
16
17 # Do not allow direct physical memory access (but if you must have it, at least enable STRICT mode...)
18 # CONFIG_DEVMEM is not set
19 CONFIG_STRICT_DEVMEM=y
20 CONFIG_IO_STRICT_DEVMEM=y
21
22 # Provides some protections against SYN flooding.
23 CONFIG_SYN_COOKIES=y
24
25 # Perform additional validation of various commonly targeted structures.
26 CONFIG_DEBUG_CREDENTIALS=y
27 CONFIG_DEBUG_NOTIFIERS=y
28 CONFIG_DEBUG_LIST=y
29 CONFIG_DEBUG_SG=y
30 CONFIG_BUG_ON_DATA_CORRUPTION=y
31 CONFIG_SCHED_STACK_END_CHECK=y
32
33 # Provide userspace with seccomp BPF API for syscall attack surface reduction.
34 CONFIG_SECCOMP=y
35 CONFIG_SECCOMP_FILTER=y
36
37 # Provide userspace with ptrace ancestry protections.
38 CONFIG_SECURITY=y
39 CONFIG_SECURITY_YAMA=y
40
41 # Perform usercopy bounds checking. (And disable fallback to gain full whitelist enforcement.)
42 CONFIG_HARDENED_USERCOPY=y
43 # CONFIG_HARDENED_USERCOPY_FALLBACK is not set
44
45 # Randomize allocator freelists, harden metadata.
46 CONFIG_SLAB_FREELIST_RANDOM=y
47 CONFIG_SLAB_FREELIST_HARDENED=y
48
49 # Allow allocator validation checking to be enabled (see "slub_debug=P" below).
50 CONFIG_SLUB_DEBUG=y
51
52 # Wipe higher-level memory allocations when they are freed (needs "page_poison=1" command line below).
53 # (If you can afford even more performance penalty, leave CONFIG_PAGE_POISONING_NO_SANITY=n)
54 CONFIG_PAGE_POISONING=y
55 CONFIG_PAGE_POISONING_NO_SANITY=y
56 CONFIG_PAGE_POISONING_ZERO=y
57
58 # Adds guard pages to kernel stacks (not all architectures support this yet).
59 CONFIG_VMAP_STACK=y
60
61 # Perform extensive checks on reference counting.
62 CONFIG_REFCOUNT_FULL=y
63
64 # Check for memory copies that might overflow a structure in str*() and mem*() functions both at build-time and run-time.
65 CONFIG_FORTIFY_SOURCE=y
66
67 # Dangerous; enabling this allows direct physical memory writing.
68 # CONFIG_ACPI_CUSTOM_METHOD is not set
69
70 # Dangerous; enabling this disables brk ASLR.
71 # CONFIG_COMPAT_BRK is not set
72
73 # Dangerous; enabling this allows direct kernel memory writing.
74 # CONFIG_DEVKMEM is not set
75
76 # Dangerous; exposes kernel text image layout.
77 # CONFIG_PROC_KCORE is not set
78
79 # Dangerous; enabling this disables VDSO ASLR.
80 # CONFIG_COMPAT_VDSO is not set
81
82 # Dangerous; enabling this allows replacement of running kernel.
83 # CONFIG_KEXEC is not set
84
85 # Dangerous; enabling this allows replacement of running kernel.
86 # CONFIG_HIBERNATION is not set
87
88 # Prior to v4.1, assists heap memory attacks; best to keep interface disabled.
89 # CONFIG_INET_DIAG is not set
90
91 # Easily confused by misconfigured userspace, keep off.
92 # CONFIG_BINFMT_MISC is not set
93
94 # Use the modern PTY interface (devpts) only.
95 # CONFIG_LEGACY_PTYS is not set
96
97 # If SELinux can be disabled at runtime, the LSM structures cannot be read-only; keep off.
98 # CONFIG_SECURITY_SELINUX_DISABLE is not set
99
100 # Reboot devices immediately if kernel experiences an Oops.
101 CONFIG_PANIC_ON_OOPS=y
102 CONFIG_PANIC_TIMEOUT=-1
103
104 # Keep root from altering kernel memory via loadable modules.
105 # CONFIG_MODULES is not set
106
107 # But if CONFIG_MODULE=y is needed, at least they must be signed with a per-build key.
108 CONFIG_STRICT_MODULE_RWX=y
109 CONFIG_MODULE_SIG=y
110 CONFIG_MODULE_SIG_FORCE=y
111 CONFIG_MODULE_SIG_ALL=y
112 CONFIG_MODULE_SIG_SHA512=y
113 CONFIG_MODULE_SIG_HASH="sha512"
114 CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
115
116
117 # GCC plugins
118
119 # Enable GCC Plugins
120 CONFIG_GCC_PLUGINS=y
121
122 # Gather additional entropy at boot time for systems that may not have appropriate entropy sources.
123 CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
124
125 # Force all structures to be initialized before they are passed to other functions.
126 CONFIG_GCC_PLUGIN_STRUCTLEAK=y
127 CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y
128
129 # Randomize the layout of system structures. This may have dramatic performance impact, so
130 # use with caution or also use CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE=y
131 CONFIG_GCC_PLUGIN_RANDSTRUCT=y
132
133
134 #arm64
135
136 CONFIG_ARM64=y
137
138 # Disallow allocating the first 32k of memory (cannot be 64k due to ARM loader).
139 CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
140
141 # Randomize position of kernel (requires UEFI RNG or bootloader support for /chosen/kaslr-seed DT property).
142 CONFIG_RANDOMIZE_BASE=y
143
144 # Make sure PAN emulation is enabled.
145 CONFIG_ARM64_SW_TTBR0_PAN=y
146
147 # Enable Kernel Page Table Isolation to remove an entire class of cache timing side-channels.
148 CONFIG_UNMAP_KERNEL_AT_EL0=y