forked from konstruktoid/hardening
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcron.bats
More file actions
33 lines (26 loc) · 664 Bytes
/
cron.bats
File metadata and controls
33 lines (26 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bats
load test_helper
@test "Ensure /etc/cron.deny is removed" {
run test -f /etc/cron.deny
[ "$status" -eq 1 ]
}
@test "Ensure /etc/at.deny is removed" {
run test -f /etc/at.deny
[ "$status" -eq 1 ]
}
@test "Verify root in /etc/cron.allow" {
run oneEntry root /etc/cron.allow 1
[ "$status" -eq 0 ]
}
@test "Verify root in /etc/at.allow" {
run oneEntry root /etc/at.allow 1
[ "$status" -eq 0 ]
}
@test "Ensure atd is masked" {
run isMasked atd.service
[ "$status" -eq 0 ]
}
@test "Verify cron logging is enabled" {
run bash -c "grep '^cron.\*.*/var/log/cron.log$' /etc/rsyslog.d/50-default.conf"
[ "$status" -eq 0 ]
}