[PATCH 3/4] rewrite of combinefixes.py to handle parameters for OpenSCAP remedation generation

Shawn Wells shawn at redhat.com
Thu Jun 6 04:38:50 UTC 2013


On 6/3/13 9:59 AM, Brian Millett wrote:
> On Sun,  2 Jun 2013 15:05:21 -0400
> Jeffrey Blank<blank at eclipse.ncsc.mil>  wrote:
>
>> >
>> >Signed-off-by: Jeffrey Blank<blank at eclipse.ncsc.mil>
>> >---
>> >  RHEL6/transforms/combinefixes.py |   97
>> >+++++++++++++++++--------------------- 1 files changed, 44 insertions(+), 53
>> >deletions(-)
>> >
>> >diff --git a/RHEL6/transforms/combinefixes.py
>> >b/RHEL6/transforms/combinefixes.py index f9d8b7f..71fbe6f 100755
>> >--- a/RHEL6/transforms/combinefixes.py
>> >+++ b/RHEL6/transforms/combinefixes.py
>> >@@ -1,58 +1,49 @@
>> >  #!/usr/bin/python
>> >  
>> >-import sys, os
>> >-
>> >-header = '''<fix-content system="urn:xccdf:fix:script:sh"
>> >xmlns="http://checklists.nist.gov/xccdf/1.1">\n''' -footer =
>> >'</fix-content>\n' -fixGroupHeader = '''<fix-group id="bash"
>> >system="urn:xccdf:fix:script:sh"
>> >xmlns="http://checklists.nist.gov/xccdf/1.1">\n''' -fixGroupFooter =
>> >'</fix-group>\n' -fixCommonGroupHeader = '''<fix-common-group
>> >id="bash-common" xmlns="http://checklists.nist.gov/xccdf/1.1">\n'''
>> >-fixCommonGroupFooter = '</fix-common-group>\n' - -def encode(text):
>> >-    text = text.replace('&','&amp;')
>> >-    text = text.replace('>','&gt;')
>> >-    text = text.replace('<','&lt;')
>> >-    return text
>> >+import sys, os, re, lxml.etree as etree
> Jeff, this is great!  The lxml.etree is pretty cool.  How do you know or how
> to find out about these gems?  I'm really familiar with "cpan" for perl, is
> there something similar for python?


Check out https://pypi.python.org/pypi, specifically the "List Packages" 
link!


More information about the scap-security-guide mailing list