@@ -42,20 +42,23 @@ function scmp_act_notify_template() {
42
42
# noNewPrivileges, for this reason many of the following cases are tested with
43
43
# both values.
44
44
45
+ # Test basic actions handled by the agent work fine. noNewPrivileges FALSE.
45
46
@test " runc run [seccomp] (SCMP_ACT_NOTIFY noNewPrivileges false)" {
46
47
scmp_act_notify_template " mkdir /dev/shm/foo && stat /dev/shm/foo-bar" false ' "mkdir"'
47
48
48
49
runc run test_busybox
49
50
[ " $status " -eq 0 ]
50
51
}
51
52
53
+ # Test basic actions handled by the agent work fine. noNewPrivileges TRUE.
52
54
@test " runc run [seccomp] (SCMP_ACT_NOTIFY noNewPrivileges true)" {
53
55
scmp_act_notify_template " mkdir /dev/shm/foo && stat /dev/shm/foo-bar" true ' "mkdir"'
54
56
55
57
runc run test_busybox
56
58
[ " $status " -eq 0 ]
57
59
}
58
60
61
+ # Test actions not-handled by the agent work fine. noNewPrivileges FALSE.
59
62
@test " runc exec [seccomp] (SCMP_ACT_NOTIFY noNewPrivileges false)" {
60
63
requires root
61
64
@@ -68,6 +71,7 @@ function scmp_act_notify_template() {
68
71
[ " $status " -eq 0 ]
69
72
}
70
73
74
+ # Test actions not-handled by the agent work fine. noNewPrivileges TRUE.
71
75
@test " runc exec [seccomp] (SCMP_ACT_NOTIFY noNewPrivileges true)" {
72
76
requires root
73
77
@@ -78,13 +82,15 @@ function scmp_act_notify_template() {
78
82
[ " $status " -eq 0 ]
79
83
}
80
84
85
+ # Test important syscalls (some might be executed by runc) work fine when handled by the agent. noNewPrivileges FALSE.
81
86
@test " runc run [seccomp] (SCMP_ACT_NOTIFY important syscalls noNewPrivileges false)" {
82
87
scmp_act_notify_template " /bin/true" false ' "execve","openat","open","read","close"'
83
88
84
89
runc run test_busybox
85
90
[ " $status " -eq 0 ]
86
91
}
87
92
93
+ # Test important syscalls (some might be executed by runc) work fine when handled by the agent. noNewPrivileges TRUE.
88
94
@test " runc run [seccomp] (SCMP_ACT_NOTIFY important syscalls noNewPrivileges true)" {
89
95
scmp_act_notify_template " /bin/true" true ' "execve","openat","open","read","close"'
90
96
@@ -105,14 +111,16 @@ function scmp_act_notify_template() {
105
111
[ " $status " -eq 0 ]
106
112
}
107
113
108
- @test " runc run [seccomp] (SCMP_ACT_NOTIFY empty listener path)" {
114
+ # Ensure listenerPath is present if the profile uses seccomp notify actions.
115
+ @test " runc run [seccomp] (SCMP_ACT_NOTIFY empty listener path and notify act)" {
109
116
scmp_act_notify_template " /bin/true" false ' "mkdir"'
110
117
update_config ' .linux.seccomp.listenerPath = ""'
111
118
112
119
runc run test_busybox
113
120
[ " $status " -ne 0 ]
114
121
}
115
122
123
+ # Test using an invalid socket (none listening) as listenerPath fails.
116
124
@test " runc run [seccomp] (SCMP_ACT_NOTIFY wrong listener path)" {
117
125
scmp_act_notify_template " /bin/true" false ' "mkdir"'
118
126
update_config ' .linux.seccomp.listenerPath = "/some-non-existing-listener-path.sock"'
@@ -121,7 +129,8 @@ function scmp_act_notify_template() {
121
129
[ " $status " -ne 0 ]
122
130
}
123
131
124
- @test " runc run [seccomp] (SCMP_ACT_NOTIFY abstract listener path)" {
132
+ # Test using an invalid abstract socket as listenerPath fails.
133
+ @test " runc run [seccomp] (SCMP_ACT_NOTIFY wrong abstract listener path)" {
125
134
scmp_act_notify_template " /bin/true" false ' "mkdir"'
126
135
update_config ' .linux.seccomp.listenerPath = "@mysocketishere"'
127
136
0 commit comments