OS security hardening guide
Learn how to use OpenSCAP to security harden the operating system in an Exasol deployment.
The OpenSCAP open-source project provides a toolkit for parsing and evaluating components of the Security Content Automation Protocol standard (SCAP).
This article explains how to use the NIST-certified command line scanner oscap provided by OpenSCAP to perform a CIS Level 2 Benchmark scan on an Exasol host system and generate a report.
The following example shows how to install and run oscap in Ubuntu 24.04 LTS. If the Exasol host is running a different Linux distribution, refer to the OpenSCAP documentation .
-
To learn which Linux distributions are supported in Exasol, see System requirements.
-
For more information about OpenSCAP, visit the OpenSCAP website.
Prerequisites
-
An Exasol host system running on Ubuntu 24.04 LTS
-
An additional equivalent Exasol system for testing remediations (optional but strongly recommended)
Install oscap and run a scan
-
Download and install OpenSCAP and additional necessary tools:
Copyapt-get update
apt-get install -y \
openscap-scanner \
openscap-utils \
git \
wget \
unzip \
lsb-release -
Get the latest SSG version number:
CopySSG_VERSION=$(git ls-remote --tags --refs --sort='v:refname' https://github.com/ComplianceAsCode/content.git | grep -Pio '(\d+(\.)){2}[\w\.-][\d+]' | tail -1) -
Get the Ubuntu release number:
CopyUBUNTU_RELEASE=$(lsb_release -r | grep -Pio '(\d+\.\d+)' | sed 's/\.//g') -
Check to make sure the variables are not null:
Copyecho "SSG Version: $SSG_VERSION"
echo "Ubuntu Release: $UBUNTU_RELEASE"
SSG Version: 0.1.82
Ubuntu Release: 2404 -
Download the most recent security guide:
Copywget https://github.com/ComplianceAsCode/content/releases/download/v${SSG_VERSION}/scap-security-guide-${SSG_VERSION}.zip -O ssg.zip
unzip -jo ssg.zip "scap-security-guide-${SSG_VERSION}/*" -d ssg -
Scan using the CIS Level 2 compliance profile:
Copyoscap xccdf eval --profile xccdf_org.ssgproject.content_profile_cis_level2_server --results oscap-results.xml ssg/ssg-ubuntu${UBUNTU_RELEASE}-ds.xmlWhich compliance profiles are available depends on the operating system used. To review the available profiles, use
oscap info. -
Generate a HTML version of the scan report:
Copyoscap xccdf generate report oscap-results.xml > oscap-results.html -
Review the results in oscap-results.html.
-
Apply the available remediations:
Do not apply remediations directly on a production Exasol host without first testing the impact on an equivalent system. The remediations can alter SSH, PAM, audit, firewall, password, service, and filesystem settings.
Copyoscap xccdf eval --remediate --profile xccdf_org.ssgproject.content_profile_cis_level2_server --results oscap-results-remediated.xml ssg/ssg-ubuntu${UBUNTU_RELEASE}-ds.xml -
Generate a new scan report:
Copyoscap xccdf generate report oscap-results-remediated.xml > oscap-results-remediated.html -
Review the remediation results in oscap-results-remediated.html.