Skip to content

Commit

Permalink
feat: demo of trestle task osco-to-oscal (#8)
Browse files Browse the repository at this point in the history
* feat: demo of trestle task osco-to-oscal

* Add trestle init to sequence of steps for demo.

* Update trestle task examples section on landing page.
  • Loading branch information
degenaro authored Nov 4, 2021
1 parent aba8398 commit a002f13
Show file tree
Hide file tree
Showing 4 changed files with 775 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@ The Centre for Internet Security (CIS) produce a number of cross industry standa

## Task Examples

### Converting a spreadsheet into a `component-definition`

Plenty of compliance content exists today in spreadsheets. This [demonstration](./trestle_task_spread_sheet_to_component_definition) show how to use the xlsx-to-oscal-component-definition MVP functionality.
- Convert a spreadsheet into a `component-definition`
<br>
This [demonstration](./trestle_task_spread_sheet_to_component_definition) shows how to use the `trestle task xlsx-to-oscal-component-definition` functionality.
<br>
<br>
- Convert an OpenShift Compliance Operator (OSCO) results into a partial `assessment-results`
<br>
This [demonstration](./trestle_task_osco_to_oscal) shows how to use the `trestle task osco-to-oscal` functionality.
<br>

## License & Authors

Expand Down
72 changes: 72 additions & 0 deletions trestle_task_osco_to_oscal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# compliance-trestle-task-osco-to-oscal-demo

Simple example of using trestle to facilitate transforming OSCO results to OSCAL (partial) results.

## Prerequisites

Download this repo

```
> cd
> mkdir git
> cd git
> git clone https://github.com/IBM/compliance-trestle-demos
```

Install compliance trestle, ideally in a python virtual environment.

```
> cd
> python -m venv venv.compliance-trestle-demos
> source venv.compliance-trestle-demos/bin/activate
> cd git/compliance-trestle-demos
> make install
```

Running the demo

```
> cd
> cd git/compliance-trestle-demos/trestle_task_osco_to_oscal
> trestle init
> trestle task osco-to-oscal -c ./demo-osco-to-oscal.config
output: osco/runtime/ssg-ocp4-ds-cis-111.222.333.444-pod.oscal.json
inventory: 1
observations: 125
results: {}
Task: osco-to-oscal executed successfully.
```

Viewing the result

```
> cat osco/runtime/ssg-ocp4-ds-cis-111.222.333.444-pod.oscal.json
{
"results": [
{
"uuid": "5a69ce39-9ec9-4ded-8556-2c94a5b4e554",
"title": "OpenShift Compliance Operator",
"description": "OpenShift Compliance Operator Scan Results",
"start": "2021-09-09T19:18:09.000+00:00",
"end": "2021-09-09T19:18:09.000+00:00",
"local-definitions": {
"components": [
{
"uuid": "1690228d-860d-4fa0-a43b-c95f2f53410e",
"type": "Service",
"title": "Red Hat OpenShift Kubernetes Service Compliance Operator for ocp4",
"description": "Red Hat OpenShift Kubernetes Service Compliance Operator for ocp4",
"status": {
"state": "operational"
}
}
],
"inventory-items": [
{
"uuid": "d4dff670-fe5e-4324-94aa-c1fffdef17c5",
"description": "inventory",
"props": [
...
```
5 changes: 5 additions & 0 deletions trestle_task_osco_to_oscal/demo-osco-to-oscal.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[task.osco-to-oscal]

input-dir = osco/input
output-dir = osco/runtime
output-overwrite = true
Loading

0 comments on commit a002f13

Please sign in to comment.