rosieblue
article thumbnail
728x90

Make Menuconfig

일단 arch 설정하여 make menuconfig해준다

 

그러면 화면에서 security options를 찾아가서 Integrity Subsystem을 찾는다

만약 integrity Subsystem항목이 없을 경우, Security Options의 Enable different security models를 활성화 해주고 다시 make menuconfig해주면 Intgerity Subsystem 항목이 나타난다

 

그러고 나서  Intgerity Subsystem에서 IMA 관련 설정을 켜주고 화면을 나간 후,

원래 하던데로 linux를 빌드하면 된다!

 

 

menuconfig로 안하고 그냥 .config 파일에서 아래 부분 고쳐줘도 된다

CONFIG_INTEGRITY=y
CONFIG_IMA=y
CONFIG_IMA_MEASURE_PCR_IDX=10
CONFIG_IMA_LSM_RULES=y
CONFIG_INTEGRITY_SIGNATURE=y
CONFIG_IMA_APPRAISE=y

# Since 4.13
IMA_APPRAISE_BOOTPARAM=y

 

 

IMA 관련 설정들 리눅스에서 확인하기:

https://wiki.gentoo.org/wiki/Integrity_Measurement_Architecture 

 

Integrity Measurement Architecture - Gentoo Wiki

The Linux Integrity Measurement Architecture (IMA) subsystem is responsible for calculating the hashes of files and programs before they are loaded, and supports reporting on the hashes and validate if they adhere to a predefined list. This article introdu

wiki.gentoo.org

 

이제 '리눅스 커널' 부팅할때 부팅 옵션을 줘야한다 (어딘지 모르겠으면 gpt ㄱㄱ)

나는 qemu로 optee 올리는데, 정확히말해서는 qemu로 올린 후 secure world에서 u-boot로 리눅스 커널 올리는 구조이기 때문에 uboot bootargs 수정해야했다

 

uboot prompt에서 수정해도 되긴한데 복붙이 안되는 이슈로 그냥 부팅파일? 쪽을 수정해줬다

~/optee-qemu$ nano build/kconfigs/u-boot_qemu_virt_v7.conf <- 여기 수정하면 됐다!

 

 

리눅스에서는 커널의 보안 관련 설정들을 user space의 디렉토리에서 볼 수 있게하는 기능인 'securityfs'를 제공한다

그래서 이걸 마운트를 해줘야지 이제 ima관련 파일들은 userspace에서 확인할 수 있다.

 

 

 

참고) 부팅 파라미터로 ima_policy 주면 리눅스 실행중에는 policy파일 수정 불가능하다고 함ㅇㅇ 지피티 피셜이어서 검증은 필요..

profile

rosieblue

@Rosieblue

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!