1
0
Fork 0
alistair23-linux/Documentation
Lakshmi Ramasubramanian fdd1ffe8a8 selinux: include a consumer of the new IMA critical data hook
SELinux stores the active policy in memory, so the changes to this data
at runtime would have an impact on the security guarantees provided
by SELinux.  Measuring in-memory SELinux policy through IMA subsystem
provides a secure way for the attestation service to remotely validate
the policy contents at runtime.

Measure the hash of the loaded policy by calling the IMA hook
ima_measure_critical_data().  Since the size of the loaded policy
can be large (several MB), measure the hash of the policy instead of
the entire policy to avoid bloating the IMA log entry.

To enable SELinux data measurement, the following steps are required:

1, Add "ima_policy=critical_data" to the kernel command line arguments
   to enable measuring SELinux data at boot time.
For example,
  BOOT_IMAGE=/boot/vmlinuz-5.10.0-rc1+ root=UUID=fd643309-a5d2-4ed3-b10d-3c579a5fab2f ro nomodeset security=selinux ima_policy=critical_data

2, Add the following rule to /etc/ima/ima-policy
   measure func=CRITICAL_DATA label=selinux

Sample measurement of the hash of SELinux policy:

To verify the measured data with the current SELinux policy run
the following commands and verify the output hash values match.

  sha256sum /sys/fs/selinux/policy | cut -d' ' -f 1

  grep "selinux-policy-hash" /sys/kernel/security/integrity/ima/ascii_runtime_measurements | tail -1 | cut -d' ' -f 6

Note that the actual verification of SELinux policy would require loading
the expected policy into an identical kernel on a pristine/known-safe
system and run the sha256sum /sys/kernel/selinux/policy there to get
the expected hash.

Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Suggested-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Reviewed-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2021-01-14 23:41:46 -05:00
..
ABI selinux: include a consumer of the new IMA critical data hook 2021-01-14 23:41:46 -05:00
PCI
RCU docs: Fix reST markup when linking to sections 2020-12-31 15:44:47 -07:00
accounting
admin-guide IMA: define a builtin critical data measurement policy 2021-01-14 23:41:43 -05:00
arm ARM updates for 5.11: 2020-12-22 13:34:27 -08:00
arm64 ARM: 2020-12-20 10:44:05 -08:00
block
bpf
cdrom
core-api atomic: remove further references to atomic_ops 2020-12-31 15:51:33 -07:00
cpu-freq
crypto
dev-tools Merge branch 'akpm' (patches from Andrew) 2020-12-22 13:38:17 -08:00
devicetree USB fixes for 5.11-rc3 2021-01-10 12:33:19 -08:00
doc-guide Documentation: doc-guide: fixes to sphinx.rst 2020-12-31 15:49:51 -07:00
driver-api RTC for 5.11 2020-12-20 10:12:06 -08:00
fault-injection
fb
features ARM updates for 5.11: 2020-12-22 13:34:27 -08:00
filesystems Various bug fixes and cleanups for ext4; no new features this cycle. 2020-12-24 14:16:02 -08:00
firmware-guide Documentation: ACPI: enumeration: add PCI hierarchy representation 2020-11-23 17:59:49 +01:00
firmware_class
fpga
gpu
hid Merge branch 'for-5.11/core' into for-linus 2020-12-16 11:38:38 +01:00
hwmon hwmon: (sbtsi_temp) Fix Documenation kernel-doc warning 2020-12-30 08:05:20 -08:00
i2c
ia64 docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
ide
iio
infiniband
input Input: document inhibiting 2020-12-02 22:10:37 -08:00
isdn
kbuild Documentation: kbuild: Fix section reference 2021-01-11 05:14:38 +09:00
kernel-hacking docs: Fix reST markup when linking to sections 2020-12-31 15:44:47 -07:00
leds Changes for 5.11-rc1. Small cleanups/fixes mostly thanks to Marek, 2020-12-16 14:56:29 -08:00
litmus-tests
livepatch
locking Documentation: seqlock: s/LOCKTYPE/LOCKNAME/g 2020-12-09 17:08:49 +01:00
m68k docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
maintainer
mhi
mips docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
misc-devices
netlabel
networking docs: octeontx2: tune rst markup 2021-01-07 12:47:31 -08:00
nios2 docs: nios2: add missing ReST file 2020-12-07 08:35:21 -07:00
nvdimm
openrisc docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
parisc docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
pcmcia
power
powerpc docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
process docs: remove mention of ENABLE_MUST_CHECK 2021-01-07 14:41:38 -07:00
riscv docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
s390 docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
scheduler Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
scsi
security
sh docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
sound docs: Fix reST markup when linking to sections 2020-12-31 15:44:47 -07:00
sparc docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
sphinx Kbuild updates for v5.11 2020-12-22 14:02:39 -08:00
sphinx-static
spi
staging
target tweewide: Fix most Shebang lines 2020-12-08 23:30:04 +09:00
timers
trace Kbuild updates for v5.11 2020-12-22 14:02:39 -08:00
translations Networking updates for 5.11 2020-12-15 13:22:29 -08:00
usb
userspace-api "Intel SGX is new hardware functionality that can be used by 2020-12-14 13:14:57 -08:00
virt KVM/arm64 fixes for 5.11, take #1 2021-01-08 05:02:40 -05:00
vm mm/lru: revise the comments of lru_lock 2020-12-15 14:48:04 -08:00
w1
watchdog
x86 A much quieter cycle for documentation (happily), with, one hopes, the bulk 2020-12-14 16:55:54 -08:00
xtensa A much quieter cycle for documentation (happily), with, one hopes, the bulk 2020-12-14 16:55:54 -08:00
.gitignore
COPYING-logo
Changes
CodingStyle
Kconfig
Makefile
SubmittingPatches
asm-annotations.rst
atomic_bitops.txt
atomic_t.txt
conf.py docs: Note that sphinx 1.7 will be required soon 2020-12-11 13:53:38 -07:00
docutils.conf
dontdiff
index.rst docs: archis: add a per-architecture features list 2020-12-03 15:10:15 -07:00
logo.gif
memory-barriers.txt
watch_queue.rst