|
|
7629ac |
diff --git a/debian8/templates/csv/mount_options.csv b/debian8/templates/csv/mount_options.csv
|
|
|
7629ac |
index 6e00a922cc..c85df506af 100644
|
|
|
7629ac |
--- a/debian8/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ b/debian8/templates/csv/mount_options.csv
|
|
|
7629ac |
@@ -19,4 +19,3 @@
|
|
|
7629ac |
/tmp,nodev
|
|
|
7629ac |
/tmp,nosuid
|
|
|
7629ac |
/usr,nodev
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/fedora/templates/csv/mount_options.csv b/fedora/templates/csv/mount_options.csv
|
|
|
7629ac |
index 6bbdea38f9..9f4361a7f4 100644
|
|
|
7629ac |
--- a/fedora/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ b/fedora/templates/csv/mount_options.csv
|
|
|
7629ac |
@@ -12,5 +12,4 @@
|
|
|
7629ac |
/tmp,nodev
|
|
|
7629ac |
/tmp,noexec
|
|
|
7629ac |
/tmp,nosuid
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
|
|
|
7629ac |
diff --git a/shared/fixes/bash/mount_option_var_tmp_bind.sh
|
|
|
7629ac |
new file mode 100644
|
|
|
7629ac |
index 0000000000..1466eff5f5
|
|
|
7629ac |
--- /dev/null
|
|
|
7629ac |
+++ b/shared/fixes/bash/mount_option_var_tmp_bind.sh
|
|
|
7629ac |
@@ -0,0 +1,17 @@
|
|
|
7629ac |
+# platform = multi_platform_rhel,multi_platform_fedora
|
|
|
7629ac |
+
|
|
|
7629ac |
+. /usr/share/scap-security-guide/remediation_functions
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Delete particular /etc/fstab's row if /var/tmp is already configured to
|
|
|
7629ac |
+# represent a mount point (for some device or filesystem other than /tmp)
|
|
|
7629ac |
+if grep -q -P '.*\/var\/tmp.*' /etc/fstab
|
|
|
7629ac |
+then
|
|
|
7629ac |
+ sed -i '/.*\/var\/tmp.*/d' /etc/fstab
|
|
|
7629ac |
+fi
|
|
|
7629ac |
+umount /var/tmp
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Bind-mount /var/tmp to /tmp via /etc/fstab (preserving the /etc/fstab form)
|
|
|
7629ac |
+printf "%-24s%-24s%-8s%-32s%-3s\n" "/tmp" "/var/tmp" "none" "rw,nodev,noexec,nosuid,bind" "0 0" >> /etc/fstab
|
|
|
7629ac |
+
|
|
|
7629ac |
+mkdir -p /var/tmp
|
|
|
7629ac |
+mount -B /tmp /var/tmp
|
|
|
7629ac |
diff --git a/shared/checks/oval/mount_option_var_tmp_bind.xml
|
|
|
7629ac |
new file mode 100644
|
|
|
7629ac |
index 0000000000..7280364cfa
|
|
|
7629ac |
--- /dev/null
|
|
|
7629ac |
+++ b/shared/checks/oval/mount_option_var_tmp_bind.xml
|
|
|
7629ac |
@@ -0,0 +1,85 @@
|
|
|
7629ac |
+<def-group>
|
|
|
7629ac |
+ <definition class="compliance" id="mount_option_var_tmp_bind" version="1">
|
|
|
7629ac |
+ <metadata>
|
|
|
7629ac |
+ <title>Bind Mount /var/tmp To /tmp</title>
|
|
|
7629ac |
+ <affected family="unix">
|
|
|
7629ac |
+ <platform>multi_platform_all</platform>
|
|
|
7629ac |
+ </affected>
|
|
|
7629ac |
+ <description>The /var/tmp directory should be bind mounted to /tmp in
|
|
|
7629ac |
+ order to consolidate temporary storage into one location protected by the
|
|
|
7629ac |
+ same techniques as /tmp.</description>
|
|
|
7629ac |
+ </metadata>
|
|
|
7629ac |
+ <criteria operator="AND">
|
|
|
7629ac |
+
|
|
|
7629ac |
+ test_ref="test_configure_mount_option_var_tmp_bind_tmp" />
|
|
|
7629ac |
+
|
|
|
7629ac |
+ test_ref="test_mount_option_var_tmp" />
|
|
|
7629ac |
+ <criteria operator="OR">
|
|
|
7629ac |
+
|
|
|
7629ac |
+ test_ref="test_mount_option_var_tmp_bind" />
|
|
|
7629ac |
+
|
|
|
7629ac |
+ test_ref="test_mount_option_var_tmp_bind_compare_source" />
|
|
|
7629ac |
+ </criteria>
|
|
|
7629ac |
+ </criteria>
|
|
|
7629ac |
+ </definition>
|
|
|
7629ac |
+
|
|
|
7629ac |
+
|
|
|
7629ac |
+ comment="Ensure /var/tmp is configured to bind mount to /tmp"
|
|
|
7629ac |
+ id="test_configure_mount_option_var_tmp_bind_tmp" version="1">
|
|
|
7629ac |
+ <ind:object object_ref="object_configure_mount_option_var_tmp_bind_tmp" />
|
|
|
7629ac |
+ </ind:textfilecontent54_test>
|
|
|
7629ac |
+
|
|
|
7629ac |
+ id="object_configure_mount_option_var_tmp_bind_tmp" version="1">
|
|
|
7629ac |
+ <ind:filepath>/etc/fstab</ind:filepath>
|
|
|
7629ac |
+ <ind:pattern operation="pattern match">^[\s]*/tmp[\s]+/var/tmp[\s]+.*bind.*$</ind:pattern>
|
|
|
7629ac |
+ <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
|
|
|
7629ac |
+ </ind:textfilecontent54_object>
|
|
|
7629ac |
+
|
|
|
7629ac |
+
|
|
|
7629ac |
+ comment="Ensure /var/tmp is mounted" check="all">
|
|
|
7629ac |
+ <linux:object object_ref="object_mount_option_var_tmp" />
|
|
|
7629ac |
+ </linux:partition_test>
|
|
|
7629ac |
+ <linux:partition_object id="object_mount_option_var_tmp" version="1">
|
|
|
7629ac |
+ <linux:mount_point operation="pattern match">/var/tmp</linux:mount_point>
|
|
|
7629ac |
+ </linux:partition_object>
|
|
|
7629ac |
+
|
|
|
7629ac |
+
|
|
|
7629ac |
+ the bind mount option. As a result, the less elegant textfilecontent54_test
|
|
|
7629ac |
+ is required here. -->
|
|
|
7629ac |
+
|
|
|
7629ac |
+
|
|
|
7629ac |
+ comment="Ensure bind mount option is on /var/tmp"
|
|
|
7629ac |
+ id="test_mount_option_var_tmp_bind" version="1">
|
|
|
7629ac |
+ <ind:object object_ref="object_mount_option_var_tmp_bind" />
|
|
|
7629ac |
+ </ind:textfilecontent54_test>
|
|
|
7629ac |
+
|
|
|
7629ac |
+ id="object_mount_option_var_tmp_bind" version="1">
|
|
|
7629ac |
+ <ind:filepath>/etc/mtab</ind:filepath>
|
|
|
7629ac |
+ <ind:pattern operation="pattern match">^[\s]*/tmp[\s]+/var/tmp[\s]+.*bind.*$</ind:pattern>
|
|
|
7629ac |
+ <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
|
|
|
7629ac |
+ </ind:textfilecontent54_object>
|
|
|
7629ac |
+
|
|
|
7629ac |
+
|
|
|
7629ac |
+ about binded mounts anymore. An alternative is to check if
|
|
|
7629ac |
+ /tmp and /var/tmp have the same source device -->
|
|
|
7629ac |
+
|
|
|
7629ac |
+
|
|
|
7629ac |
+ comment="Ensure /var/tmp and /tmp have the same source device" check="all">
|
|
|
7629ac |
+ <linux:object object_ref="object_mount_option_var_tmp_bind_compare_source" />
|
|
|
7629ac |
+ <linux:state state_ref="state_mount_option_var_tmp_bind_compare_source" />
|
|
|
7629ac |
+ </linux:partition_test>
|
|
|
7629ac |
+ <linux:partition_object id="object_mount_option_var_tmp_bind_compare_source" version="1">
|
|
|
7629ac |
+ <linux:mount_point operation="pattern match">/tmp</linux:mount_point>
|
|
|
7629ac |
+ </linux:partition_object>
|
|
|
7629ac |
+ <linux:partition_state id="state_mount_option_var_tmp_bind_compare_source" version="1">
|
|
|
7629ac |
+
|
|
|
7629ac |
+ operation="equals" var_ref="var_mount_option_var_tmp_bind_var_tmp_source_device"/>
|
|
|
7629ac |
+ </linux:partition_state>
|
|
|
7629ac |
+
|
|
|
7629ac |
+
|
|
|
7629ac |
+ id="var_mount_option_var_tmp_bind_var_tmp_source_device" version="1">
|
|
|
7629ac |
+
|
|
|
7629ac |
+ object_ref="object_mount_option_var_tmp" />
|
|
|
7629ac |
+ </local_variable>
|
|
|
7629ac |
+
|
|
|
7629ac |
+</def-group>
|
|
|
7629ac |
diff --git a/ol7/templates/csv/mount_options.csv b/ol7/templates/csv/mount_options.csv
|
|
|
7629ac |
index 2f0aa49f0d..122198b57a 100644
|
|
|
7629ac |
--- a/ol7/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ b/ol7/templates/csv/mount_options.csv
|
|
|
7629ac |
@@ -1,3 +1,2 @@
|
|
|
7629ac |
/dev/shm,nodev
|
|
|
7629ac |
/dev/shm,nosuid
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/opensuse/templates/csv/mount_options.csv b/opensuse/templates/csv/mount_options.csv
|
|
|
7629ac |
deleted file mode 100644
|
|
|
7629ac |
index e024d02571..0000000000
|
|
|
7629ac |
--- a/opensuse/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ /dev/null
|
|
|
7629ac |
@@ -1,9 +0,0 @@
|
|
|
7629ac |
-# format:
|
|
|
7629ac |
-# <mount_point>,<mount_option>[,create_fstab_entry_if_needed]
|
|
|
7629ac |
-# - mount point mounted with specified option. for more than
|
|
|
7629ac |
-# one option, use multiple lines with the same <mount_point>, use the
|
|
|
7629ac |
-# variable name (i.e. name beginning with var_, without the leading
|
|
|
7629ac |
-# '$' to reference a variable, e.g. var_removable_partition,nodev)
|
|
|
7629ac |
-# If the remediation can create (i.e. not just modify) an /etc/fstab line,
|
|
|
7629ac |
-# add the 'create_fstab_entry_if_needed' literal string as the third argument.
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/rhel-osp7/templates/csv/mount_options.csv b/rhel-osp7/templates/csv/mount_options.csv
|
|
|
7629ac |
deleted file mode 100644
|
|
|
7629ac |
index e024d02571..0000000000
|
|
|
7629ac |
--- a/rhel-osp7/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ /dev/null
|
|
|
7629ac |
@@ -1,9 +0,0 @@
|
|
|
7629ac |
-# format:
|
|
|
7629ac |
-# <mount_point>,<mount_option>[,create_fstab_entry_if_needed]
|
|
|
7629ac |
-# - mount point mounted with specified option. for more than
|
|
|
7629ac |
-# one option, use multiple lines with the same <mount_point>, use the
|
|
|
7629ac |
-# variable name (i.e. name beginning with var_, without the leading
|
|
|
7629ac |
-# '$' to reference a variable, e.g. var_removable_partition,nodev)
|
|
|
7629ac |
-# If the remediation can create (i.e. not just modify) an /etc/fstab line,
|
|
|
7629ac |
-# add the 'create_fstab_entry_if_needed' literal string as the third argument.
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/rhel6/templates/csv/mount_options.csv b/rhel6/templates/csv/mount_options.csv
|
|
|
7629ac |
index ebf6bba9df..de0056e08c 100644
|
|
|
7629ac |
--- a/rhel6/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ b/rhel6/templates/csv/mount_options.csv
|
|
|
7629ac |
@@ -12,4 +12,3 @@
|
|
|
7629ac |
/tmp,nodev
|
|
|
7629ac |
/tmp,noexec
|
|
|
7629ac |
/tmp,nosuid
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/rhel7/templates/csv/mount_options.csv b/rhel7/templates/csv/mount_options.csv
|
|
|
7629ac |
index f5d9ed8cea..f9a3bc73dd 100644
|
|
|
7629ac |
--- a/rhel7/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ b/rhel7/templates/csv/mount_options.csv
|
|
|
7629ac |
@@ -19,4 +19,3 @@
|
|
|
7629ac |
/var/tmp,nodev
|
|
|
7629ac |
/var/tmp,noexec
|
|
|
7629ac |
/var/tmp,nosuid
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/sle11/templates/csv/mount_options.csv b/sle11/templates/csv/mount_options.csv
|
|
|
7629ac |
deleted file mode 100644
|
|
|
7629ac |
index e024d02571..0000000000
|
|
|
7629ac |
--- a/sle11/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ /dev/null
|
|
|
7629ac |
@@ -1,9 +0,0 @@
|
|
|
7629ac |
-# format:
|
|
|
7629ac |
-# <mount_point>,<mount_option>[,create_fstab_entry_if_needed]
|
|
|
7629ac |
-# - mount point mounted with specified option. for more than
|
|
|
7629ac |
-# one option, use multiple lines with the same <mount_point>, use the
|
|
|
7629ac |
-# variable name (i.e. name beginning with var_, without the leading
|
|
|
7629ac |
-# '$' to reference a variable, e.g. var_removable_partition,nodev)
|
|
|
7629ac |
-# If the remediation can create (i.e. not just modify) an /etc/fstab line,
|
|
|
7629ac |
-# add the 'create_fstab_entry_if_needed' literal string as the third argument.
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/sle12/templates/csv/mount_options.csv b/sle12/templates/csv/mount_options.csv
|
|
|
7629ac |
index 759e51b0fe..b2df6c9f08 100644
|
|
|
7629ac |
--- a/sle12/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ b/sle12/templates/csv/mount_options.csv
|
|
|
7629ac |
@@ -17,4 +17,3 @@
|
|
|
7629ac |
/var/tmp,nodev
|
|
|
7629ac |
/var/tmp,noexec
|
|
|
7629ac |
/var/tmp,nosuid
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/tests/data/group_system/group_permissions/group_partitions/partition.sh b/tests/data/group_system/group_permissions/group_partitions/partition.sh
|
|
|
7629ac |
index 333a574f5e..f74a98b5b3 100644
|
|
|
7629ac |
--- a/tests/data/group_system/group_permissions/group_partitions/partition.sh
|
|
|
7629ac |
+++ b/tests/data/group_system/group_permissions/group_partitions/partition.sh
|
|
|
7629ac |
@@ -8,16 +8,21 @@ create_partition() {
|
|
|
7629ac |
}
|
|
|
7629ac |
|
|
|
7629ac |
# $1: The mount point
|
|
|
7629ac |
-# $2: The additional mount options
|
|
|
7629ac |
+# $2: The type of file system
|
|
|
7629ac |
+# $3: The additional mount options
|
|
|
7629ac |
make_fstab_given_partition_line() {
|
|
|
7629ac |
- local _mount_point="$1" _additional_mount_options="$2"
|
|
|
7629ac |
+ local _mount_point="$1" _type="$2" _additional_mount_options="$3"
|
|
|
7629ac |
test -z "$_additional_mount_options" || _additional_mount_options=",$_additional_mount_options"
|
|
|
7629ac |
- printf "%s %s ext2 rw%s 0 0\n" "$PARTITION" "$_mount_point" "$_additional_mount_options" > /etc/fstab
|
|
|
7629ac |
+ printf "%s %s %s rw%s 0 0\n" "$PARTITION" "$_mount_point" "$_type" "$_additional_mount_options" >> /etc/fstab
|
|
|
7629ac |
}
|
|
|
7629ac |
|
|
|
7629ac |
# $1: The mount point
|
|
|
7629ac |
make_fstab_correct_partition_line() {
|
|
|
7629ac |
- make_fstab_given_partition_line "$1" "nodev,noexec,nosuid"
|
|
|
7629ac |
+ make_fstab_given_partition_line "$1" "ext2" "nodev,noexec,nosuid"
|
|
|
7629ac |
+}
|
|
|
7629ac |
+
|
|
|
7629ac |
+make_fstab_bind_partition_line() {
|
|
|
7629ac |
+ make_fstab_given_partition_line "$1" "none" "nodev,noexec,nosuid,bind"
|
|
|
7629ac |
}
|
|
|
7629ac |
|
|
|
7629ac |
# $1: The mount point
|
|
|
7629ac |
@@ -28,5 +33,13 @@ mount_partition() {
|
|
|
7629ac |
|
|
|
7629ac |
mount_bind_partition() {
|
|
|
7629ac |
mkdir -p "$1"
|
|
|
7629ac |
- mount --target -B "$1"
|
|
|
7629ac |
+ mount -B "$PARTITION" "$1"
|
|
|
7629ac |
+}
|
|
|
7629ac |
+
|
|
|
7629ac |
+# $1: The path to umount and remove from /etc/fstab
|
|
|
7629ac |
+clean_up_partition() {
|
|
|
7629ac |
+ path="$1"
|
|
|
7629ac |
+ escaped_path=${path//$'/'/$'\/'}
|
|
|
7629ac |
+ sed -i "/${escaped_path}/d" /etc/fstab
|
|
|
7629ac |
+ umount ${path} || true # no problem if not mounted
|
|
|
7629ac |
}
|
|
|
7629ac |
diff --git a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_home_nosuid/fstab.fail.sh b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_home_nosuid/fstab.fail.sh
|
|
|
7629ac |
index 498f44911f..0cc19818d9 100644
|
|
|
7629ac |
--- a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_home_nosuid/fstab.fail.sh
|
|
|
7629ac |
+++ b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_home_nosuid/fstab.fail.sh
|
|
|
7629ac |
@@ -7,6 +7,6 @@ umount /home || true # no problem if not mounted
|
|
|
7629ac |
|
|
|
7629ac |
create_partition
|
|
|
7629ac |
|
|
|
7629ac |
-make_fstab_given_partition_line /home nodev
|
|
|
7629ac |
+make_fstab_given_partition_line /home ext2 nodev
|
|
|
7629ac |
|
|
|
7629ac |
mount_partition /home
|
|
|
7629ac |
diff --git a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_tmp_noexec/fstab.fail.sh b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_tmp_noexec/fstab.fail.sh
|
|
|
7629ac |
index 3128ad2aee..62d36b718a 100644
|
|
|
7629ac |
--- a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_tmp_noexec/fstab.fail.sh
|
|
|
7629ac |
+++ b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_tmp_noexec/fstab.fail.sh
|
|
|
7629ac |
@@ -5,6 +5,6 @@
|
|
|
7629ac |
|
|
|
7629ac |
create_partition
|
|
|
7629ac |
|
|
|
7629ac |
-make_fstab_given_partition_line /tmp nodev
|
|
|
7629ac |
+make_fstab_given_partition_line /tmp ext2 nodev
|
|
|
7629ac |
|
|
|
7629ac |
mount_partition /tmp
|
|
|
7629ac |
diff --git a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/configured_and_mounted.pass.sh b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/configured_and_mounted.pass.sh
|
|
|
7629ac |
new file mode 100644
|
|
|
7629ac |
index 0000000000..ad3c5d4f50
|
|
|
7629ac |
--- /dev/null
|
|
|
7629ac |
+++ b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/configured_and_mounted.pass.sh
|
|
|
7629ac |
@@ -0,0 +1,13 @@
|
|
|
7629ac |
+#!/bin/bash
|
|
|
7629ac |
+# profiles = xccdf_org.ssgproject.content_profile_C2S
|
|
|
7629ac |
+
|
|
|
7629ac |
+. ../partition.sh
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Make sure scenario preparation starts from a clean state
|
|
|
7629ac |
+clean_up_partition /var/tmp
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Redefine PARTITION variable defined in partition.sh
|
|
|
7629ac |
+PARTITION="/tmp"
|
|
|
7629ac |
+make_fstab_bind_partition_line /var/tmp
|
|
|
7629ac |
+
|
|
|
7629ac |
+mount_bind_partition /var/tmp
|
|
|
7629ac |
diff --git a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/just_configured.fail.sh b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/just_configured.fail.sh
|
|
|
7629ac |
new file mode 100644
|
|
|
7629ac |
index 0000000000..87e7fc9726
|
|
|
7629ac |
--- /dev/null
|
|
|
7629ac |
+++ b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/just_configured.fail.sh
|
|
|
7629ac |
@@ -0,0 +1,11 @@
|
|
|
7629ac |
+#!/bin/bash
|
|
|
7629ac |
+# profiles = xccdf_org.ssgproject.content_profile_C2S
|
|
|
7629ac |
+
|
|
|
7629ac |
+. ../partition.sh
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Make sure scenario preparation starts from a clean state
|
|
|
7629ac |
+clean_up_partition /var/tmp
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Redefine PARTITION variable defined in partition.sh
|
|
|
7629ac |
+PARTITION="/tmp"
|
|
|
7629ac |
+make_fstab_bind_partition_line /var/tmp
|
|
|
7629ac |
diff --git a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/just_mounted.fail.sh b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/just_mounted.fail.sh
|
|
|
7629ac |
new file mode 100644
|
|
|
7629ac |
index 0000000000..d1bcb5a220
|
|
|
7629ac |
--- /dev/null
|
|
|
7629ac |
+++ b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/just_mounted.fail.sh
|
|
|
7629ac |
@@ -0,0 +1,10 @@
|
|
|
7629ac |
+#!/bin/bash
|
|
|
7629ac |
+# profiles = xccdf_org.ssgproject.content_profile_C2S
|
|
|
7629ac |
+
|
|
|
7629ac |
+. ../partition.sh
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Make sure scenario preparation starts from a clean state
|
|
|
7629ac |
+clean_up_partition /var/tmp
|
|
|
7629ac |
+
|
|
|
7629ac |
+# just mount the partition
|
|
|
7629ac |
+mount -B /tmp /var/tmp
|
|
|
7629ac |
diff --git a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/separated_and_mounted.fail.sh b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/separated_and_mounted.fail.sh
|
|
|
7629ac |
new file mode 100644
|
|
|
7629ac |
index 0000000000..e315c54293
|
|
|
7629ac |
--- /dev/null
|
|
|
7629ac |
+++ b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/separated_and_mounted.fail.sh
|
|
|
7629ac |
@@ -0,0 +1,14 @@
|
|
|
7629ac |
+#!/bin/bash
|
|
|
7629ac |
+# profiles = xccdf_org.ssgproject.content_profile_C2S
|
|
|
7629ac |
+
|
|
|
7629ac |
+. ../partition.sh
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Make sure scenario preparation starts from a clean state
|
|
|
7629ac |
+clean_up_partition /var/tmp
|
|
|
7629ac |
+
|
|
|
7629ac |
+# by default /tmp is already configured and mounted
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Redefine PARTITION
|
|
|
7629ac |
+mkdir -p "$PARTITION"
|
|
|
7629ac |
+make_fstab_bind_partition_line /var/tmp
|
|
|
7629ac |
+mount_bind_partition /var/tmp
|
|
|
7629ac |
diff --git a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/wrong_bind.fail.sh b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/wrong_bind.fail.sh
|
|
|
7629ac |
new file mode 100644
|
|
|
7629ac |
index 0000000000..6ec7d6cdea
|
|
|
7629ac |
--- /dev/null
|
|
|
7629ac |
+++ b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_bind/wrong_bind.fail.sh
|
|
|
7629ac |
@@ -0,0 +1,13 @@
|
|
|
7629ac |
+#!/bin/bash
|
|
|
7629ac |
+# profiles = xccdf_org.ssgproject.content_profile_C2S
|
|
|
7629ac |
+
|
|
|
7629ac |
+. ../partition.sh
|
|
|
7629ac |
+
|
|
|
7629ac |
+# Make sure scenario preparation starts from a clean state
|
|
|
7629ac |
+clean_up_partition /var/tmp
|
|
|
7629ac |
+
|
|
|
7629ac |
+# PARTITION is defined in partition.sh
|
|
|
7629ac |
+mkdir -p "$PARTITION"
|
|
|
7629ac |
+make_fstab_bind_partition_line /var/tmp
|
|
|
7629ac |
+
|
|
|
7629ac |
+mount_bind_partition /var/tmp
|
|
|
7629ac |
diff --git a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_noexec/fstab.fail.sh b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_noexec/fstab.fail.sh
|
|
|
7629ac |
index 37bc6e9881..431636bd13 100644
|
|
|
7629ac |
--- a/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_noexec/fstab.fail.sh
|
|
|
7629ac |
+++ b/tests/data/group_system/group_permissions/group_partitions/rule_mount_option_var_tmp_noexec/fstab.fail.sh
|
|
|
7629ac |
@@ -5,6 +5,6 @@
|
|
|
7629ac |
|
|
|
7629ac |
create_partition
|
|
|
7629ac |
|
|
|
7629ac |
-make_fstab_given_partition_line /var/tmp nodev
|
|
|
7629ac |
+make_fstab_given_partition_line /var/tmp ext2 nodev
|
|
|
7629ac |
|
|
|
7629ac |
mount_partition /var/tmp
|
|
|
7629ac |
diff --git a/ubuntu1404/templates/csv/mount_options.csv b/ubuntu1404/templates/csv/mount_options.csv
|
|
|
7629ac |
index 6e00a922cc..c85df506af 100644
|
|
|
7629ac |
--- a/ubuntu1404/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ b/ubuntu1404/templates/csv/mount_options.csv
|
|
|
7629ac |
@@ -19,4 +19,3 @@
|
|
|
7629ac |
/tmp,nodev
|
|
|
7629ac |
/tmp,nosuid
|
|
|
7629ac |
/usr,nodev
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/ubuntu1604/templates/csv/mount_options.csv b/ubuntu1604/templates/csv/mount_options.csv
|
|
|
7629ac |
index 6e00a922cc..c85df506af 100644
|
|
|
7629ac |
--- a/ubuntu1604/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ b/ubuntu1604/templates/csv/mount_options.csv
|
|
|
7629ac |
@@ -19,4 +19,3 @@
|
|
|
7629ac |
/tmp,nodev
|
|
|
7629ac |
/tmp,nosuid
|
|
|
7629ac |
/usr,nodev
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
diff --git a/wrlinux/templates/csv/mount_options.csv b/wrlinux/templates/csv/mount_options.csv
|
|
|
7629ac |
index 6bbdea38f9..9f4361a7f4 100644
|
|
|
7629ac |
--- a/wrlinux/templates/csv/mount_options.csv
|
|
|
7629ac |
+++ b/wrlinux/templates/csv/mount_options.csv
|
|
|
7629ac |
@@ -12,5 +12,4 @@
|
|
|
7629ac |
/tmp,nodev
|
|
|
7629ac |
/tmp,noexec
|
|
|
7629ac |
/tmp,nosuid
|
|
|
7629ac |
-/var/tmp,bind
|
|
|
7629ac |
|