Open trishankatdatadog opened 1 year ago
We've been experimenting with a source attestation type over at sigstore/gitsign
that is a bit closer to the git commit format - https://github.com/sigstore/gitsign/blob/main/internal/commands/show/testdata/fulcio-cert.out.json
You can try this out with gitsign show
(it also works with non-gitsign signatures). It doesn't do the per-file attestations like @trishankatdatadog's attestation above, but I don't see a reason why both attestation types can't exist. 😃
We've also been experimenting with storing attestations to git repo data inside the repo itself with gitsign attest
(right now commits and trees, but we could add support for any git type). - @adityasaky has some other interesting ideas in this area to combine git + tuf. 🎉
I believe the two are closely linked and there are use cases for both. I do want to note that a link predicate type has been proposed from the start: https://github.com/in-toto/attestation/blob/main/spec/predicates/link.md. IMO it can go both ways, we can use gitsign's commit attestation and verify a CI system built off the right commit (i.e., using git semantics all the way) or we can use links to record the sources directly.
I have been meaning to have the link predicate get the ITE-9 treatment so I think it's a good idea to leave this thread open and discuss ideas. cc @in-toto/attestation-maintainers
I think it's helpful to define an explicit Source Attestation, just like you want an explicit, say, Review Attestation.
I think it's helpful to define an explicit Source Attestation, just like you want an explicit, say, Review Attestation.
Looks like what you're proposing is a per-file vcs commit attestation ("source code attestation" probably means different things for different people)? Trying to understand what the requirements are so we can develop a meaningful predicate. What is unique to these attestations that can't be expressed/covered by a Link? What types of trust or security questions should such a predicate be able to answer?
What is unique to these attestations that can't be expressed/covered by a Link? What types of trust or security questions should such a predicate be able to answer?
IDK yet, but these are some of the questions I'm trying to find answers for, so thanks for raising them 🙂
A use case would be to record extra metadata such as what was the original codebase which this one forked from, and exactly what changes have been made
Cc @MarkLodato
We have implimented a git
attestor in Witness. ref: https://github.com/testifysec/go-witness/blob/main/attestation/git/git.go
@colek42 do you have any docs that describe how that attestation works?
We do not yet. But I threw together a spec based on that struct and some WIP we have
{
"_type": "https://in-toto.io/Statement/v0.1",
"subject": [
{
"name": "commithash:<COMMIT_HASH>",
"digest": { "<ALGORITHM>": "<HEX_VALUE>", ... }
},
...
],
"predicateType": "https://witness.dev/attestations/git/v0.1",
"predicate": {
"commithash": "<COMMIT_HASH>",
"author": "<AUTHOR_NAME>",
"authoremail": "<AUTHOR_EMAIL>",
"committername": "<COMMITTER_NAME>",
"committeremail": "<COMMITTER_EMAIL>",
"commitdate": "<COMMIT_DATE>",
"commitmessage": "<COMMIT_MESSAGE>",
"status": {
"<FILE_PATH>": {
"worktree": "<WORKTREE_STATUS>",
"staging": "<STAGING_STATUS>"
},
...
},
"commitdigest": {
"<DIGEST_ALGORITHM>": "<DIGEST_HEX_VALUE>"
},
"signature": "<PGP_SIGNATURE>",
"
"parenthashes": [
"<PARENT_COMMIT_HASH_1>",
"<PARENT_COMMIT_HASH_2>",
...
],
"treehash": "<TREE_HASH>",
"refs": [
"<REFERENCE_1>",
"<REFERENCE_2>",
...
],
"tags": [
{
"name": "<TAG_NAME>",
"taggername": "<TAGGER_NAME>",
"taggeremail": "<TAGGER_EMAIL>",
"when": "<TAG_CREATION_TIME>",
"pgpsignature": "<PGP_SIGNATURE>",
"message": "<TAG_MESSAGE>"
},
...
],
"changedFiles": {
"<FILE_PATH_1>": {
"digest": { "<ALGORITHM>": "<HEX_VALUE>", ... }
},
"<FILE_PATH_2>": {
"digest": { "<ALGORITHM>": "<HEX_VALUE>", ... }
},
...
}
}
}
Presently, there is no proposed Attestation for recording metadata about source code that developers may have written. For example, the Datadog Agent Integrations use in-toto links to record what source code was checked in by whom.
An example Source Attestation may look like:
Developers may wish to record direct metadata about source code files (as in the example above) to allow for immediate verification of source code by clients, or indirect metadata about them (e.g., git tree hashes).
Cc @developer-guy @wlynch @adityasaky