From b58e9edbcf6dde1c3d35e4d5e14f613dcdc22f69 Mon Sep 17 00:00:00 2001 From: Allen Golbig Date: Tue, 3 Jan 2023 10:20:34 -0500 Subject: [PATCH] fix[script] added timestamp to remediations Added timestamp to compliance script when remediating --- scripts/generate_guidance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate_guidance.py b/scripts/generate_guidance.py index 4a4b8ad5..e016d27d 100755 --- a/scripts/generate_guidance.py +++ b/scripts/generate_guidance.py @@ -986,11 +986,11 @@ if [[ ! $exempt == "1" ]] || [[ -z $exempt ]];then if [[ ${rule_yaml['id']}_audit_score == "true" ]]; then ask '{rule_yaml['id']} - Run the command(s)-> {quotify(get_fix_code(rule_yaml['fix']).strip())} ' N if [[ $? == 0 ]]; then - echo 'Running the command to configure the settings for: {rule_yaml['id']} ...' | /usr/bin/tee -a "$audit_log" + echo "$(date -u) Running the command to configure the settings for: {rule_yaml['id']} ..." | /usr/bin/tee -a "$audit_log" {get_fix_code(rule_yaml['fix']).strip()} fi else - echo 'Settings for: {rule_yaml['id']} already configured, continuing...' | /usr/bin/tee -a "$audit_log" + echo "$(date -u) Settings for: {rule_yaml['id']} already configured, continuing..." | /usr/bin/tee -a "$audit_log" fi elif [[ ! -z "$exempt_reason" ]];then echo "$(date -u) {rule_yaml['id']} has an exemption, remediation skipped (Reason: "$exempt_reason")" | /usr/bin/tee -a "$audit_log"