diff --git a/README.md b/README.md index 6d83ca7a..3f315669 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ Below is a table of the available commands and their current availability as a G For detailed documentation on how to use each action, see the README.md in each folder under [actions](./actions/). +Also the available command `sync-cac-content` supports transforming the [Cac content](https://github.com/ComplianceAsCode/content) to OSCAL component definition in a trestle workspace. For detailed documentation on how to use, see the sync-cac-content.md under [docs/tutorials](./docs/tutorials/). + ### Supported Git Providers > Note: Only applicable if using `trestle-bot` to create pull requests. Automatically detecting the git diff --git a/docs/tutorials/sync-cac-content.md b/docs/tutorials/sync-cac-content.md new file mode 100644 index 00000000..65cca29e --- /dev/null +++ b/docs/tutorials/sync-cac-content.md @@ -0,0 +1,36 @@ +# The trestlebot command line sync-cac-content Tutorial + +This tutorial provides how to use `trestlebot sync-cac-content` to create OSCAL component definitions by transforming Cac content control files. + +The CLI performs the following transformations: + +- Populate CaC product information to Oscal component title and description +- Ensure OSCAL component control mappings are populated with rule and rule parameter data from CaC control files +- Create a validation component from SSG rules to check mappings +- Ensure OSCAL Component Definition implemented requirements are populated from control notes in the control file +- Ensure implementation status of an implemented requirement in OSCAL component definitions are populated with the status from CaC control files + +## 1. Prerequisites + +- Initialize the [trestlebot workspace](https://github.com/complytime/trestle-bot/blob/main/docs/tutorials/github.md#3-initialize-trestlebot-workspace). + +- Pull the [CacContent repository](https://github.com/ComplianceAsCode/content). + +## 2. Run the CLI sync-cac-content +`poetry run trestlebot sync-cac-content \ + --repo-path $trestlebot_workspace_directory \ + --branch main \ + --cac-content-root ~/content \ + --cac-profile $CacContentRepo/content/products/ocp4/profiles/high-rev-4.profile \ + --oscal-profile $OSCAL-profile-name \ + --committer-email test@redhat.com \ + --committer-name tester \ + --product $productname \ + --dry-run \ + --component-definition-type $type` + +For more details about these options and additional flags, you can use the --help flag: +`poetry run trestlebot sync-cac-content --help' +This will display a full list of available options and their descriptions. + +After run the CLI with the right options, you would successfully generate an OSCAL component definition under $trestlebot_workplace_director/component-definitions/$product_name.