Nur `boot_aggregate` in IMA-Messungen auf Raspberry Pi

Nur `boot_aggregate` in IMA-Messungen auf Raspberry Pi

Ich versuche, Integrity Measurement Architecture (IMA) auf einem Raspberry Pi 3B+ zu verwenden.

Ich habe den Kernel mit folgenden Optionen kompiliert (konfiguriert mit menuconfig)

CONFIG_IMA=y
CONFIG_IMA_MEASURE_PCR_IDX=10
# CONFIG_IMA_TEMPLATE is not set
CONFIG_IMA_NG_TEMPLATE=y
# CONFIG_IMA_SIG_TEMPLATE is not set
CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng"
# CONFIG_IMA_DEFAULT_HASH_SHA1 is not set
CONFIG_IMA_DEFAULT_HASH_SHA512=y
CONFIG_IMA_DEFAULT_HASH="sha512"
# CONFIG_IMA_WRITE_POLICY is not set
CONFIG_IMA_READ_POLICY=y
# CONFIG_IMA_APPRAISE is not set

CONFIG_INTEGRITY=y
# CONFIG_INTEGRITY_SIGNATURE is not set
CONFIG_INTEGRITY_AUDIT=y

Ich konfiguriere ima_policydie Einstellungen /boot/cmdline.txtfolgendermaßen:

console=serial0,115200 console=tty1 root=PARTUUID=8e9714d8-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait ima_policy=tcb ima_policy=appraise_tcb

Der Raspberry bootet normal und ich kann auf den IMA-Sysfs-Ordner zugreifen.

Ich habe diese /sysfs/kernel/security/ima/policyDatei erhalten.

dont_measure fsmagic=0x9fa0 
dont_measure fsmagic=0x62656572 
dont_measure fsmagic=0x64626720 
dont_measure fsmagic=0x1021994 
dont_measure fsmagic=0x1cd1 
dont_measure fsmagic=0x42494e4d 
dont_measure fsmagic=0x73636673 
dont_measure fsmagic=0xf97cff8c 
dont_measure fsmagic=0x43415d53 
dont_measure fsmagic=0x27e0eb 
dont_measure fsmagic=0x63677270 
dont_measure fsmagic=0x6e736673 
dont_measure fsmagic=0xde5e81e4 
measure func=MMAP_CHECK mask=MAY_EXEC 
measure func=BPRM_CHECK mask=MAY_EXEC 
measure func=FILE_CHECK mask=^MAY_READ euid=0 
measure func=FILE_CHECK mask=^MAY_READ uid=0 
measure func=MODULE_CHECK 
measure func=FIRMWARE_CHECK 
measure func=POLICY_CHECK 
dont_appraise fsmagic=0x9fa0 
dont_appraise fsmagic=0x62656572 
dont_appraise fsmagic=0x64626720 
dont_appraise fsmagic=0x1021994 
dont_appraise fsmagic=0x858458f6 
dont_appraise fsmagic=0x1cd1 
dont_appraise fsmagic=0x42494e4d 
dont_appraise fsmagic=0x73636673 
dont_appraise fsmagic=0xf97cff8c 
dont_appraise fsmagic=0x43415d53 
dont_appraise fsmagic=0x6e736673 
dont_appraise fsmagic=0xde5e81e4 
dont_appraise fsmagic=0x27e0eb 
dont_appraise fsmagic=0x63677270 
appraise fowner=0 

Auch dies habe ich /sysfs/kernel/security/ima/ascii_runtime_measurementsmit nur einer Zeile erreicht.

10 45e7e585a82d311e1ee226b4256604c341dbc6b9 ima-ng sha512:00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 boot_aggregate

Mein Problem ist, dass mein Raspberry Pi scheinbar keine Datei misst und ich auf eine ascii_runtime_measurementsDatei mit vielen Messungen gehofft hatte.

Weiß jemand, was ich falsch mache?

Vielen Dank für Ihre Hilfe.

Antwort1

Vielleicht ein Kernelproblem. Sie könnten versuchen, dies in iinit.c zu ändern. Bei mir hat es funktioniert. Viel Glück! Der aktualisierte Teil ist der erste und der Originalteil unten. <

 static void init_once(void *foo)
 {
    struct integrity_iint_cache *iint = foo;
 
    memset(iint, 0, sizeof(*iint));
    iint->ima_file_status = INTEGRITY_UNKNOWN;
    iint->ima_mmap_status = INTEGRITY_UNKNOWN;
    iint->ima_bprm_status = INTEGRITY_UNKNOWN;
    iint->ima_read_status = INTEGRITY_UNKNOWN;
    iint->ima_creds_status = INTEGRITY_UNKNOWN;
    iint->evm_status = INTEGRITY_UNKNOWN;
    mutex_init(&iint->mutex);
 }
 
 
    if (!iint_cache)
    {
        iint_cache =
        kmem_cache_create("iint_cache", sizeof(struct integrity_iint_cache),
                  0, SLAB_PANIC, init_once);
    }
 
 



static void init_once(void *foo)
 {
    struct integrity_iint_cache *iint = foo;
 
    memset(iint, 0, sizeof(*iint));
    iint->ima_file_status = INTEGRITY_UNKNOWN;
    iint->ima_mmap_status = INTEGRITY_UNKNOWN;
    iint->ima_bprm_status = INTEGRITY_UNKNOWN;
    iint->ima_read_status = INTEGRITY_UNKNOWN;
    iint->ima_creds_status = INTEGRITY_UNKNOWN;
    iint->evm_status = INTEGRITY_UNKNOWN;
    mutex_init(&iint->mutex);
 }

verwandte Informationen