Logo

dev-resources.site

for different kinds of informations.

AppArmor testsuite

Published at
5/11/2024
Categories
apparmor
testsuite
kernel
security
Author
lsahn
Author
5 person written this
lsahn
open
AppArmor testsuite

์œ ์ €๋ ˆ๋ฒจ์—์„œ ๊ฐœ๋ฐœ๋˜๋Š” ๋ฏธ๋“ค์›จ์–ด ํ”„๋กœ๊ทธ๋žจ๋“ค์€ ๋Œ€๋ถ€๋ถ„(?) unittest๋ฅผ ์ง€์›ํ•œ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ kernel์€ ์ด์•ผ๊ธฐ๊ฐ€ ์ข€ ๋‹ฌ๋ผ์ง€๋Š”๋ฐ... ํ•˜๋“œ์›จ์–ด ์œ„์—์„œ ์ž์›์„ ๊ด€๋ฆฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์ด๋‹ค ๋ณด๋‹ˆ unittest๋ฅผ ์ˆ˜ํ–‰ํ•  ํ™˜๊ฒฝ์ด ์—†๋‹ค. ์ตœ๊ทผ์— KUnit์„ ์ด์šฉํ•ด์„œ ํ•จ์ˆ˜/๊ธฐ๋Šฅ ๋‹จ์œ„๋กœ ํ…Œ์ŠคํŠธํ•˜๊ธด ํ•˜์ง€๋งŒ ์˜ค๋Š˜์€ ์œ ์ € ๋ ˆ๋ฒจ์—์„œ ์ˆ˜ํ–‰ํ•˜๋Š” ํ…Œ์ŠคํŠธ์— ๋Œ€ํ•ด ์ด์•ผ๊ธฐํ•ด๋ณด์ž.

ํด๋ผ์ด์–ธํŠธ์™€ kernel ๊ด€๋ จ ์—…๋ฌด๋ฅผ ์ง„ํ–‰ํ•˜๋‹ค๋ณด๋ฉด ํ•ญ์ƒ stability ๋‹จ์–ด๊ฐ€ ์–ธ๊ธ‰๋˜๊ณค ํ•œ๋‹ค. ํŠนํžˆ๋‚˜ ์„ ํ–‰์—ฐ๊ตฌ ๊ณผ์ œ๋ผ๋ฉด kernel์—์„œ ์ง€์›ํ•˜์ง€ ์•Š๋Š” ๊ธฐ๋Šฅ์— ๋Œ€ํ•ด ํ”„๋กœํ† ํƒ€์ž…์œผ๋กœ ๊ฐœ๋ฐœํ•˜๊ณ  ์–‘์‚ฐ์— ์ ์šฉํ• ์ง€ ๊ณ ๋ฏผํ•˜๋Š”๋ฐ, ํด๋ผ์ด์–ธํŠธ๋Š” ๊ธฐ๋Šฅ์ด ๋™์ž‘ํ•˜๋Š” ๋™์•ˆ ํฌ๋ฆฌํ‹ฐ์ปฌ ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š๊ธธ ์›ํ•˜์—ฌ ์•ˆ์ •์„ฑ์„ ๊ฒ€์ฆํ•  ๋งŒํ•œ ํ…Œ์ŠคํŠธ๋ฅผ ์š”๊ตฌํ•œ๋‹ค. ์˜ค๋Š˜ ์†Œ๊ฐœํ•˜๋Š” ํ”„๋ ˆ์ž„์›Œํฌ(?)๊ฐ€ ๋ฐ”๋กœ AppArmor์˜ ์•ˆ์ •์„ฑ์„ ๊ฒ€์ฆํ•  ์ˆ˜ ์žˆ๋Š” ํ•˜๋‚˜์˜ ๋ฐฉ๋ฒ•์ด๋‹ค.

AppArmor ํ”„๋กœ์ ํŠธ ์‚ฌ์ดํŠธ์— ์ ‘์†ํ•˜๋ฉด user-space ๋„๊ตฌ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” repo๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋Š”๋ฐ ๊ทธ์ค‘์— tests/regression/apparmor๊ฐ€ testsuite์ด๋‹ค. HOW TO INSTALL์€ off topic์ด๊ณ  ์—ฌ๊ธฐ์„œ๋Š” ๊ฐ„๋‹จํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๊ณ  ๊ฒฐ๊ณผ๋ฅผ ๋ณด๋„๋ก ํ•˜์ž.

ํ•ด๋‹น repo๋ฅผ clone ํ•˜๊ณ  tests/regression/apparmor๋กœ ์ด๋™ํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ์—ฌ๋Ÿฌ๊ฐœ์˜ ํŒŒ์ผ์ด ๋ณด์ธ๋‹ค.
ls-apparmor

