<br><br><div class="gmail_quote">On Thu, Jan 31, 2013 at 9:49 AM, Mike Palmiotto <span dir="ltr"><<a href="mailto:mpalmiotto@tresys.com" target="_blank">mpalmiotto@tresys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 1/31/2013 9:38 AM, Brian Millett wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm really interested in adding fixes, or having a set of fixes I can apply to<br>
the xccdf for rhel6. I've looked at the line in the Makefile:<br>
<br>
xsltproc -stringparam fixes "../$(IN)/fixes/bash-ks.xml" -o<br>
$(OUT)/unlinked-rhel6-xccdf.<u></u>xml $(TRANS)/xccdf-addfixes.xslt<br>
$(OUT)/unlinked-rhel6-xccdf.<u></u>xml<br>
<br>
and it looks like, following the bas-ks.xml, I can create a file with each fix<br>
as long as each fix-id is the same as the rule-id so that the fix can be<br>
merged with the appropriate rule into a final xccdf.xml file.<br>
</blockquote>
<br></div>
When you say fix-id, do you mean the rule attribute for each fix tag?<br clear="all"></blockquote><div><br>Ok, silly me, I went back and looked at the bash-ks.xml and I had totally miss read the fix.<br><br>In the bash-ks.xml a fix is as<br>
<br> <fix rule="disable_vsftp">service vsftpd stop</fix><br><br>while in a xccdf Rule tag, the fix is as<br><br><fix id="service_restorecond_enabled" reboot="false" platform="" system="">chkconfig restorecond on</fix><br>
</div></div><br><br>So, I didn't grok the "id=" vs the "rule=". <br><br>That makes sense.<br><br>So the bash-ks.xml is<br><br><fix-group id="bash" system="urn:xccdf:fix:script:bash" xmlns="<a href="http://checklists.nist.gov/xccdf/1.1">http://checklists.nist.gov/xccdf/1.1</a>"><br>
<fix rule="password_min_len">##According to the OVAL check, there are two places to check for the MINLEN<br> #1 in /etc/login.defs<br> sed --follow-symlinks -i '/^PASS_MIN_LEN/s/[0-9][0-9]*/14/' /etc/login.defs<br>
<br> # and<br> # 2 in /etc/pam.d/system-auth<br> grep -q minlen /etc/pam.d/system-auth<br> if [ $? = "0" ]; then<br> sed --follow-symlinks -i '/<a href="http://pam_cracklib.so/s/minlen=[0-9]/minlen=14/">pam_cracklib.so/s/minlen=[0-9]/minlen=14/</a>' /etc/pam.d/system-auth<br>
else<br> sed --follow-symlinks -i '/<a href="http://pam_cracklib.so/s/pam_cracklib.so">pam_cracklib.so/s/pam_cracklib.so</a> /pam_cracklib.so minlen=14 /' /etc/pam.d/system-auth<br> fi</fix><br> <fix rule="password_min_age">sed --follow-symlinks -i '/^PASS_MIN_DAYS/s/[0-9][0-9]*/7/' /etc/login.defs</fix><br>
<fix rule="password_max_age">sed --follow-symlinks -i '/^PASS_MAX/s/[0-9][0-9]*/90/' /etc/login.defs</fix><br> <fix rule="password_warn_age">sed --follow-symlinks -i '/^PASS_WARN_AGE/s/[0-9][0-9]*/14/' /etc/login.defs</fix><br>
<fix rule="account_disable_post_pw_expiration">sed --follow-symlinks -i '/^INACTIVE/s/[-]*[0-9][0-9]*/35/' /etc/default/useradd</fix><br> <fix rule="account_unique_name" /><br>
<fix rule="password_retry">sed --follow-symlinks -i '/<a href="http://pam_cracklib.so/s/retry=[0-9]/retry=3/">pam_cracklib.so/s/retry=[0-9]/retry=3/</a>' /etc/pam.d/system-auth</fix><br> <fix rule="password_require_consecrepeat">grep -q maxrepeat /etc/pam.d/system-auth<br>
if [ $? = "0" ]; then<br> sed --follow-symlinks -i '/<a href="http://pam_cracklib.so/s/maxrepeat=[0-9]/maxrepeat=3/">pam_cracklib.so/s/maxrepeat=[0-9]/maxrepeat=3/</a>' /etc/pam.d/system-auth<br> else<br>
sed --follow-symlinks -i '/<a href="http://pam_cracklib.so/s/pam_cracklib.so">pam_cracklib.so/s/pam_cracklib.so</a> /pam_cracklib.so maxrepeat=3 /' /etc/pam.d/system-auth<br> fi</fix><br> <fix rule="password_require_digits">grep -q dcredit /etc/pam.d/system-auth<br>
if [ $? = "0" ]; then<br> sed --follow-symlinks -i '/<a href="http://pam_cracklib.so/s/dcredit=[0-9]/dcredit=1/">pam_cracklib.so/s/dcredit=[0-9]/dcredit=1/</a>' /etc/pam.d/system-auth<br> else<br> sed --follow-symlinks -i '/<a href="http://pam_cracklib.so/s/pam_cracklib.so">pam_cracklib.so/s/pam_cracklib.so</a> /pam_cracklib.so dcredit=1 /' /etc/pam.d/system-auth<br>
fi</fix><br> <fix rule="password_require_uppercases">grep -q ucredit /etc/pam.d/system-auth<br> if [ $? = "0" ]; then<br> sed --follow-symlinks -i '/<a href="http://pam_cracklib.so/s/ucredit=[0-9]/ucredit=2/">pam_cracklib.so/s/ucredit=[0-9]/ucredit=2/</a>' /etc/pam.d/system-auth<br>
else<br> sed --follow-symlinks -i '/<a href="http://pam_cracklib.so/s/pam_cracklib.so">pam_cracklib.so/s/pam_cracklib.so</a> /pam_cracklib.so ucredit=2 /' /etc/pam.d/system-auth<br> fi</fix><br></fix-group><br>
<br>-- <br>Brian Millett <br> "Shifts in paradigms<br> often cause nose bleeds."<br>Greg Glenn