updated script
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
22f89f4b55
commit
c96f1bc4ac
10
run_audit.sh
10
run_audit.sh
|
@ -17,14 +17,15 @@
|
||||||
# benchmark vars moved
|
# benchmark vars moved
|
||||||
# December 2023 Added goss version and testing
|
# December 2023 Added goss version and testing
|
||||||
# April 2024 Updating of OS discovery to work for all supported OSs
|
# April 2024 Updating of OS discovery to work for all supported OSs
|
||||||
|
# August 2024 Improve failure capture
|
||||||
|
|
||||||
# Variables in upper case tend to be able to be adjusted
|
# Variables in upper case tend to be able to be adjusted
|
||||||
# lower case variables are discovered or built from other variables
|
# lower case variables are discovered or built from other variables
|
||||||
|
|
||||||
# Goss benchmark variables (these should not need changing unless new release)
|
# Goss benchmark variables (these should not need changing unless new release)
|
||||||
BENCHMARK=CIS # Benchmark Name aligns to the audit
|
BENCHMARK=CIS # Benchmark Name aligns to the audit
|
||||||
BENCHMARK_VER=2.0.0
|
BENCHMARK_VER=1.0.0
|
||||||
BENCHMARK_OS=UBUNTU24
|
BENCHMARK_OS=UBUNTU
|
||||||
|
|
||||||
# Goss host Variables
|
# Goss host Variables
|
||||||
AUDIT_BIN="${AUDIT_BIN:-/usr/local/bin/goss}" # location of the goss executable
|
AUDIT_BIN="${AUDIT_BIN:-/usr/local/bin/goss}" # location of the goss executable
|
||||||
|
@ -202,12 +203,13 @@ echo
|
||||||
$AUDIT_BIN -g "$audit_content_dir/$AUDIT_FILE" --vars "$varfile_path" --vars-inline "$audit_json_vars" v $format_output > "$audit_out"
|
$AUDIT_BIN -g "$audit_content_dir/$AUDIT_FILE" --vars "$varfile_path" --vars-inline "$audit_json_vars" v $format_output > "$audit_out"
|
||||||
|
|
||||||
# create screen output
|
# create screen output
|
||||||
if [ "$(grep -c $BENCHMARK "$audit_out")" != 0 ] || [ "$format" = junit ] || [ "$format" = tap ]; then
|
if [ "$(grep -c Count: "$audit_out")" -ge 1 ] || [ "$format" = junit ] || [ "$format" = tap ]; then
|
||||||
eval $output_summary
|
eval $output_summary
|
||||||
echo "Completed file can be found at $audit_out"
|
echo "Completed file can be found at $audit_out"
|
||||||
echo "###############"
|
echo "###############"
|
||||||
echo "Audit Completed"
|
echo "Audit Completed"
|
||||||
echo "###############"
|
echo "###############"
|
||||||
else
|
else
|
||||||
echo -e "Fail: There were issues when running the audit please investigate $audit_out"
|
echo -e "Fail: There were issues when running the audit please investigate $audit_out";
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue