Hello,
I have been following the steps listed on this website to attempt remediation of the selinux_policytype rule.
http://isimluk.livejournal.com/3573.html
I tried to edit the line in the /etc/selinux/config file via a fix tag in the selinux.xml file. After running the make command and re-scanning my system I realized the results omitted ALL rules dealing with Selinux. Just to make sure it wasn't anything within the <fix> tags I inserted a simple "touch" statement. It yielded the same results.
Does anyone know what might be causing this? I am attaching my version of the selinux.xml file.
Thanks,
Luke
On 2/14/14, 12:15 PM, Kordell, Luke T wrote:
<Rule id="selinux_policytype"> <title>Configure SELinux Policy</title> <description>The SELinux <tt>targeted</tt> policy is appropriate for general-purpose desktops and servers, as well as systems in many other roles. To configure the system to use this policy, add or correct the following line in <tt>/etc/selinux/config</tt>: <pre>SELINUXTYPE=targeted</pre> Other policies, such as <tt>mls</tt>, provide additional security labeling and greater confinement but are not compatible with many general-purpose use cases. </description> <ocil clause="it does not"> Check the file <tt>/etc/selinux/config</tt> and ensure the following line appears: <pre>SELINUXTYPE=targeted</pre> </ocil> <rationale> Setting the SELinux policy to <tt>targeted</tt> or a more specialized policy ensures the system will confine processes that are likely to be targeted for exploitation, such as network or system services. </rationale> <fix platform="cpe:/o:redhat:enterprise_linux:6" reboot="false" disruption="low"system="urn:xccdf:fix:script:sh"> touch /home/ltk/success.txt </fix> <ident cce="26875-5" /> <oval id="selinux_policytype" value="var_selinux_policy_name"/> <ref nist="AC-3,AC-3(3),AC-4,AC-6,AU-9" disa="22,32"/> <tested by="DS" on="20121024"/> </Rule> </Group>
SSG docs aren't so great on this. Also, this will help answer Lee's question too.
We broke the core SCAP components up into: - RHEL/6/input/profiles: Houses XCCDF profiles - RHEL/6/input/{services system}: Houses XCCDF content - RHEL/6/input/checks: Houses OVAL content - RHEL/6/input/fixes: Associated fix content
The build system will take the XCCDF rule, e.g. selinux_policytype, add whatever OVAL is identified in the "oval id=" tag, include any XCCDF variables, and merge things together. We kept the XCCDF and OVAL as separate development files to ease multi-author content editing. Imagine the git merge's if we were all working off the same file!
For fix content, the build will take the XCCDF rule name (selinux_policytype) and first look for a bash script under ./RHEL/6/input/fixes/bash with the same name (selinux_policytype.sh). If not found, it'll search ./shared/fixes/bash/. If neither condition is true then remediation doesn't exist and it'll move onto the next rule.
Sometimes remediation scripts will be the same across multiple platforms, e.g. disabling SELinux is the same in RHEL6 and RHEL7. As such, the remediation would go under shared.
Occasionally system components differ, such as systemd in Fedora vs service scripts in RHEL6. As such, the commands differ and the scripts would be placed in the proper directories.
https://git.fedorahosted.org/cgit/scap-security-guide.git/tree/RHEL/6/input/...
Thank you for the input Shawn. I guess the sites I have been referencing are a little dated. Since we are not imbedding bash in the rule .xml file how do we point oscap toward the script during the remediation phase. I tried passing the --remediate argument to oscap but it gave an "unrecognized option" error. Also, how are the rules pointing to the remediation scripts in the fixes directory if we are no longer using fix tags?
Thanks,
Luke ________________________________________ From: scap-security-guide-bounces@lists.fedorahosted.org [scap-security-guide-bounces@lists.fedorahosted.org] on behalf of Shawn Wells [shawn@redhat.com] Sent: Friday, February 14, 2014 10:29 AM To: scap-security-guide@lists.fedorahosted.org Subject: EXTERNAL: Re:
On 2/14/14, 12:15 PM, Kordell, Luke T wrote:
<Rule id="selinux_policytype"> <title>Configure SELinux Policy</title> <description>The SELinux <tt>targeted</tt> policy is appropriate for general-purpose desktops and servers, as well as systems in many other roles. To configure the system to use this policy, add or correct the following line in <tt>/etc/selinux/config</tt>: <pre>SELINUXTYPE=targeted</pre> Other policies, such as <tt>mls</tt>, provide additional security labeling and greater confinement but are not compatible with many general-purpose use cases. </description> <ocil clause="it does not"> Check the file <tt>/etc/selinux/config</tt> and ensure the following line appears: <pre>SELINUXTYPE=targeted</pre> </ocil> <rationale> Setting the SELinux policy to <tt>targeted</tt> or a more specialized policy ensures the system will confine processes that are likely to be targeted for exploitation, such as network or system services. </rationale> <fix platform="cpe:/o:redhat:enterprise_linux:6" reboot="false" disruption="low"system="urn:xccdf:fix:script:sh"> touch /home/ltk/success.txt </fix> <ident cce="26875-5" /> <oval id="selinux_policytype" value="var_selinux_policy_name"/> <ref nist="AC-3,AC-3(3),AC-4,AC-6,AU-9" disa="22,32"/> <tested by="DS" on="20121024"/> </Rule> </Group>
SSG docs aren't so great on this. Also, this will help answer Lee's question too.
We broke the core SCAP components up into: - RHEL/6/input/profiles: Houses XCCDF profiles - RHEL/6/input/{services system}: Houses XCCDF content - RHEL/6/input/checks: Houses OVAL content - RHEL/6/input/fixes: Associated fix content
The build system will take the XCCDF rule, e.g. selinux_policytype, add whatever OVAL is identified in the "oval id=" tag, include any XCCDF variables, and merge things together. We kept the XCCDF and OVAL as separate development files to ease multi-author content editing. Imagine the git merge's if we were all working off the same file!
For fix content, the build will take the XCCDF rule name (selinux_policytype) and first look for a bash script under ./RHEL/6/input/fixes/bash with the same name (selinux_policytype.sh). If not found, it'll search ./shared/fixes/bash/. If neither condition is true then remediation doesn't exist and it'll move onto the next rule.
Sometimes remediation scripts will be the same across multiple platforms, e.g. disabling SELinux is the same in RHEL6 and RHEL7. As such, the remediation would go under shared.
Occasionally system components differ, such as systemd in Fedora vs service scripts in RHEL6. As such, the commands differ and the scripts would be placed in the proper directories.
https://git.fedorahosted.org/cgit/scap-security-guide.git/tree/RHEL/6/input/...
_______________________________________________ scap-security-guide mailing list scap-security-guide@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide
On 2/17/14, 1:45 PM, Kordell, Luke T wrote:
Thank you for the input Shawn. I guess the sites I have been referencing are a little dated. Since we are not imbedding bash in the rule .xml file how do we point oscap toward the script during the remediation phase. I tried passing the --remediate argument to oscap but it gave an "unrecognized option" error.
You may find Šimon Lukašík's blog on OpenSCAP Remediation helpful: http://isimluk.livejournal.com/3573.html
In short: $ oscap xccdf eval --result ~/my-results-xccdf.xml /usr/share/scap/my-policy-xccdf.xml $ oscap xccdf remediate --results ~/my-results-xccdf.xml ~/my-results-xccdf.xml
Also, how are the rules pointing to the remediation scripts in the fixes directory if we are no longer using fix tags?
The build process will take all XCCDF rules, look for a bash script matching the XCCDF rule name, and then create the fix tag in the final output.
Ref https://git.fedorahosted.org/cgit/scap-security-guide.git/tree/RHEL/6/transf... https://git.fedorahosted.org/cgit/scap-security-guide.git/tree/RHEL/6/transf...
To see this in action: [shawn@SSG-RHEL6 6]$ pwd /var/www/html/scap-security-guide/RHEL/6 [shawn@SSG-RHEL6 6]$ make content [shawn@SSG-RHEL6 6]$ grep -rin "<fix" output/ssg-rhel6-xccdf.xml
..... and then find the line numbers in the output/ssg-rhel6-xccdf.xml file
Hello.
I managed to generate the my-results-xccdf.xml file but oscap is still not able to recognize the remediate argument. It gives me a "no such module 'remediate' error. Any idea of what might be causing this?
Luke ________________________________________ From: scap-security-guide-bounces@lists.fedorahosted.org [scap-security-guide-bounces@lists.fedorahosted.org] on behalf of Shawn Wells [shawn@redhat.com] Sent: Monday, February 17, 2014 12:51 PM To: scap-security-guide@lists.fedorahosted.org Subject: Re: EXTERNAL: Re:
On 2/17/14, 1:45 PM, Kordell, Luke T wrote:
Thank you for the input Shawn. I guess the sites I have been referencing are a little dated. Since we are not imbedding bash in the rule .xml file how do we point oscap toward the script during the remediation phase. I tried passing the --remediate argument to oscap but it gave an "unrecognized option" error.
You may find Šimon Lukašík's blog on OpenSCAP Remediation helpful: http://isimluk.livejournal.com/3573.html
In short: $ oscap xccdf eval --result ~/my-results-xccdf.xml /usr/share/scap/my-policy-xccdf.xml $ oscap xccdf remediate --results ~/my-results-xccdf.xml ~/my-results-xccdf.xml
Also, how are the rules pointing to the remediation scripts in the fixes directory if we are no longer using fix tags?
The build process will take all XCCDF rules, look for a bash script matching the XCCDF rule name, and then create the fix tag in the final output.
Ref https://git.fedorahosted.org/cgit/scap-security-guide.git/tree/RHEL/6/transf... https://git.fedorahosted.org/cgit/scap-security-guide.git/tree/RHEL/6/transf...
To see this in action: [shawn@SSG-RHEL6 6]$ pwd /var/www/html/scap-security-guide/RHEL/6 [shawn@SSG-RHEL6 6]$ make content [shawn@SSG-RHEL6 6]$ grep -rin "<fix" output/ssg-rhel6-xccdf.xml
..... and then find the line numbers in the output/ssg-rhel6-xccdf.xml file _______________________________________________ scap-security-guide mailing list scap-security-guide@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide
On 2/18/14, 1:41 PM, Kordell, Luke T wrote:
I managed to generate the my-results-xccdf.xml file but oscap is still not able to recognize the remediate argument. It gives me a "no such module 'remediate' error. Any idea of what might be causing this?
Not offhand. What version of OpenSCAP? I'm using:
$ rpm -qv openscap-utils openscap-utils-0.9.12-1.el6.x86_64
Try 'generate fix':
oscap xccdf generate fix --result-id xccdf_org.open-scap_testresult_stig-rhel6-server-upstream /var/www/html/ssg-results/results.xml > /var/www/html/ssg-results/script.sh
replacing the results.xml path with your own
Hi Shawn,
That appears to have worked on my work system which is running an older version of openscap. I have been attempting remediation on a test system from my house and will look at my version of openscap this evening. If I am running an older version of oscap I will update it and let you know if that resolves my issue. Once I get everything figured out I will write-up some remmediation documentation, which I can share with the community if you feel that would be useful.
Thank you again for all the help.
Luke K ________________________________________ From: scap-security-guide-bounces@lists.fedorahosted.org [scap-security-guide-bounces@lists.fedorahosted.org] on behalf of Shawn Wells [shawn@redhat.com] Sent: Tuesday, February 18, 2014 11:47 AM To: scap-security-guide@lists.fedorahosted.org Subject: Re: EXTERNAL: Re:
On 2/18/14, 1:41 PM, Kordell, Luke T wrote:
I managed to generate the my-results-xccdf.xml file but oscap is still not able to recognize the remediate argument. It gives me a "no such module 'remediate' error. Any idea of what might be causing this?
Not offhand. What version of OpenSCAP? I'm using:
$ rpm -qv openscap-utils openscap-utils-0.9.12-1.el6.x86_64
Try 'generate fix':
oscap xccdf generate fix --result-id xccdf_org.open-scap_testresult_stig-rhel6-server-upstream /var/www/html/ssg-results/results.xml > /var/www/html/ssg-results/script.sh
replacing the results.xml path with your own _______________________________________________ scap-security-guide mailing list scap-security-guide@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide
On 2/18/14, 2:39 PM, Kordell, Luke T wrote:
Hi Shawn,
That appears to have worked on my work system which is running an older version of openscap. I have been attempting remediation on a test system from my house and will look at my version of openscap this evening. If I am running an older version of oscap I will update it and let you know if that resolves my issue. Once I get everything figured out I will write-up some remmediation documentation, which I can share with the community if you feel that would be useful.
Thank you again for all the help.
A writeup would be great. Thanks!
scap-security-guide@lists.fedorahosted.org