OSCAL Parser Skill
Parse OSCAL documents in any supported format (JSON, YAML, XML) and extract structured data for compliance analysis.
When to Use This Skill
Use this skill when you need to:
- Read and parse OSCAL documents from files
- Detect the format and model type of an OSCAL document
- Extract metadata, controls, components, or other OSCAL elements
- Convert OSCAL data into a workable structure for further analysis
✅ Data Source Principle
This skill operates only on documents you provide. It reads and parses — it does not generate compliance data from training knowledge. All output comes directly from your OSCAL document.
Supported Formats
| Format | Extensions | Notes |
|--------|------------|-------|
| JSON | .json | Most common format, fastest parsing |
| YAML | .yaml, .yml | Human-readable, good for editing |
| XML | .xml | Legacy format, full schema support |
OSCAL Model Types
The parser automatically detects these OSCAL model types:
- Catalog - Security control catalogs (e.g., NIST 800-53)
- Profile - Control baselines and overlays
- System Security Plan (SSP) - System security documentation
- Component Definition - Reusable component security capabilities
- Assessment Plan - Assessment procedures
- Assessment Results - Assessment findings
- Plan of Action and Milestones (POA&M) - Remediation tracking
How to Parse an OSCAL Document
Step 1: Identify the File
Confirm the file path and check the extension to determine format.
Step 2: Parse the Content
Based on the format:
- JSON: Parse using standard JSON parsing
- YAML: Parse using YAML safe loading
- XML: Parse using XML to dictionary conversion
Step 3: Detect Model Type
Examine the root keys to identify the document type:
- Look for keys like
catalog,profile,system-security-plan, etc. - The presence of specific keys indicates the model type
Step 4: Extract Key Information
For each model type, extract:
Catalog:
metadata- Title, version, OSCAL versiongroups- Control familiescontrols- Individual security controlsback-matter- Resources and references
System Security Plan:
metadata- System identificationimport-profile- Baseline referencesystem-characteristics- System descriptionsystem-implementation- Implementation detailscontrol-implementation- How controls are implemented
Component Definition:
metadata- Component identificationcomponents- Individual componentscapabilities- Component capabilities
Output Structure
When parsing is complete, provide:
- Format detected (JSON/YAML/XML)
- Model type (catalog, SSP, etc.)
- Metadata summary (title, version, last modified)
- Content summary (count of controls, components, etc.)
- Any parsing warnings or issues
Example Usage
When asked "Parse this OSCAL catalog and tell me what's in it":
- Read the file content
- Detect format from extension
- Parse the content
- Identify it as a catalog
- Report:
- Title and version
- Number of control families
- Total number of controls
- OSCAL version used
Error Handling
Handle these common issues:
- File not found: Verify the path is correct
- Invalid format: Check file extension matches content
- Malformed content: Report specific parsing errors
- Unknown model type: List root keys for manual identification