You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ Trestle provides tooling to help orchestrate the compliance process across a num
34
34
- Tooling manage authoring and governance of markdown and drawio files withn a repository.
35
35
- Support within trestle to streamline management within a managed git environment.
36
36
- An underlying object model that supports developers interacting with OSCAL artefacts.
37
+
- Detached signing and verification for JSON artifacts. See the [`trestle sign` and `trestle verify` CLI documentation](tutorials/cli.md#trestle-sign).
|`canonicalization`| The canonicalization algorithm applied before hashing. Trestle uses `RFC8785`. |
61
+
|`digestAlgorithm`| The digest algorithm used over the canonical JSON bytes. Trestle uses `sha256`. |
62
+
|`digestSource`| The bytes that were hashed. `canonical-json` means the digest was computed over the RFC 8785 canonical JSON bytes, not the original file bytes. |
63
+
|`tool`| The producer of the predicate. Trestle writes `compliance-trestle`. |
Copy file name to clipboardExpand all lines: docs/tutorials/cli.md
+64-1Lines changed: 64 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,14 @@ description: An introductory tutorial into trestle's CLI and OSCAL use cases
5
5
6
6
# trestle CLI Overview and OSCAL usecases
7
7
8
-
The trestle CLI has five primary use cases:
8
+
The trestle CLI has six primary use cases:
9
9
10
10
- Serve as tooling to generate and manipulate OSCAL files directly by an end user. The objective is to reduce the complexity of creating and editing workflows. Example commands are: `trestle import`, `trestle create`, `trestle split`, `trestle merge`.
11
11
- Act as an automation tool that, by design, can be an integral part of a CI/CD pipeline e.g. `trestle validate`, `trestle tasks`.
12
12
- Allow governance of markdown documents so they conform to specific style or structure requirements.
13
13
- Canonicalize JSON documents with `trestle canonicalize`. See [Canonicalizing JSON documents](canonicalization.md).
14
14
- Manage experimental commands with `trestle beta`.
15
+
- Sign and verify JSON artifacts with detached DSSE envelopes.
15
16
16
17
To support each of these use cases trestle creates an opinionated directory structure to manage governed documents.
17
18
@@ -593,6 +594,68 @@ By default validate will display warning messages and a message indicating the f
593
594
The links validator is special because it always returns success that the file is valid - but it will list any inconsistencies it finds between the
594
595
references to links, and corresponding links in the backmatter.
595
596
597
+
## `trestle sign`
598
+
599
+
Trestle sign writes a detached DSSE envelope for a JSON file. It canonicalizes the JSON using RFC 8785, computes a SHA-256 digest, records that digest in an in-toto Statement, and signs the Statement with a PEM private key.
600
+
601
+
The sign and verify commands are beta features. Enable them before use:
602
+
603
+
```bash
604
+
trestle beta enable json-signing
605
+
```
606
+
607
+
You can also pass `--beta` to `trestle sign` or `trestle verify` to run the beta command one time without writing beta state to config.
608
+
609
+
Generate an Ed25519 private/public key pair with OpenSSL:
The private key is used for signing. Keep it secret. The public key can be shared with users or systems that need to verify signatures.
618
+
619
+
```bash
620
+
trestle sign \
621
+
-f catalog.json \
622
+
--key private.pem \
623
+
-o catalog.json.dsse
624
+
```
625
+
626
+
For an encrypted private key, use `--key-password-env`. The option names an environment variable that contains the password, so the password is not passed as a command-line argument.
The `--subject-name` option records a subject name other than the input file name. Verification must use the same subject name.
643
+
644
+
The signed Statement uses the [OSCAL signing predicate](../predicates/oscal-signing/v1.md).
645
+
646
+
## `trestle verify`
647
+
648
+
Trestle verify checks a JSON file against a detached DSSE envelope and a PEM public key. Verification checks the DSSE signature, the predicate fields, and the SHA-256 digest of the RFC 8785 canonical JSON bytes.
649
+
650
+
```bash
651
+
trestle verify \
652
+
-f catalog.json \
653
+
--signature catalog.json.dsse \
654
+
--key public.pem
655
+
```
656
+
657
+
If signing used `--subject-name`, pass the same value during verification.
658
+
596
659
## `trestle tasks`
597
660
598
661
Open Shift Compliance Operator and Tanium are supported as 3rd party tools.
0 commit comments