This commit is contained in:
Federico Pellegatta 2025-07-15 14:07:29 +03:00 committed by GitHub
commit 9bf571ee89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 70 additions and 2 deletions

View File

@ -9,7 +9,7 @@ flush = INCREMENTAL_ASYNC
freq = 50 freq = 50
priority_boost = 4 priority_boost = 4
disp_qos = lossy disp_qos = lossy
dispatcher = /sbin/audispd dispatcher = /usr/sbin/audispd
name_format = NONE name_format = NONE
##name = mydomain ##name = mydomain
max_log_file_action = ROTATE max_log_file_action = ROTATE

View File

@ -2,4 +2,4 @@
# load the audit rules into the kernel # load the audit rules into the kernel
auditctl -R /etc/audit/audit.rules auditctl -R /etc/audit/audit.rules
exec /sbin/auditd -f exec /usr/sbin/auditd -f

View File

@ -0,0 +1,14 @@
#!/bin/sh
for i in $(seq 1 20); do
if grep "Init complete" /var/log/auditd.log 2>/dev/null; then
printf "auditd test suite PASSED\n" > /dev/console
/sbin/poweroff -f
fi
sleep 1
done
printf "auditd test suite FAILED\n" > /dev/console
echo "contents of /var/log/auditd.log:" > /dev/console
cat /var/log/auditd.log > /dev/console
/sbin/poweroff -f

View File

@ -0,0 +1,24 @@
#!/bin/sh
# SUMMARY: Check that the auditd package works
# LABELS:
# REPEAT:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=auditd
clean_up() {
rm -rf ${NAME}-*
}
trap clean_up EXIT
# Test code goes here
linuxkit build -disable-content-trust -format kernel+initrd -name "${NAME}" test.yml
RESULT="$(linuxkit run ${NAME})"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"
exit 0

View File

@ -0,0 +1,30 @@
kernel:
image: linuxkit/kernel:5.10.34
cmdline: "console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:78fb57c7da07c4e43c3a37b27755581da087a3b6
- linuxkit/runc:bf1e0c61fb4678d6428d0aabbd80db5ea24e4d4d
- linuxkit/containerd:cc02c2af9c928c2faeccbe4edc78bd297ad91866
- linuxkit/memlogd:9b0e8a5b3f67672234170d88833163caf7898984
services:
- name: auditd
image: linuxkit/auditd:d777dd0fc555d81ecf55cfbcfa6053a983257246
- name: logwrite
image: linuxkit/logwrite:e64e0f06e485e3542b58f3517da3bc13f246d208
- name: test
image: alpine:3.11
binds:
- /check.sh:/check.sh
- /dev/console:/dev/console
- /var/log:/var/log
command: ["sh", "./check.sh"]
pid: host
capabilities:
- CAP_SYS_BOOT
files:
- path: check.sh
source: ./check.sh
trust:
org:
- linuxkit
- library