mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-07-01 05:11:13 +02:00
EVM hmac calculation
For debugging purpose it is nice to have evm hmac calculation for labeling filesystem using hmac. Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
This commit is contained in:
@ -2,5 +2,6 @@ pkglib_PROGRAMS = openclose
|
||||
|
||||
openclose_SOURCES = openclose.c
|
||||
|
||||
dist_pkglib_SCRIPTS = evm_enable.sh evm_genkey.sh evm_sign_all.sh sign_modules_dir.sh ima_fix_dir.sh
|
||||
dist_pkglib_SCRIPTS = evm_enable.sh evm_genkey.sh evm_sign_all.sh evm_sign_modules.sh ima_fix_dir.sh \
|
||||
evm_hmac_all.sh evm_hmac_modules.sh
|
||||
|
||||
|
14
tests/evm_hmac_all.sh
Executable file
14
tests/evm_hmac_all.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
verbose=""
|
||||
if [ "$1" = "-v" ] ; then
|
||||
verbose="-v"
|
||||
shift 1
|
||||
fi
|
||||
|
||||
dir=${1:-/}
|
||||
|
||||
echo "Label: $dir"
|
||||
|
||||
find $dir \( -fstype rootfs -o -fstype ext3 -o -fstype ext4 \) -type f -uid 0 -exec evmctl hmac --imahash $verbose '{}' \;
|
||||
|
15
tests/evm_hmac_modules.sh
Executable file
15
tests/evm_hmac_modules.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
verbose=""
|
||||
if [ "$1" = "-v" ] ; then
|
||||
verbose="-v"
|
||||
shift 1
|
||||
fi
|
||||
|
||||
dir=${1:-/lib/modules}
|
||||
|
||||
echo "HMAC modules: $dir"
|
||||
|
||||
find $dir -name "*.ko" -type f -uid 0 -exec evmctl hmac --imasig $verbose '{}' \;
|
||||
find $dir ! -name "*.ko" -type f -uid 0 -exec evmctl hmac --imahash $verbose '{}' \;
|
||||
|
@ -10,8 +10,5 @@ dir=${1:-/}
|
||||
|
||||
echo "Label: $dir"
|
||||
|
||||
find $dir \( -fstype rootfs -o -fstype ext3 -o -fstype ext4 \) ! -path "/lib/modules/*" -type f -uid 0 -exec evmctl sign --imahash $verbose '{}' \;
|
||||
find /lib/modules ! -name "*.ko" -type f -uid 0 -exec evmctl sign --imahash $verbose '{}' \;
|
||||
# security.ima needs to have signature for modules
|
||||
find /lib/modules -name "*.ko" -type f -uid 0 -exec evmctl sign --imasig $verbose '{}' \;
|
||||
find $dir \( -fstype rootfs -o -fstype ext3 -o -fstype ext4 \) -type f -uid 0 -exec evmctl sign --imahash $verbose '{}' \;
|
||||
|
||||
|
@ -10,6 +10,6 @@ dir=${1:-/lib/modules}
|
||||
|
||||
echo "Signing modules: $dir"
|
||||
|
||||
find $dir -name "*.ko" -type f -uid 0 -exec evmctl sign --imasig '{}' \;
|
||||
find $dir ! -name "*.ko" -type f -uid 0 -exec evmctl sign --imahash '{}' \;
|
||||
find $dir -name "*.ko" -type f -uid 0 -exec evmctl sign --imasig $verbose '{}' \;
|
||||
find $dir ! -name "*.ko" -type f -uid 0 -exec evmctl sign --imahash $verbose '{}' \;
|
||||
|
Reference in New Issue
Block a user