<commit_before>#!/bin/bash

set -u
set -o pipefail

CONTENT="0.1.63"
OVAL="5.10"
PROFILE="cis_level2_server"
REPORT_DATE="$(date +%y%m%d)"
REPORT_NAME="$(hostname -s)-${PROFILE}-report-${REPORT_DATE}.html"

sudo apt-get -y update
sudo apt install -y libopenscap8 unzip wget
wget "https://github.com/ComplianceAsCode/content/releases/download/v${CONTENT}/scap-security-guide-${CONTENT}-oval-${OVAL}.zip"
unzip "scap-security-guide-${CONTENT}-oval-${OVAL}.zip"
cd "scap-security-guide-${CONTENT}-oval-${OVAL}" || exit 1

if lsb_release -d | grep -qo 'Ubuntu\s20.04'; then
  sudo oscap xccdf eval --profile "xccdf_org.ssgproject.content_profile_${PROFILE}" --results-arf "results-${REPORT_DATE}.xml" --report "${REPORT_NAME}" ./ssg-ubuntu2004-ds-1.2.xml
fi

if [ -f "${REPORT_NAME}" ]; then
  sudo chown "$(id -u):$(id -g)" "${REPORT_NAME}"
  cp -v "${REPORT_NAME}" ~/"${REPORT_NAME}"
fi

cd .. || exit 1<commit_msg>update to OSCAP Content 0.1.64<commit_after>#!/bin/bash

set -u
set -o pipefail

CONTENT="0.1.64"
OVAL="5.10"
PROFILE="cis_level2_server"
REPORT_DATE="$(date +%y%m%d)"
REPORT_NAME="$(hostname -s)-${PROFILE}-report-${REPORT_DATE}.html"

sudo apt-get -y update
sudo apt install -y libopenscap8 unzip wget
wget "https://github.com/ComplianceAsCode/content/releases/download/v${CONTENT}/scap-security-guide-${CONTENT}-oval-${OVAL}.zip"
unzip "scap-security-guide-${CONTENT}-oval-${OVAL}.zip"
cd "scap-security-guide-${CONTENT}-oval-${OVAL}" || exit 1

if lsb_release -d | grep -qo 'Ubuntu\s20.04'; then
  sudo oscap xccdf eval --profile "xccdf_org.ssgproject.content_profile_${PROFILE}" --results-arf "results-${REPORT_DATE}.xml" --report "${REPORT_NAME}" ./ssg-ubuntu2004-ds-1.2.xml
fi

if [ -f "${REPORT_NAME}" ]; then
  sudo chown "$(id -u):$(id -g)" "${REPORT_NAME}"
  cp -v "${REPORT_NAME}" ~/"${REPORT_NAME}"
fi

cd .. || exit 1
{'fraction_non_alphanumeric': 0.20727075420510038, 'fraction_numerical': 0.024959305480195332, 'mean_word_length': 4.780564263322884, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5794394', 'n_tokens_mistral': 801, 'n_tokens_neox': 738, 'n_words': 141}