File tree 4 files changed +27
-0
lines changed
4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -424,6 +424,9 @@ is_a_partition() {
424
424
if grep " [[:space:]]$1 [[:space:]]" /etc/fstab | grep -vqE " ^#" ; then
425
425
debug " $PARTITION found in fstab"
426
426
FNRET=0
427
+ elif mountpoint -q " $PARTITION " ; then
428
+ debug " $PARTITION found in /proc fs"
429
+ FNRET=0
427
430
else
428
431
debug " Unable to find $PARTITION in fstab"
429
432
FNRET=1
@@ -461,6 +464,9 @@ has_mount_option() {
461
464
if grep " [[:space:]]${PARTITION} [[:space:]]" /etc/fstab | grep -vE " ^#" | awk ' {print $4}' | grep -q " $OPTION " ; then
462
465
debug " $OPTION has been detected in fstab for partition $PARTITION "
463
466
FNRET=0
467
+ elif mountpoint -q " $PARTITION " ; then
468
+ debug " $OPTION not detected in fstab, but $PARTITION is a mount point searching in /proc fs"
469
+ has_mounted_option " $PARTITION " " $OPTION "
464
470
else
465
471
debug " Unable to find $OPTION in fstab for partition $PARTITION "
466
472
FNRET=1
Original file line number Diff line number Diff line change @@ -12,8 +12,15 @@ test_audit() {
12
12
register_test retvalshouldbe 0
13
13
run resolved /opt/debian-cis/bin/hardening/" ${script} " .sh --audit-all
14
14
15
+ echo " dummy entry" >> /etc/fstab
16
+
17
+ describe Fstab with a real entry to match runtime partitions
18
+ register_test retvalshouldbe 0
19
+ run resolved /opt/debian-cis/bin/hardening/" ${script} " .sh --audit-all
20
+
15
21
# Cleanup
16
22
rm /run/shm
23
+ sed " /dummy entry/d" /etc/fstab
17
24
18
25
# #################################################################
19
26
# For this test, we only check that it runs properly on a blank #
Original file line number Diff line number Diff line change @@ -12,8 +12,15 @@ test_audit() {
12
12
register_test retvalshouldbe 0
13
13
run resolved /opt/debian-cis/bin/hardening/" ${script} " .sh --audit-all
14
14
15
+ echo " dummy entry" >> /etc/fstab
16
+
17
+ describe Fstab with a real entry to match runtime partitions
18
+ register_test retvalshouldbe 0
19
+ run resolved /opt/debian-cis/bin/hardening/" ${script} " .sh --audit-all
20
+
15
21
# Cleanup
16
22
rm /run/shm
23
+ sed " /dummy entry/d" /etc/fstab
17
24
18
25
# #################################################################
19
26
# For this test, we only check that it runs properly on a blank #
Original file line number Diff line number Diff line change @@ -12,8 +12,15 @@ test_audit() {
12
12
register_test retvalshouldbe 0
13
13
run resolved /opt/debian-cis/bin/hardening/" ${script} " .sh --audit-all
14
14
15
+ echo " dummy entry" >> /etc/fstab
16
+
17
+ describe Fstab with a real entry to match runtime partitions
18
+ register_test retvalshouldbe 0
19
+ run resolved /opt/debian-cis/bin/hardening/" ${script} " .sh --audit-all
20
+
15
21
# Cleanup
16
22
rm /run/shm
23
+ sed " /dummy entry/d" /etc/fstab
17
24
18
25
# #################################################################
19
26
# For this test, we only check that it runs properly on a blank #
You can’t perform that action at this time.
0 commit comments