|
| 1 | +# trestle-bot |
| 2 | + |
| 3 | +[](https://github.com/pre-commit/pre-commit) |
| 4 | +[](http://www.apache.org/licenses/LICENSE-2.0.html) |
| 5 | +[](https://sonarcloud.io/summary/new_code?id=rh-psce_trestle-bot) |
| 6 | +[](https://sonarcloud.io/summary/new_code?id=rh-psce_trestle-bot) |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +trestle-bot assists users in leveraging [Compliance-Trestle](https://github.com/oscal-compass/compliance-trestle) in CI/CD workflows for [OSCAL](https://github.com/usnistgov/OSCAL) formatted compliance content management. |
| 11 | + |
| 12 | +> WARNING: This project is currently under initial development. APIs may be changed incompatibly from one commit to another. |
| 13 | +
|
| 14 | +## Getting Started |
| 15 | + |
| 16 | +### Available Commands |
| 17 | + |
| 18 | +The `autosync` command will sync trestle-generated Markdown files to OSCAL JSON files in a trestle workspace. All content under the provided markdown directory when the action is run will be transformed. This action supports all top-level models [supported by compliance-trestle for authoring](https://oscal-compass.github.io/compliance-trestle/tutorials/ssp_profile_catalog_authoring/ssp_profile_catalog_authoring/). |
| 19 | + |
| 20 | +The `rules-transform` command can be used when managing [OSCAL Component Definitions](https://pages.nist.gov/OSCAL-Reference/models/v1.1.1/component-definition/json-outline/) in a trestle workspace. The action will transform rules defined in the rules YAML view to an OSCAL Component Definition JSON file. |
| 21 | + |
| 22 | +The `create-cd` command can be used to create a new [OSCAL Component Definition](https://pages.nist.gov/OSCAL-Reference/models/v1.1.1/component-definition/json-outline/) in a trestle workspace. The action will create a new Component Definition JSON file and corresponding directories that contain rules YAML files and trestle-generated Markdown files. This action prepares the workspace for use with the `rules-transform` and `autosync` actions. |
| 23 | + |
| 24 | +The `sync-upstreams` command can be used to sync and validate upstream OSCAL content stored in a git repository to a local trestle workspace. Which content is synced is determined by the `include_model_names` and `exclude_model_names` inputs. |
| 25 | + |
| 26 | +The `create-ssp` command can be used to create a new [OSCAL System Security Plans](https://pages.nist.gov/OSCAL-Reference/models/v1.1.1/system-security-plan/json-outline/) (SSP) in a trestle workspace. The action will create a new SSP JSON file and corresponding directories that contain trestle-generated Markdown files. This action prepares the workspace for use with the `autosync` action by creating or updating the `ssp-index.json` file. The `ssp-index.json` file is used to track the relationships between the SSP and the other OSCAL content in the workspace for the `autosync` action. |
| 27 | + |
| 28 | +Below is a table of the available commands and their current availability as a GitHub Action: |
| 29 | + |
| 30 | +| Command | Available as a GitHub Action | |
| 31 | +|--------------------|------------------------------| |
| 32 | +| `autosync` | ✓ | |
| 33 | +| `rules-transform` | ✓ | |
| 34 | +| `create-cd` | ✓ | |
| 35 | +| `sync-upstreams` | ✓ | |
| 36 | +| `create-ssp` | | |
| 37 | + |
| 38 | +For detailed documentation on how to use each action, see the README.md in each folder under [actions](./actions/). |
| 39 | + |
| 40 | +### Supported Git Providers |
| 41 | + |
| 42 | +> Note: Only applicable if using `trestle-bot` to create pull requests. Automatically detecting the git |
| 43 | +provider information is supported for GitHub Actions (GitHub) and GitLab CI (GitLab). |
| 44 | + |
| 45 | +- GitHub |
| 46 | +- GitLab |
| 47 | + |
| 48 | +### Run as a Container |
| 49 | + |
| 50 | +> Note: When running the commands in a container, all are prefixed with `trestlebot` (e.g. `trestlebot-autosync`). The default entrypoint for the container is the autosync command. |
| 51 | +
|
| 52 | +Build and run the container locally: |
| 53 | + |
| 54 | +```bash |
| 55 | +podman build -f Dockerfile -t trestle-bot . |
| 56 | +podman run -v $(pwd):/data -w /data trestle-bot |
| 57 | +``` |
| 58 | + |
| 59 | +Container images are available in `quay.io`: |
| 60 | + |
| 61 | +```bash |
| 62 | +podman run -v $(pwd):/data -w /data quay.io/continuouscompliance/trestle-bot:<tag> |
| 63 | +``` |
| 64 | + |
| 65 | +## Contributing |
| 66 | + |
| 67 | +For information about contributing to trestle-bot, see the [CONTRIBUTING.md](./CONTRIBUTING.md) file. |
| 68 | + |
| 69 | +## License |
| 70 | + |
| 71 | +This project is licensed under the Apache 2.0 License - see the [LICENSE.md](LICENSE) file for details. |
| 72 | + |
| 73 | +## Troubleshooting |
| 74 | + |
| 75 | +See [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for troubleshooting tips. |
0 commit comments