Skip to content

Commit

Permalink
doc: CPLYTM-498 add document for sync-cac-content
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Wang <huiwang@redhat.com>
  • Loading branch information
huiwangredhat committed Jan 27, 2025
1 parent f66b7fa commit fe1e3c4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions docs/tutorials/sync-cac-content.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit fe1e3c4

Please sign in to comment.