This course is using an outdated version of the technology and is now considered to be Legacy content. It will be removed from our catalog on June 28, 2024. Please be sure to complete your course and finish any remaining labs before that date. We recommend moving to version 9.2, which is the latest version currently available.
In this exercise, you will select a subset of checks to perform from a SCAP policy by creating a tailoring file with SCAP Workbench. You will then test the tailored policy by scanning one of your servers and reviewing the results.
Outcomes
You should be able to:
Create a tailoring file that has most checks disabled, using SCAP Workbench.
Scan the system using the customized policy.
Review the results and compare to the report from the previous exercise.
Confirm that the workstation and serverc machines are started.
Log in to workstation as student using student as the password.
On workstation, run lab oscap-custom setup to verify that the environment is ready.
This script also installs the openscap-scanner and scap-security-guide packages on serverc.
[student@workstation ~]$lab oscap-custom setup
On workstation, use the SCAP Workbench graphical utility to customize the United States Government Configuration Baseline (USGCB / STIG) profile.
Start SCAP Workbench by running the scap-workbench command.
[student@workstation ~]$scap-workbench
SCAP Workbench detects that the SCAP Security Guide is already installed on the system and asks you to select the content to use.
In the Select content to load field, select RHEL7 and click .
Locate the Profile field and select United States Government Configuration Baseline (USGCB / STIG) - DRAFT.
Click at the right of that field.
In the New Profile ID field, enter xccdf_com.example_profile_RH415-rhel7 and click .
The new window displays all the available rules. The rules included in the United States Government Configuration Baseline profile are selected.
Click and select the three following rules in the Updating Software section:
Ensure gpgcheck Enabled In Main Yum Configuration
Ensure gpgcheck Enabled For All Yum Package repositories
Ensure YUM Removes Previous Package Versions
In the Set Password Quality Requirements with pam_pwquality section, select the following:
Select Set Password Minimum Length to enable the test.
Click minlen.
In the right pane, under Modify Value, select 6.
This sets the pam_pwquality minlen option to 6.
Click .
Save the customization in a tailoring file.
Select → and enter RH415-tailoring.xml for the file name.
Close SCAP Workbench.
Scan serverc for compliance with your customization of the OSPP profile.
As student, use scp to copy the RH415-tailoring.xml tailoring file to serverc.
No password is required.
[student@workstation ~]$scp RH415-tailoring.xml student@serverc:RH415-tailoring.xml 100% 67KB 11.9MB/s 00:00
Log in to serverc as student.
No password is required.
[student@workstation ~]$ssh student@serverc[student@serverc ~]$
Use the sudo -i command to switch identity to the root user.
Use student as the password.
[student@serverc ~]$sudo -i[sudo] password for student:student[root@serverc ~]#
Use the oscap info command on the /home/student/RH415-tailoring.xml tailoring file to retrieve the associated profile.
[root@serverc ~]#oscap info /home/student/RH415-tailoring.xmlDocument type: XCCDF Tailoring Imported: 2018-07-27T07:02:06 Benchmark Hint: /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml Profiles: Title: United States Government Configuration Baseline (USGCB / STIG) - DRAFT [CUSTOMIZED] Id:xccdf_com.example_profile_RH415-rhel7
Scan the system for compliance with your customization.
Save the result in the /root/RH415-results.xml file.
[root@serverc ~]#oscap xccdf eval \>--profile xccdf_com.example_profile_RH415-rhel7 \>--tailoring-file /home/student/RH415-tailoring.xml \>--results /root/RH415-results.xml \>/usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xmlWARNING: This content points out to the remote resources. Use `--fetch-remote-resources' option to download them. WARNING: Skipping https://learn.spidernet.pl/security/data/oval/com.redhat.rhsa-RHEL7.xml.bz2 file which is referenced from XCCDF content Title Ensure gpgcheck Enabled In Main Yum Configuration Rule xccdf_org.ssgproject.content_rule_ensure_gpgcheck_globally_activated Ident CCE-26989-4 Result pass Title Ensure gpgcheck Enabled For All Yum Package Repositories Rule xccdf_org.ssgproject.content_rule_ensure_gpgcheck_never_disabled Ident CCE-26876-3 Result pass Title Ensure YUM Removes Previous Package Versions Rule xccdf_org.ssgproject.content_rule_clean_components_post_updating Ident CCE-80346-0 Result fail Title Set Password Minimum Length Rule xccdf_org.ssgproject.content_rule_accounts_password_pam_minlen Ident CCE-27293-0 Result fail
When the scan is complete, convert the /root/RH415-results.xml file in HTML.
Save the HTML report in /root/RH415-results.html.
[root@serverc ~]#oscap xccdf generate report \>RH415-results.xml > RH415-results.html[root@serverc ~]#
Use scp to copy the RH415-results.html file to workstation so you can use Firefox to display it.
Use student as the password.
[root@serverc ~]#scp RH415-results.html student@workstation:student@workstation's password:studentRH415-results.html 100% 266KB 24.2MB/s 00:00
Log off from serverc.
[root@serverc ~]#logout[student@serverc ~]$logout[student@workstation ~]$
Use Firefox to display the RH415-results.html file.
[student@workstation ~]$firefox RH415-results.html
Notice that the page only displays the rules from your tailoring file. Close Firefox when you are done exploring the scan results.