-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for timestamps in the cosign custom predicate, and docume…
…nt it. (#533) Signed-off-by: Dan Lorenc <[email protected]>
- Loading branch information
dlorenc
authored
Aug 11, 2021
1 parent
4c76ff3
commit 61b103b
Showing
2 changed files
with
50 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Cosign Generic Predicate Specification | ||
|
||
`Cosign` supports working with [In-Toto Attestations](https://github.com/in-toto/attestation) using the predicate model. | ||
Several well-known predicates are supported natively, but `cosign` also supports a simple, generic, format for data that | ||
doesn't fit well into other types. | ||
|
||
The format for this is defined as follows: | ||
|
||
`data`: Raw data to place in the attestation. This is a base64-encoded string of bytes. | ||
`timestamp`: The timestamp the attestion was generated at in the RFC3339 format in the UTC timezone. | ||
|
||
Here is an example attestation containing a data file containing `foo`: | ||
|
||
```json | ||
{ | ||
"_type": "https://in-toto.io/Statement/v0.1", | ||
"predicateType": "cosign.sigstore.dev/attestation/v1", | ||
"subject": [ | ||
{ | ||
"name": "us.gcr.io/dlorenc-vmtest2/demo", | ||
"digest": { | ||
"sha256": "124e1fdee94fe5c5f902bc94da2d6e2fea243934c74e76c2368acdc8d3ac7155" | ||
} | ||
} | ||
], | ||
"predicate": { | ||
"Data": "foo\n", | ||
"Timestamp": "2021-08-11T14:51:09Z" | ||
} | ||
} | ||
``` |