7.7. Creating a remediation Bash script for a later application
Use this procedure to create a Bash script containing remediations that align your system with a security profile such as HIPAA. Using the following steps, you do not do any modifications to your system, you only prepare a file for later application.
Conditions préalables
-
The
scap-security-guide
package is installed on your RHEL system.
Procédure
Use the
oscap
command to scan the system and to save the results to an XML file. In the following example,oscap
evaluates the system against thehipaa
profile:# oscap xccdf eval --profile hipaa --results hipaa-results.xml /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
Generate a Bash script based on the results file generated in the previous step:
# oscap xccdf generate fix --profile hipaa --fix-type bash --output hipaa-remediations.sh hipaa-results.xml
-
The
hipaa-remediations.sh
file contains remediations for rules that failed during the scan performed in step 1. After reviewing this generated file, you can apply it with the./hipaa-remediations.sh
command when you are in the same directory as this file.
Vérification
-
In a text editor of your choice, review that the
hipaa-remediations.sh
file contains rules that failed in the scan performed in step 1.
Ressources supplémentaires
-
scap-security-guide(8)
,oscap(8)
, andbash(1)
man pages