aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils/audit.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils/audit.exp')
-rwxr-xr-xtest/utils/audit.exp159
1 files changed, 0 insertions, 159 deletions
diff --git a/test/utils/audit.exp b/test/utils/audit.exp
deleted file mode 100755
index 6352dc62d..000000000
--- a/test/utils/audit.exp
+++ /dev/null
@@ -1,159 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --audit\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Firejail Audit"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "is running in a PID namespace"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "container/sandbox firejail"
22}
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 "seccomp BPF enabled"
26}
27expect {
28 timeout {puts "TESTING ERROR 4\n";exit}
29 "all capabilities are disabled"
30}
31expect {
32 timeout {puts "TESTING ERROR 5\n";exit}
33 "dev directory seems to be fully populated"
34}
35after 100
36
37
38send -- "firejail --audit\r"
39expect {
40 timeout {puts "TESTING ERROR 6\n";exit}
41 "Firejail Audit"
42}
43expect {
44 timeout {puts "TESTING ERROR 7\n";exit}
45 "is running in a PID namespace"
46}
47expect {
48 timeout {puts "TESTING ERROR 8\n";exit}
49 "container/sandbox firejail"
50}
51expect {
52 timeout {puts "TESTING ERROR 9\n";exit}
53 "seccomp BPF enabled"
54}
55expect {
56 timeout {puts "TESTING ERROR 10\n";exit}
57 "all capabilities are disabled"
58}
59expect {
60 timeout {puts "TESTING ERROR 11\n";exit}
61 "dev directory seems to be fully populated"
62}
63after 100
64
65send -- "firejail --audit=blablabla\r"
66expect {
67 timeout {puts "TESTING ERROR 12\n";exit}
68 "cannot find the audit program"
69}
70after 100
71
72send -- "firejail --audit=\r"
73expect {
74 timeout {puts "TESTING ERROR 12\n";exit}
75 "invalid audit program"
76}
77after 100
78
79# run audit executable without a sandbox
80send -- "faudit\r"
81expect {
82 timeout {puts "TESTING ERROR 13\n";exit}
83 "is not running in a PID namespace"
84}
85expect {
86 timeout {puts "TESTING ERROR 14\n";exit}
87 "BAD: seccomp disabled"
88}
89expect {
90 timeout {puts "TESTING ERROR 15\n";exit}
91 "BAD: the capability map is"
92}
93expect {
94 timeout {puts "TESTING ERROR 16\n";exit}
95 "MAYBE: /dev directory seems to be fully populated"
96}
97after 100
98
99# test seccomp
100send -- "firejail --seccomp.drop=mkdir --audit\r"
101expect {
102 timeout {puts "TESTING ERROR 17\n";exit}
103 "Firejail Audit"
104}
105expect {
106 timeout {puts "TESTING ERROR 18\n";exit}
107 "GOOD: seccomp BPF enabled"
108}
109expect {
110 timeout {puts "TESTING ERROR 19\n";exit}
111 "UGLY: mount syscall permitted"
112}
113expect {
114 timeout {puts "TESTING ERROR 20\n";exit}
115 "UGLY: umount2 syscall permitted"
116}
117expect {
118 timeout {puts "TESTING ERROR 21\n";exit}
119 "UGLY: ptrace syscall permitted"
120}
121expect {
122 timeout {puts "TESTING ERROR 22\n";exit}
123 "UGLY: swapon syscall permitted"
124}
125expect {
126 timeout {puts "TESTING ERROR 23\n";exit}
127 "UGLY: swapoff syscall permitted"
128}
129expect {
130 timeout {puts "TESTING ERROR 24\n";exit}
131 "UGLY: init_module syscall permitted"
132}
133expect {
134 timeout {puts "TESTING ERROR 25\n";exit}
135 "UGLY: delete_module syscall permitted"
136}
137expect {
138 timeout {puts "TESTING ERROR 26\n";exit}
139 "UGLY: chroot syscall permitted"
140}
141expect {
142 timeout {puts "TESTING ERROR 27\n";exit}
143 "UGLY: pivot_root syscall permitted"
144}
145expect {
146 timeout {puts "TESTING ERROR 28\n";exit}
147 "UGLY: iopl syscall permitted"
148}
149expect {
150 timeout {puts "TESTING ERROR 29\n";exit}
151 "UGLY: ioperm syscall permitted"
152}
153expect {
154 timeout {puts "TESTING ERROR 30\n";exit}
155 "GOOD: all capabilities are disabled"
156}
157after 100
158
159puts "\nall done\n"