GithubHelp home page GithubHelp logo

aaronlippold / xccdf2inspec Goto Github PK

View Code? Open in Web Editor NEW
11.0 10.0 3.0 556 KB

***MERGED: SEE README:*** The XCCDF to InSpec parser scans and extracts the controls defined in the DISA XCCDF STIG XML documents and converts them into InSpec control 'stubs' to help ease the pain of InSpec profile developers everywhere.

Home Page: https://github.com/aaronlippold/xccdf2inspec

License: Other

Ruby 100.00%
inspec xccdf stig disa oval wip

xccdf2inspec's Issues

get_nist_reference needs to be refactored to accept a NodeSet and return an array of hashs {nist_ref,nist_ver}

The way the parser is currently written does not account for the fact that what the cci xpath statement in the xccdf_to_inspec method is really returning is a NodeSet and that could have more than one item in the list.

The method needs to be refactored so that is accounts for the data it is really getting and that what is returned an array of hashes like, [cci] -> {nist_ref,nist_rev}, this way the template can easily print out the tags with 'each' loop.

This change will also have to update the xccdd_to_inspec method and how it creates the template so that it can generate one or more tags in the loop.

=== example of bug ===
tag gtitle: 'SRG-APP-000142-DB-000094'
tag gid: 'V-72841'
tag rid: 'SV-87493r1_rule'
tag stigid: 'PGS9-00-000100'

tag cci: 'CCI-000382CCI-001762'
tag nist: ''
tag nist_rev: ''

make me work on windows

If you have a windows box can you see if we just need to dos2unix or utf-8 encode the input file from windows etc.

Thanks,

Add Gemfile

It would be helpful and ease first time users of this script to add a Gemfile to this repo.

Add a method to pull/check the most current disa cci list

Webpage for disa CCI is here - I think we will need to build in this process.

  • in the data directory - we have an cci xml file we need to see if it is the most current
    ( we may just want to always pull the most current but want to cover the disconnected case )
  • pull the disa web page
    ( perhaps print out a warning that we may or may not have the most current cci file )
  • check the data on xml file or on the disa web page
  • pull the zip file and get the most current xml file
  • continue

Fix the parsing / printing of the “fix” and “check”, "Title" and "Desc" strings

I would really like to fix the parsing / printing of the “fix” and “check” strings so that:

BAD: ( one long ugly but correctly escaped string )

“Using pgaudit PostgreSQL can be configured to audit various facets of PostgreSQL. See supplementary content APPENDIX-B for documentation on installing pgaudit.\n\nAll errors, denials and unsuccessful requests are logged if logging is enabled. See supplementary content APPENDIX-C for documentation on enabling logging.\n\nNote: The following instructions use the PGDATA”

GOOD: (respects \n\n and \n etc. and is wrapped at either 120 or 80 chars)

“Using pgaudit PostgreSQL can be configured to audit various facets of PostgreSQL. See supplementary content APPENDIX-B for
documentation on installing pgaudit.

All errors, denials and unsuccessful requests are logged if logging is enabled. See supplementary content APPENDIX-C for
documentation on enabling logging.

Note: The following instructions use the PGDATA”

To make the resulting inspec stubs more human readable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.