์ด์ œ make tests ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜์—ฌ testsuite๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ ์‹คํ–‰ํ•œ๋‹ค. (์‹คํ–‰์— ํ•„์š”ํ•œ ๋””ํŽœ๋˜์‹œ๋Š” ์ด๋ฏธ ์„ค์น˜ํ•˜์˜€๋‹ค)
run-testsuite

์ž๋™ํ™” ํ”„๋ ˆ์ž„์›Œํฌ์ด๋‹ค ๋ณด๋‹ˆ ํ˜ผ์ž์„œ ์ˆ˜ํ–‰ํ•˜๊ณ  ์•„๋ž˜์™€ ๊ฐ™์ด report๋ฅผ ์ถœ๋ ฅํ•˜๋ฉฐ, ์‚ฌ์šฉ์ž๋Š” ์ด๋ฅผ ํ†ตํ•ด PASS ๋ฐ FAIL ์„œ๋ธŒ ํ…Œ์ŠคํŠธ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.
report

๊ฒฐ๊ตญ testsuite๋ฅผ ์ˆ˜ํ–‰ํ•จ์œผ๋กœ์„œ ์„ ํ–‰์—ฐ๊ตฌ ํŒจ์น˜๊ฐ€ ์ ์šฉ๋œ kernel์ด apparmor ๊ธฐ๋Šฅ ์ˆ˜ํ–‰์— ๋ฌธ์ œ๊ฐ€ ์—†๋Š”์ง€ ํŒ๋‹จํ•˜์—ฌ ์–‘์‚ฐ์— ์ ์šฉํ• ์ง€ ๊ฒฐ์ •ํ•˜๊ฒŒ ๋œ๋‹ค. ๋ฌผ๋ก  ์ด๋ฅผ ํ†ตํ•ด ๋ฐœ๊ฒฌํ•˜์ง€ ๋ชปํ•œ ์ด์Šˆ๋“ค๋„ ์—ฌ์ „ํžˆ ์žˆ์œผ๋‚˜ testsuite๋Š” ๊ธฐ๋Šฅ์ด ์•ˆ์ •์ ์œผ๋กœ ๋™์ž‘ํ•จ์„ ๊ฒ€์ฆํ•  ์ˆ˜ ์žˆ๋Š” ์ฒซ๋ฒˆ์งธ ๋‹จ๊ณ„๊ฐ€ ๋˜๊ธฐ๋„ ํ•œ๋‹ค.

kernel Article's
30 articles in total
Favicon
Ditana GNU/Linux: Unmatched Configuration Flexibility and Generic Hardware Detection
Favicon
I added networking standards to my custom kernel!
Favicon
I'm building my own kernel!
Favicon
Bash vs. Shell: The Ultimate Comparison
Favicon
x64 Virtual Address Translation
Favicon
Debian 12: NVIDIA Drivers Installation
Favicon
Exploring the Linux Kernel and Switching Kernels on Arch Linux & Snigdha OS in Short!
Favicon
All About Linux: A Comprehensive Guide
Favicon
Exploring Applications That Fully Utilize the Linux Kernel for Maximum Efficiency
Favicon
Raspberry Pi 4B: Natively Build a 64 Bit Fully Preemptible Kernel (Real-Time) with Desktop
Favicon
How to Configure a Network Block Device on a Debian-Basedย System
Favicon
Kernel vs Operating System
Favicon
C++ in Kernel Development: A Comprehensive Guide
Favicon
The Importance of Separating Kernels and Userspace in Modern Computing Systems
Favicon
Written by a 16 year old, a book on how computers work
Favicon
The Linux Audacity
Favicon
How to cross compile linux kernel on MacOS
Favicon
esBPF: Stress-Testing compares Software-Offload with iptables
Favicon
Commentary on CrowdStrike BSOD Root Cause Analysis Release
Favicon
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
Favicon
eBPF: Revolutionizing Linux Kernel Programming
Favicon
The Fundamentals of Support Vector Machines
Favicon
Understanding Docker Containers: Leveraging Linux Kernel's Namespaces and cgroups
Favicon
Understanding the Structural Differences Between BSD-based Kernels and Linux Kernels
Favicon
nvidia-dkms-545 error in Ubuntu 24.04
Favicon
AppArmor testsuite
Favicon
From User to OS: Exploring System Calls with glibc through a Restaurant Analogy
Favicon
Writing a bootloader: learnings
Favicon
Instalando kernel Linux Zen no Arch Linux com systemd-boot ๐Ÿง‘๐Ÿฝโ€๐Ÿ’ป
Favicon
Kernel Internals and Kernel Module Development in Fedora Linux

Featured ones: