Convert CSV to OSCAL Component Definition
trestle_task_csv_to_oscal_cdConvert a structured CSV into an OSCAL component definition JSON file to automate compliance documentation and control mapping.
Instructions
Convert a CSV file to an OSCAL component definition JSON file.
This tool runs the trestle task csv-to-oscal-cd command, which reads a specially formatted CSV file and produces an OSCAL component_definition .json file.
The CSV must have:
Row 1: column headings
Row 2: column descriptions
Row 3+: data rows
Required CSV columns:
$$Component_Title, $$Component_Description, $$Component_Type
$$Rule_Id, $$Rule_Description, $$Profile_Source, $$Profile_Description
$$Control_Id_List, $$Namespace
Args: params (TrestleTaskCsvToOscalCdInput): Input parameters with: - title (str): Component definition title (required) - version (str): Component definition version (required) - csv_file (str): Path to the input CSV file (required) - output_dir (str): Output directory for OSCAL JSON files (required) - component_definition (Optional[str]): Existing component-definition to update (optional) - output_overwrite (bool): Overwrite existing output (default: true) - validate_controls (str): Control validation mode: on/warn/off (default: off) - class_column_mappings (Optional[dict]): Column-to-class mappings (optional) - trestle_root (Optional[str]): Trestle workspace root path (optional) - verbose (bool): Display verbose output (optional)
Returns: str: Success or error message with output file location
Examples: - Use when: "Convert CSV to OSCAL component definition" - Use when: "Generate component_definition.json from a CSV mapping file" - Don't use when: Input CSV is missing required columns
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |