diff --git a/ct/patchmon.sh b/ct/patchmon.sh index cebc1b017..f0401d83a 100644 --- a/ct/patchmon.sh +++ b/ct/patchmon.sh @@ -76,7 +76,15 @@ EOF CLEAN_INSTALL=1 fetch_and_deploy_gh_release "PatchMon" "PatchMon/PatchMon" "singlefile" "latest" "/opt/patchmon" "patchmon-server-linux-$(arch_resolve)" mv /opt/patchmon/PatchMon /opt/patchmon/patchmon-server - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ssg-content" "ComplianceAsCode/content" "prebuild" "latest" "/opt/patchmon/ssg-content" "scap-security-guide-*.tar.gz" + + msg_info "Updating SCAP Content" + RELEASE=$(get_latest_github_release "ComplianceAsCode/content") + curl_with_retry "https://github.com/ComplianceAsCode/content/releases/download/v${RELEASE}/scap-security-guide-${RELEASE}.tar.gz" "/tmp/ssg.tar.gz" + mkdir -p /opt/patchmon/ssg-content + find /opt/patchmon/ssg-content -mindepth 1 -delete + tar -xzf /tmp/ssg.tar.gz -C /opt/patchmon/ssg-content --strip-components=1 --wildcards '*/ssg-*-ds.xml' + rm -f /tmp/ssg.tar.gz + msg_ok "Updated SCAP Content" restore_backup diff --git a/install/patchmon-install.sh b/install/patchmon-install.sh index 68bf8a82d..b3627274d 100644 --- a/install/patchmon-install.sh +++ b/install/patchmon-install.sh @@ -86,7 +86,13 @@ for arch in "${AGENT_NAME[@]}"; do done msg_ok "Fetched PatchMon agent binaries" -fetch_and_deploy_gh_release "ssg-content" "ComplianceAsCode/content" "prebuild" "latest" "/opt/patchmon/ssg-content" "scap-security-guide-*.tar.gz" +msg_info "Fetching SCAP Content" +RELEASE=$(get_latest_github_release "ComplianceAsCode/content") +curl_with_retry "https://github.com/ComplianceAsCode/content/releases/download/v${RELEASE}/scap-security-guide-${RELEASE}.tar.gz" "/tmp/ssg.tar.gz" +mkdir -p /opt/patchmon/ssg-content +tar -xzf /tmp/ssg.tar.gz -C /opt/patchmon/ssg-content --strip-components=1 --wildcards '*/ssg-*-ds.xml' +rm -f /tmp/ssg.tar.gz +msg_ok "Fetched SCAP Content" msg_info "Creating service" cat </etc/systemd/system/patchmon-server.service