firmware: allow to run audits from firmware upgrade console option #4500

Type "s" for security audit, or "h" for health audit.

We don't add it to the option prompt to not clutter the menu flow.
This is mostly for debug and development purposes.
This commit is contained in:
Franco Fichtner 2021-01-16 16:22:56 +01:00
parent 7d5b8bc24e
commit d91e308001
3 changed files with 17 additions and 5 deletions

View File

@ -234,8 +234,7 @@ EOF
echo "***GOT REQUEST TO AUDIT HEALTH***" >> ${LOCKFILE}
${TEE} ${LOCKFILE} < ${PIPEFILE} &
echo "Currently running $(opnsense-version) at $(date)" > ${PIPEFILE}
echo "Currently running $(opnsense-version) at $(date)" >> ${LOCKFILE}
set_check kernel
set_check base

View File

@ -33,8 +33,7 @@ rm -f ${PIPEFILE}
mkfifo ${PIPEFILE}
echo "***GOT REQUEST TO AUDIT SECURITY***" >> ${LOCKFILE}
${TEE} ${LOCKFILE} < ${PIPEFILE} &
echo "Currently running $(opnsense-version) at $(date)" > ${PIPEFILE}
echo "Currently running $(opnsense-version) at $(date)" >> ${LOCKFILE}
${TEE} ${LOCKFILE} < ${PIPEFILE} &
pkg audit -F > ${PIPEFILE} 2>&1
sleep 1 # give the system time to flush the buffer to console

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2015-2019 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2021 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -69,6 +69,20 @@ case ${YN} in
${NAME})
ARGS="upgrade ${NAME}"
;;
[sS])
echo
/usr/local/opnsense/scripts/firmware/launcher.sh security
echo
read -p "Press any key to return to menu." WAIT
exit 0
;;
[hH])
echo
/usr/local/opnsense/scripts/firmware/launcher.sh health
echo
read -p "Press any key to return to menu." WAIT
exit 0
;;
*)
exit 0
;;