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 configure an existing Satellite Server to perform OpenSCAP scans.
Outcomes
You should be able to configure an existing Satellite Server to push OpenSCAP client to the registered hosts to perform OpenSCAP scans.
Confirm that the workstation, satellite, and serverd machines are started.
Log in to workstation as student using student as the password.
On workstation, run lab compliance-config setup to verify that the environment is ready.
[student@workstation ~]$lab compliance-config setup
On workstation, open a web browser and navigate to https://satellite.lab.example.com.
Log in as admin using redhat as the password.
From workstation, open a web browser and navigate to https://satellite.lab.example.com.
Accept the self-signed certificate and log in as admin using redhat as the password.
Verify that a host group named org-hostgroup1 exists in the org-example organization.
Set the organization context to org-example.
Navigate to → and select .
Navigate to → .
Verify that the org-hostgroup1 host group exists.
Click the org-hostgroup1 link to open the group for editing.
Ensure that the following fields are correctly configured:
Table 10.2. Puppet Configurations
| Field | Value |
|---|---|
| Puppet Environment | production |
| Puppet Master | satellite.lab.example.com |
| Puppet CA | satellite.lab.example.com |
| OpenSCAP Capsule | satellite.lab.example.com |
Add the foreman_scap_client Puppet module to the org-hostgroup1.
This Puppet module automatically installs and configures the client's /etc/foreman_scap_client/config.yaml file with parameters that are needed for the operation of OpenSCAP scans and to upload the scan result to the Satellite Server.
From the Edit org-hostgroup1 page, select the Puppet Classes tab.
Click to add the foreman_scap_client Puppet class listed under the foreman_scap_client Puppet module.
Click .
Upload the default OpenSCAP content provided by the scap-security-guide package to the Satellite Server's database.
On workstation, open a command terminal.
Log in to the satellite server as student.
Use the sudo -i command to switch identity to the root user.
Use student as the password.
[student@workstation ~]$ssh student@satellite[student@satellite ~]$sudo -i[sudo] password for student:student[root@satellite ~]#
Use the foreman-rake foreman_openscap:bulk_upload:default command to upload the default SCAP content provided by the scap-security-guide package to the Satellite Server's database.
[root@satellite ~]#foreman-rake foreman_openscap:bulk_upload:defaultSaved /usr/share/xml/scap/ssg/content/ssg-firefox-ds.xml as Red Hat firefox default content Saved /usr/share/xml/scap/ssg/content/ssg-jre-ds.xml as Red Hat jre default content Saved /usr/share/xml/scap/ssg/content/ssg-rhel6-ds.xml as Red Hat rhel6 default content Saved /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml as Red Hat rhel7 default content
Verify that the default SCAP content is uploaded to the Satellite Server's database using the hammer CLI. Use the hammer scap-content list command from the terminal to list the SCAP content loaded to the Satellite Server's database.
[root@satellite ~]#hammer scap-content list---|-------------------------------- ID | TITLE ---|-------------------------------- 1 | Red Hat firefox default content 2 | Red Hat jre default content 3 | Red Hat rhel6 default content 4 | Red Hat rhel7 default content ---|--------------------------------
Log off from satellite.
[root@satellite ~]#logout[student@satellite ~]$logoutConnection to satellite closed.[student@workstation ~]$
View the OpenSCAP content from the Satellite Server web UI.
Navigate to → . The SCAP Contents page lists the default SCAP contents.
In the classroom environment, the serverd.lab.example.com host is already registered to the Satellite Server running on satellite.lab.example.com.
Re-registering serverd to the Satellite Server deletes the host from the Satellite Server and configures the host with the SCAP client and all necessary packages.
Re-registering serverd ensures that the foreman_scap_client Puppet class assigned to the org-hostgroup1 host group is executed.
Log in to serverd as student.
Use the sudo -i command to change to the root user.
Use student as the password.
[student@workstation ~]$ssh student@serverd[student@serverd ~]$sudo -i[sudo] password for student:student[root@serverd ~]#
Download the bootstrap.py script file from http://satellite.lab.example.com/pub/bootstrap.py on serverd.
Change the permission of the bootstrap.py file to make it executable.
[root@serverd ~]#wget http://satellite.lab.example.com/pub/bootstrap.py...output omitted...[root@serverd ~]#chmod a+x bootstrap.py
Run the bootstrap.py script to re-register serverd with the serverkey activation key to the Satellite Server, as shown in the following example.
Use the --force option to overwrite all the registration configurations.
The command re-registers serverd and configures the SCAP client.
Enter redhat as the admin user's password.
[root@serverd ~]#./bootstrap.py -l admin -s satellite.lab.example.com \>-o 'org-example' -L 'Default Location' -a serverkey -g org-hostgroup1 --forceForeman Bootstrap Script This script is designed to register new systems or to migrate an existing system to a Foreman server with Katello admin's password:redhat...output omitted... Complete! Uploading Enabled Repositories Report Loaded plugins: langpacks, product-id, subscription-manager [SUCCESS], [2018-07-25 20:28:35], [/usr/bin/yum -y remove rhn-setup rhn-client-tools yum-rhn-plugin rhnsd rhn-check rhnlib spacewalk-abrt spacewalk-oscap osad 'rh-*-rhui-client' 'candlepin-cert-consumer-*'], completed successfully.
View the /etc/foreman_scap_client/config.yaml file to check the Satellite capsule address to which the SCAP scan reports are uploaded.
Notice that the OpenSCAP policy is not yet defined in the file.
[root@serverd ~]#cat /etc/foreman_scap_client/config.yaml# DO NOT EDIT THIS FILE MANUALLY # IT IS MANAGED BY PUPPET # Foreman proxy to which reports should be uploaded:server: 'satellite.lab.example.com':port: 9090...output omitted... # policy (key is id as in Foreman)
List the OpenSCAP packages installed by the foreman_scap_client Puppet module.
[root@serverd ~]#rpm -qa | grep -E 'foreman_scap|openscap'rubygem-foreman_scap_client-0.3.0-2.el7sat.noarch openscap-scanner-1.2.16-8.el7_5.x86_64 openscap-1.2.16-8.el7_5.x86_64
The rubygem-foreman_scap_client.noarch package provides the client script that runs the OpenSCAP scan and uploads the result to the Satellite Server.
Log off from serverd.
[root@serverd ~]#logout[student@serverd ~]$logoutConnection to serverd closed.[student@workstation ~]$