mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-05 20:03:48 +00:00
71 lines
2.0 KiB
Bash
71 lines
2.0 KiB
Bash
#!/bin/bash
|
|
# ProxMenux - Security Menu
|
|
# ============================================
|
|
# Author : MacRimi
|
|
# Copyright : (c) 2024 MacRimi
|
|
# License : (GPL-3.0) (https://github.com/MacRimi/ProxMenux/blob/main/LICENSE)
|
|
# Version : 1.0
|
|
# ============================================
|
|
|
|
SCRIPT_TITLE="Security Tools"
|
|
|
|
BASE_DIR="/usr/local/share/proxmenux"
|
|
UTILS_FILE="$BASE_DIR/utils.sh"
|
|
LOCAL_SCRIPTS="$BASE_DIR/scripts"
|
|
|
|
if [[ -f "$UTILS_FILE" ]]; then
|
|
source "$UTILS_FILE"
|
|
fi
|
|
|
|
load_language
|
|
initialize_cache
|
|
|
|
# ==========================================================
|
|
# Security Menu
|
|
# ==========================================================
|
|
security_menu() {
|
|
while true; do
|
|
local menu_text
|
|
menu_text="\n$(translate 'Security tools for hardening and auditing your Proxmox VE system.')\n\n"
|
|
menu_text+="$(translate 'Select an option:')"
|
|
|
|
local OPTION
|
|
OPTION=$(dialog --backtitle "ProxMenux" \
|
|
--title "$(translate "$SCRIPT_TITLE")" \
|
|
--menu "$menu_text" 18 70 4 \
|
|
"1" "$(translate 'Fail2Ban - Intrusion Prevention')" \
|
|
"2" "$(translate 'Lynis - Security Audit')" \
|
|
"0" "$(translate 'Return to Main Menu')" \
|
|
3>&1 1>&2 2>&3) || OPTION="0"
|
|
|
|
case "$OPTION" in
|
|
1)
|
|
if [[ -f "$LOCAL_SCRIPTS/security/fail2ban_installer.sh" ]]; then
|
|
bash "$LOCAL_SCRIPTS/security/fail2ban_installer.sh"
|
|
else
|
|
msg_error "$(translate 'Script not found:') fail2ban_installer.sh"
|
|
sleep 2
|
|
fi
|
|
;;
|
|
2)
|
|
if [[ -f "$LOCAL_SCRIPTS/security/lynis_installer.sh" ]]; then
|
|
bash "$LOCAL_SCRIPTS/security/lynis_installer.sh"
|
|
else
|
|
msg_error "$(translate 'Script not found:') lynis_installer.sh"
|
|
sleep 2
|
|
fi
|
|
;;
|
|
0|*)
|
|
break
|
|
;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
# ==========================================================
|
|
# Main
|
|
# ==========================================================
|
|
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
|
|
security_menu
|
|
fi
|