2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 10:07:12 +00:00

Handle symlink log events in aa-logprof

Nobody told the tools that log events with operation="symlink" exist.
Add this keyword to the list of file or network operations (I don't
expect network symlinks ;-) but keeping everything in that list makes
things easier than special-casing it.)

Also add the log sample and expected result to the libapparmor tests.

Fixes https://gitlab.com/apparmor/apparmor/-/issues/107
This commit is contained in:
Christian Boltz 2020-08-02 19:49:18 +02:00
parent f318def665
commit 98bf187323
No known key found for this signature in database
GPG Key ID: C6A682EA63C82F1C
5 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1 @@
Aug 3 00:00:41 liuchao-virtual-machine kernel: [ 4362.615262] audit: type=1400 audit(1596384041.705:290): apparmor="DENIED" operation="symlink" profile="/home/test.sh" name="/home/b.c" pid=8016 comm="ln" requested_mask="c" denied_mask="c" fsuid=0 ouid=0

View File

@ -0,0 +1,15 @@
START
File: symlink.in
Event type: AA_RECORD_DENIED
Audit ID: 1596384041.705:290
Operation: symlink
Mask: c
Denied Mask: c
fsuid: 0
ouid: 0
Profile: /home/test.sh
Name: /home/b.c
Command: ln
PID: 8016
Epoch: 1596384041
Audit subid: 290

View File

@ -0,0 +1,4 @@
/home/test.sh {
owner /home/b.c w,
}

View File

@ -319,6 +319,7 @@ class ReadLog:
'rename_dest', 'rename_dest',
'unlink', 'unlink',
'rmdir', 'rmdir',
'symlink',
'symlink_create', 'symlink_create',
'link', 'link',
'sysctl', 'sysctl',