A Python module to parse DISA STIG (XCCDF) Files
Project description
About
A basic Python package to parse DISA STIG (XCCDF) Files into a readable JSON format.
Installation
To install stig-parser, simple run the following command:
pip install stig-parser
Version Updates
Version | Description |
---|---|
1.0.0 | Initial Creation of stig-parser |
1.0.1 | Updated to handle change to STIG schema (Issue #3) |
Documentation
Documentation hasn't been created at this time. For the current development documentation, please visit the repository.
Usage
To use this package simply, import the module and run the convert-xccdf()
function. This will result in the a JSON String object.
## LOAD PYTHON MODULE
from stig_parser import convert_xccdf
## LOAD XML FILE (OPTIONAL)
import os
with open("example.xml", "r") as fh:
raw_file = fh.read()
## PARSE XCCDF(XML) to JSON
json_results = convert_xccdf(raw_file)
Output
Outlined below is the expected JSON output:
{
benchmark_date: "xxxxxxx",
description: "xxxxxxxx",
release: "xx",
rules: [
{
"check": "xxxxxxxx",
"description": "xxxxxxxxxx",
"fixtext": "xxxxxxxxxx",
"id": "xxxxxxx",
"severity": "xxxxxxxx",
"stig_id": "xx-xx-xxxxxx",
"title": "xxxxxxxxxxx"
},
{
"check": "xxxxxxxx",
"description": "xxxxxxxxxx",
"fixtext": "xxxxxxxxxx",
"id": "xxxxxxx",
"severity": "xxxxxxxx",
"stig_id": "xx-xx-xxxxxx",
"title": "xxxxxxxxxxx"
}
],
title: "xxxxxxxxxx",
version: "xxxxxxxxx"
}
Dependencies
The following packages are required for this package:
Package Name | Reason |
---|---|
xmltodict | This converts the raw XML file to a python dictionary for ease of processing |
Comments, Concerns and Gripes
If you have any comments, concerns and/or gripes, please feel free to submit an issue on the repository.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for stig_parser-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f1ca2494a008679583dbbb5305b51989f808ced8a2796bd192a1dd0924d30e4 |
|
MD5 | 8b1e1c875c928e8ab9115e5b92bf8593 |
|
BLAKE2b-256 | e9c1214ad293392e9b5d978bd9f5029bca0f0432044c912ecdbfe18efa21a3e7 |