Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3768665
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/roles/core/monitoring/files/checks/nrpe/os_family/FreeBSD/check-swap-encryption.sh b/roles/core/monitoring/files/checks/nrpe/os_family/FreeBSD/check-swap-encryption.sh
new file mode 100755
index 0000000..68fca4d
--- /dev/null
+++ b/roles/core/monitoring/files/checks/nrpe/os_family/FreeBSD/check-swap-encryption.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# NRPE :: Check if swap is encrypted
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: BSD-2-Clause
+# Source file: roles/core/monitoring/files/checks/nrpe/os_family/FreeBSD/check-swap-encryption.sh
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Detect swap partitions from /etc/fstab
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+SWAP_PARTITIONS=$(grep swap /etc/fstab | awk '{print $1}')
+
+if [ "$SWAP_PARTITIONS" = "" ]; then
+ echo "No swap partition declared in /etc/fstab"
+ exit 1
+fi
+
+# -------------------------------------------------------------
+# Check encryption
+#
+# A swap partition is automatically encrypted on FreeBSD
+# when the partition name has a suffix .eli or .bde
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+for partition in $SWAP_PARTITIONS; do
+ echo "$partition" | grep -q -E '\.eli$|\.bde$'
+ if [ $? -ne 0 ]; then
+ echo "$partition swap partition should be encrypted using gbde or geli" >&2
+ echo "See https://docs.freebsd.org/en/books/handbook/disks/#swap-encrypting" >&2
+ exit 2
+ fi
+done
+
+exit 0
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 09:33 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2257576
Default Alt Text
(1 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment