Skip to content

Commit

Permalink
feat: add mscp info to compliance logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Brodjieski committed May 21, 2024
1 parent 4b568fd commit 1f4d3ee
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/generate_guidance.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,12 +859,16 @@ def generate_script(baseline_name, audit_name, build_path, baseline_yaml, refere
run_scan(){{
# append to existing logfile
if [[ $(/usr/bin/tail -n 1 "$audit_log" 2>/dev/null) = *"Remediation complete" ]]; then
echo "$(date -u) Beginning {baseline_name} baseline scan" >> "$audit_log"
else
echo "$(date -u) Beginning {baseline_name} baseline scan" > "$audit_log"
if [[ ! $(/usr/bin/tail -n 1 "$audit_log" 2>/dev/null) = *"Remediation complete" ]]; then
echo "$(date -u) MSCP COMPLIANCE SCRIPT BUILD INFORMATION" > "$audit_log"
echo "$(date -u) MSCP RELEASE: {version}" >> "$audit_log"
echo "$(date -u) BUILD: {mscp_version}" >> "$audit_log"
echo "$(date -u) BASELINE: {baseline_yaml['title']}" >> "$audit_log"
echo "$(date -u) DATE: {date.today()}" >> "$audit_log"
fi
echo "$(date -u) Beginning {baseline_name} baseline scan" >> "$audit_log"
# run mcxrefresh
/usr/bin/mcxrefresh -u $CURR_USER_UID
Expand Down

0 comments on commit 1f4d3ee

Please sign in to comment.